|
Hi,
I have some data that looks like this:
July Aug Sep Oct Nov Dec
Birmingham 51,278 51,243 45,745 56,785 63,007 91,204
Milton K's 53,030 33,551 151,564 95,891 92,615 94,174
Slough 130,976 165,927 125,353 249,622 71,739 79,665
Channel l80,621 102,442 95,788 100,371 120,712 71,104
and I want to have a graph with a line for each of the 4 locations, and the months placed along the horizontal 'X' axis, and the value placed along the 'Y' axis. If I create the chart in Excel, I get the option to change a radio button from 'Series in Columns' to 'Series in Rows' to show the graph correctly. However, in Crystal Reports (the dot net bundled version) I don't get this option, and the result is that I get 6 lines (one for each month) with one 'X' axis labels specified as the four locations.
This has to be created in crystal reports, but I've tried every option I can find, but can't get the desired output.
Can anyone help please?
Many thanks,
Martin
|
|
|
|
|
To All,
I have a table; have HardwarePrice (Money - datatype). - SQL Server.
I'm doing in ASP.NET, linking to a database; a button where I use to add new item.
Below is error which I have encounted.
------------------------------------------------------------------------------
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: System.FormatException: Input string was not in a correct format. at System.Number.ParseDecimal(String s, NumberStyles style, NumberFormatInfo info) at System.Decimal.Parse(String s, NumberStyles style, IFormatProvider provider) at System.Convert.ToDecimal(String value, IFormatProvider provider) at System.String.System.IConvertible.ToDecimal(IFormatProvider provider) at System.Convert.ToDecimal(Object value) at System.Data.Common.DecimalStorage.Set(Int32 record, Object value) at System.Data.DataColumn.set_Item(Int32 record, Object value)Couldn't store <> in HardwarePrice Column. Expected type is Decimal.
Source Error:
Line 194: ' add a new blank row to the end of the data
Line 195: Dim rowValues As Object() = {"", "", ""}
Line 196: ds.Tables(0).Rows.Add(rowValues)
Line 197:
Line 198: ' figure out the EditItemIndex, last record on last page
-----------------------------------------------------------------------------
What can I do to stop this error?
Thank you.
|
|
|
|
|
Easy. Your trying to convert empty Strings cast as Objects to numbers like Integer, Decimal, whatever your using. This will not result is zeros. You'r better off setting each value individually with the correct default data, like 0.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can anyone tell me if it's possible to enbale visual styles in VS IDE addins. I tried EnableVisualStyles before my form loads and a manifest file to no avail. I am assuming that since the addin in running in the VS IDE application space, then this is not possible, but if it's possible, how so.
Thanks for any replies in advance.
Thanks...Greg
|
|
|
|
|
As far as I can tell, VisualStyles won't work inside the IDE.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Visual Studio 2002 and Visual Studio 2003 are not .Net applications and therefore do no support visual styles.
Visual Studio 2005 (Whidbey) appears to be a .Net application with full visual style support, at least in the beta vesion I've seen.
|
|
|
|
|
Is it possible to use VB.NET to download a file form dragging a hyperlink into a textbox? The problem I am having is finding a way to get the underlying URL to the file location. E.g. if I have to click on a link that says "Click here" to download a file, I want to be able to drag it into a textbox in my application and then have it download that file.
Any advice, tips, sample code or pointers to a good resource will be GREATLY appreciated.
Thanks
Vyyk
|
|
|
|
|
There are samples of this all over. Especially on MSDN, like this[^] example.
Here's a condensed version. This accepts any text object, including URL links dragged from IE, dropped on a Textbox on your form.
Private Sub TextBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles TextBox1.DragDrop
Try
If e.Data.GetDataPresent(DataFormats.Text, True) Then
e.Effect = DragDropEffects.Link
TextBox1.Text = e.Data.GetData(DataFormats.Text, True)
Else
e.Effect = DragDropEffects.None
End If
Catch ex As Exception
e.Effect = DragDropEffects.None
Debug.WriteLine(ex.ToString)
End Try
End Sub
Private Sub TextBox1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles TextBox1.DragEnter
Try
If e.Data.GetDataPresent(DataFormats.Text, True) Then
e.Effect = DragDropEffects.Link
Else
e.Effect = DragDropEffects.None
End If
Catch ex As Exception
Debug.WriteLine(ex.ToString)
End Try
End Sub
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
My everlasting thanks - of all the samples out there, this was the best and most concise...thanks again I REALLY appreciate this.
Best regards
Vyyk
|
|
|
|
|
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm confused....when I create a picturebox and have multiple pics to display in it, I create an imagelist, correct? and from that imagelist, how do I make the images displayed conditional to the output?
pseudocode:
if TechnicianNumber is 89
then display image1
else if TechnicianNumber is 88
then display image2....
and so on.
Is this possible?
|
|
|
|
|
You don't have to use an Imagelist. You could also just keep a list of filenames in an array or just create your own collection of Bitmap objects. Any colleciton of images will, of course, be much more resource intensive that keeping an array of filenames.
To show the image, you could just set the Image property of the Picturebox to the Bitmap object or you could just give the PictureBox the filename you have stored. It really depends on how many images you have.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello Everybody
Requirement of application is, when we click a button, new form should be display near it. I got X-Y coordinated using GetCursorPos function/procedure
But I want to convert into control/forms co-ordinates. I donot know conversion method. Please help me.
Your suggestions are valueable for me & highly regreated
Thank You
|
|
|
|
|
Use Control Class MousePosition Property and PointToScreen and PointToClient methods.
|
|
|
|
|
I hope someone can help me with this!
I am trying to set some environment variables from my VB.NET application.
I am using System.Environment.GetEnvironmentVariable to return the values and to set them I am using the following function....
Private Declare Function SetEnvironmentVariableA Lib "kernel32.dll" _
(ByVal lpName As String, _
ByVal lpValue As String) As Integer
When I set a variable and then check that it has been set from within the application it appears fine. However, if I open a command prompt window and use SET I cannot see the variable at all. This seems to indicate to me that each .NET applicaiton runs in its own "shell".
The problem I have is that I am kicking of a sub-process that runs in a JVM and this needs various environment variables to be set.
So how can I set variables from VB.NET into the master Windows environment so these can be picked up on by the sub-process?
|
|
|
|
|
You're right, every app that runs launches with its own copy of the environment variables. This happens even to apps that your app spawns, they get a copy of your app's environment.
The solution is a little surprising. See this[^] article on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Well for some reason my sub-process is not inheriting the variables set ni my .NEt applicaiton.
I finally found the MSDN article Dave pointed to before I came back here and read his reply! I found MSDN very unhelpful in terms of explaining how to implement this in VB.NET particulrly because of the LPARAM argument to the SendMessageTimeout function
OK so this is how you propagate environment variables to the system with VB.NET
First of all you need the following Win32 API function declarations...
Private Declare Function SendMessageTimeoutA Lib "user32" _<br />
(ByVal hwnd As Integer, _<br />
ByVal MSG As Integer, _<br />
ByVal wParam As Integer, _<br />
ByVal lParam As Byte(), _<br />
ByVal fuFlags As Integer, _<br />
ByVal uTimeout As Integer, _<br />
ByRef lpdwResult As Integer) As Integer<br />
<br />
Private Declare Function SetEnvironmentVariableA Lib "kernel32.dll" _<br />
(ByVal lpName As String, _<br />
ByVal lpValue As String) As Integer
To set a variable I then defined my function as follows...
<br />
Sub SetEnvironmentVariable(ByVal strVariableName As String, ByVal strValue As String)<br />
<br />
Const WM_SETTINGCHANGE = &H1A<br />
Const HWND_BROADCAST = &HFFFF<br />
Const SMTO_NORMAL = 2<br />
Const SMTO_ABORTIFHUNG = &H2<br />
<br />
Dim regKey As RegistryKey<br />
Dim lpdwResult, result As Integer<br />
<br />
' declare the system environment variable for the current user by inserting it <br />
' into the registry<br />
regKey = Registry.CurrentUser.OpenSubKey("Environment", True)<br />
regKey.SetValue(strVariableName, strValue)<br />
<br />
' now propagate the system with the variable...<br />
result = SendMessageTimeoutA(HWND_BROADCAST, _<br />
WM_SETTINGCHANGE, _<br />
0, <br />
Encoding.GetEncoding(1252).GetBytes("Environment"), _<br />
SMTO_ABORTIFHUNG, _<br />
5000, _<br />
lpdwResult)<br />
<br />
' even though the variable is now available to the windows system<br />
' it is not seen in the current "shell" by the application<br />
' to ensure it is seen we need to set it agauin but his time using<br />
' Win32 API SetEnvironmentVariableA function of kernel32.dll<br />
result = SetEnvironmentVariableA(strVariableName, strValue)<br />
<br />
End Sub<br />
....to delete an environment variable, is then pretty simple. Use code as above but replace regKey.SetValue with...
regKey.DeleteValue(strVariableName, False)
and remove strValue from the subroutine declaration and relpace it in the code with an empty string ""
Note that the LPARAM argument is passed to SetMessageTimeout as an array of bytes that represent the string "Environment" and that in my example I am using code page 1252 (ANSI Latin I) - you may wish to change this code page to suit your system. I'm not sure whether this would work if your system uses a multi-byte or double-byte character set....
hope that helps other people!
cheers
mf
|
|
|
|
|
Welcome to the world of P/Invoking the Win32 API. You'll run into lots of it because Windows is not a .NET native environment. That being said, you'll find that you'll have to translate MANY examples of code, be it on MSDN or on the web in general, into VB.NET code on your own. Congratulations on your first attempt!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How do I inherit DataGridColumnStyle?
|
|
|
|
|
|
Thanks! Just what I needed. A concrete example.
|
|
|
|
|
I am binding a picture box. I have format the picture box to ensure it's not bind to an empty path or invalid path or invalid file. But problem raise, after formating the binding picture, the form doesn't load correctly. After &qt form1.Show() &qt executed, it doesn't call form1_load. But if i am not formating the binding picture, it will execute the f0rm1_load after it execute the &qt form1.Show() &qt. Is there any other code I need to put to the form1? Or what actually the problem?
Thanks. Please help me!!!
Learning .NET
|
|
|
|
|
Hello all. I'm working on a school project and it would be mad cool if I could get my VB forms to run in a browser and query a MySQL database thats on a web server. Do I embed the code as I would Perl or PHP into the HTML code or do I embed the executable file into the HTML coding? Any and all assistance would be appreciated.
Dare
|
|
|
|
|
Mad Cool???
You can't embed the form in an HTML page. You'd have to rewrite your app as an ASP.NET application. The only thing you could do with the .EXE you have now is to include a link in your web page. Clicking that link would download the .EXE just like any other file. You'll get the Save dialog box, ...
The user's machine would have to have the same version of the .NET Framework installed in order for that .EXE to download and work.
If you rewrite your app as an ASP.NET application, the user will only need a web browser to get to your new ASP.NET version.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
damn. thats not very mad cool (hey man, it was 2 in the morning!)
I will take your advice and try to code it in ASP. I only have a couple of days to do, but I think it'll be worth the shot. Thanks
|
|
|
|
|