|
I imagine the answer is probably that the data should be stored as numbers, so that it reflects the current culture when it is read in. I think there may be a tryParse that takes a culture, so you could convert from the known source culture, put in the table as double, and then let the system display it correctly ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
another way is setting the culture and then changing it
Dim dt As New DataTable
Dim myCultureInfo As New System.Globalization.CultureInfo("nb-NO")
dt.Locale = myCultureInfo
dt.Columns.Add("T", System.Type.GetType("System.Decimal"))
Dim dr As DataRow
dr = dt.NewRow
dr(0) = "70,1"
dt.Rows.Add(dr)
dr = dt.NewRow
dr(0) = "80,1"
dt.Rows.Add(dr)
Dim myCultureInfo1 As New System.Globalization.CultureInfo("en-US")
dt.Locale = myCultureInfo1
|
|
|
|
|
Im looking for some help;
I have a windows application devekoped. In vb.net
I have a crystal report viewer for displaying my reports, I have various different report forms which use this viewer.
My problem is that the export button defaults to a .rpt extension , and I need it to default to .xls
I have come across the exportoptions class and created a button using this, but this exports as soon as button is hit.
I want the exact same functionality as you get for the standard export button, I just don’t want the default save as to be ‘rpt’, I want it to be ‘xls’ and still allow the user to changes their export type, probably involving the SaveFiledialog component
Prob is.. I have no idea how its done.. anyone got any ideas or better some code. Id really appreciate help on this.
|
|
|
|
|
I have a program that does something similar, but I always export to PDF. I don't think there is a way to set the default file extension of the export button on the viewer. You need to hide the button on the crystal reports viewer and create your own version of the button in order to do what you are asking. In order to export it, you need to use the ExportToDisk method on the ReportDocument object, not the Viewer. You don't actually even need a crystal reports viewer object to export a report, only to display it to the user.
|
|
|
|
|
Ooops, I meant to comment about the dialog too. Drag a Save Dialog box control onto your form, to set the default file extension you would do something like this:
'This sets default settings on a save dialog called dlgExport
With dlgExport
.Filter = "Excel Files (*.xls)|*.xls|All Extensions (*.*)|*.*"
.FilterIndex = 1
.RestoreDirectory = True
.Title = "Export"
.AddExtension = True
.FileName = String.Empty
End With
'This is what you would put in the export button's click event:
If dlgExport.ShowDialog = Windows.Forms.DialogResult.OK Then
'You probably want to add checks to make sure dlgExport.FileName is valid first
reportDocument1.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.Excel, dlgExport.FileName)
End If
|
|
|
|
|
Works Perfect! Thank you.
|
|
|
|
|
Hello,
could someone please give me an idea how to get the localized folder names (e.g. 'users', 'program files' etc) in VB.NET? I'm using the GetDirectories method, and can only get the English folder names.
Thank you
Michael
modified on Friday, June 12, 2009 3:12 AM
|
|
|
|
|
Michael Schäuble wrote: could someone please give me an idea how to get the localized folder names (e.g. 'users', 'program files' etc) in VB.NET? I'm using the GetDirectories method, and can only get the English folder names.
I'm not quite understanding what you want. If you ask for a list of directories you will get back a list of what exists on the disk. If the directrory names are in your local language then that is what you will get.
Or, are you looking for something line Environment.SpecialFolder[^] which is used in conjunction with Environment.GetFolderPath[^]?
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
I've just seen your other question and I think I understand a little better now, but it stumped me. I've not seen that before (and I have used the Dutch and Spanish versions of Windows in he past).
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
From the responses I figured that I'm facing an unusual behaviour of GetDirectories!
So I published the project and run it on an XP Machine... finding out that under XP I get the localized (German) folder names shown! Under Vista, GetDirectories lists the English folder names only.
Does anyone know a bit more about the issue?
Thanks a lot,
Michael
|
|
|
|
|
How to looping all items in combobox in a web page with a for next???
Just for example use one combobox from a web page wich you desire
I know Html Library and use the ie object
|
|
|
|
|
Your going to have to expain what you're doing with this a bit more. Are you saying you want to iterate through the items in a combo on the client-side?? Or are you retrieving a web page in your VB.NET code and trying to get at the combo box in the HTML you get back??
|
|
|
|
|
How can I get ARW Thumbnails with VB.Net. Windows Explorer can! So there should be a solution......
Regards
Hans
|
|
|
|
|
I assume you're talking about the Sony RAW image format. The software you install for the Sony camera installs a componet that is registered with Explorer to generate the thumbnail images. Explorer actually doesn't generate the images at all. It just calls various components that register themselves with Explorer so Explorer knows which one to call to have a thumbnail generated.
No, I don't know what that component is called or how to get at it.
|
|
|
|
|
Working on converting an application from VB6 to .net.
After conversion I got the following error:
A custom wrapper for this COM component has been installed on your machine after you added this reference. This wrapper may provide additional cpabilities not offered by the auto-generated wrapper currently in use
it asked if I wanted to update it so I did, now I get several errors
'MSComctlib.Button' add one to you project.
I am not sure exactly what this is telling me to do...
Help!
[edit] never mind. Figured out what happened... boy this is fun....
modified on Thursday, June 11, 2009 2:23 PM
|
|
|
|
|
Yeah, VB6 and VB.NET are so vastly different as to pretty much require you to scrap your VB^ project and rewrite it from scratch. At least that's what I recommend doing.
The conversion wizard was not meant to convert VB6 to VB.NET and leave the resulting code in place and treated as the prodiction app. It was meant to convert your project to the point where you can start to rewrite the app piece-by-piece, releasing incemental version, without having to rewrite the entire app all at once.
|
|
|
|
|
that is what I am finding. For the most part it is not too bad. The biggies I have to change are my use of control arrays (what a pain), the popup menu's (after the control arrays) and a bunch of work with a printer which you can't do in .net. like you could in 6
I would say that is probably 90% clean convert other than that, probably because I tried to follow good practices when I wrote it originally (10+ years ago)... at least I would like to think so...
Mike
|
|
|
|
|
Hello Champs,
I hope you're laughing at my question and have plenty of solutions right on your fingertips What might be important to know is that I'm using the German Version of Vista.
In my application, the line
Dim drv as DriveInfo
For Each di As DirectoryInfo In drv.RootDirectory.GetDirectories("*", SearchOption.TopDirectoryOnly)
...(code)
Next returns an array of subdirectories (just as it's supposed to ), which obviously contains
a) all the hidden directories
b) several directories with their English AND their German names (i.a. "Programme" AND "Program Files")
In the end I have 18 directories counted instead of 12 which I can see in the explorer. Filtering them by names in the GetDirectories filter option doesn't make a lot of sense, right?
But how can I restrict my array to the directories which are visible in the Explorer
Thanks for helping ,
Michael
|
|
|
|
|
Hi,
I don't think there is any support for mimicking Explorer; anyway, the number of files/folder shown by Explorer depends on several settings.
FWIW: starting .NET 4.0 there are new directory methods that enumerate files/folders one by one rather than building an array first.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks, Luc. Unfortunately the app is supposed to run under W2K, so I'm afraid I have to limit my expectations regarding .NET4.0
But I found a workaround (posted here for others):
Dim drv as DriveInfo
For Each di As DirectoryInfo In drv.RootDirectory.GetDirectories("*", SearchOption.TopDirectoryOnly)
If Not di.Attributes And FileAttributes.Hidden Then
...(code)
End If
Next As a result I have the right count and no recycle-bin (i.e. the other unwanted stuff). The only thing still bothering is that I have the Englisch folder names for "Users" (instead of "Benutzer") and "Program Files" (instead of "Programme"). If anyone has an idea how to solve that - maybe it has to do with the 'cultures' in VS, which I didn't explore yet - I'd appreciate. But since it's not really important (even most of the users know some English ) and only relevant for the root drive, I might just skip the issue as well
|
|
|
|
|
I want to plot a number of different cells from a sheet in to a bar chart. The cells may lie anywhere in the sheet (not necessarily in one row or column).
I have an array that stores the address of these cells.
This is what I am doing to plot the bar chart in VBA
Firstly, I make a string of the cell addresses (for eg DataSheet!$B$4, DataSheet!$B$3, DataSheet!$E$7, DataSheet!$G$11, DataSheet!$J$1)
Then pass this string to the chart for plotting
ActiveChart.SeriesCollection.Add Source:=Range(Str)
This works fine till the number of data points are less. But when the datapoints are large, the string grows bigger in size and the above plot function fails.
Is there nay other way I can accomplish this?
Thanks,
GJ
|
|
|
|
|
Hi,
I trust there are other ways, I am not familiar with them though.
Here is what you could do right away:
- drop the dollar signs
- drop the spaces
- rename the sheet to something that is much shorter.
DataSheet!$B$4, DataSheet!$B$3, DataSheet!$E$7, DataSheet!$G$11, DataSheet!$J$1
X!B4,X!B3,X!E7,X!G11,X!J1
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi GJ,
I'm not quite sure if I exactly understood what you're doing, but it seems to me as if you're doubling up unnecessarily and just make the string longer and longer. Maybe you wanna try adding your cells as single elements in a loop, like
For i = 1 to x '(= Number of Series)
ActiveChart.SeriesCollection.Add Source:=Range("DataSheet!$B$4")
ActiveChart.SeriesCollection.Add Source:=Range("DataSheet!$B$3")
....
Next
If you really add each cell manually, this is a big challenge anyway.
Hope it helps,
Mick
|
|
|
|
|
Thanks Mick for you reply. But wouldn't this create a lot of data series (one for each point)? I want all the points to be in one data series.
Thanks,
GJ
|
|
|
|
|
IC. You would then pass an array of strings to the values collection, e.g.
ActiveChart.SeriesCollection(index).Values = Array(Range("Sheet1!$A$29"), Range("Sheet1!$B$33"), Range("Sheet1!$C$35"), Range("Sheet1!$C$30")) But this you only need if your Ranges are spread over your sheet.
If you follow Daves advice and order them blockwise (in a hidden sheet), you can simply add the resulting (ordered) range like e.g.
ActiveChart.SeriesCollection.Add Source:=Range(Worksheets("Sheet1").Range("C5:T5"))
|
|
|
|