|
Hi Johan,
that's not really helpfull, cause it's an old VB6 code.
Thanks for help
|
|
|
|
|
|
Hi Johan,
that's only for reading.
By using Google I found this one:
ADS
I think this is the solution I need.
Thank you very mouch for help
best regards
Maik
|
|
|
|
|
i am getting some trouble with a tutorial that i found on msdn web site : http://msdn.microsoft.com/en-us/library/ms227722.aspx.
i would like to pass a parameter to my CrystalReport document,but i would like to send an integer value to my CR document and just one value(because in the tut its sending and array of string values).
the code is the fellowing
Private Const PARAMETER_FIELD_NAME As String = "numb"
Private impbonrecepReport As ReportDocument
Private Sub ConfigureCrystalReports()
Dim myArrayList As ArrayList = New ArrayList()
myArrayList.Add(999)
Dim numbrecep As Integer
numbrecep = 999
SetCurrentValuesForParameterField(impbonrecepReport, myArrayList)
impbonrecepReport = New ReportDocument()
Dim reportPath As String = Application.StartupPath & "\" & "ImpBonReception.rpt"
impbonrecepReport.Load(reportPath)
CrystalReportViewer1.ReportSource = impbonrecepReport
End Sub
Private Sub SetCurrentValuesForParameterField(ByVal myReportDocument As ReportDocument, ByVal myArrayList As ArrayList)
Dim currentParameterValues As ParameterValues = New ParameterValues()
For Each submittedValue As Object In myArrayList
<big>Dim myParameterDiscreteValue As ParameterDiscreteValue = New ParameterDiscreteValue()</big>
myParameterDiscreteValue.Value = myArrayList.ToString()
currentParameterValues.Add(myParameterDiscreteValue)
Next
Dim myParameterFieldDefinitions As ParameterFieldDefinitions = myReportDocument.DataDefinition.ParameterFields
Dim myParameterFieldDefinition As ParameterFieldDefinition = myParameterFieldDefinitions(PARAMETER_FIELD_NAME)
myParameterFieldDefinition.ApplyCurrentValues(currentParameterValues)
End Sub
i got this error message
An unhandled exception of type 'System.NullReferenceException' occurred in GestionStock.exe
Additional information: La référence d'objet n'est pas définie à une instance d'un objet.
in this line
Dim myParameterFieldDefinitions As ParameterFieldDefinitions = myReportDocument.DataDefinition.ParameterFields<br />
can you help me to solve this problem? thank you
ps: i am on VS2005 VB.NET
|
|
|
|
|
Move the call to SetCurrentValuesForParameterField to the line after loading the report. This should fix your problem.
Tosch
|
|
|
|
|
now i getting a message error in the next line
Dim myParameterFieldDefinition As ParameterFieldDefinition = myParameterFieldDefinitions(PARAMETER_FIELD_NAME)
this is the error message
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CrystalDecisions.CrystalReports.Engine.dll<br />
<br />
Additional information: Index non valide. (Exception de HRESULT : 0x8002000B (DISP_E_BADINDEX))
|
|
|
|
|
You're trying to get an item with the name PARAMETER_FIELD_NAME from your myParameterFieldDefinitions. Does it exist in the collection? Probably not, as the error says 'Index not valid'
Tosch
|
|
|
|
|
i fellowed the first part of this tutorial to set myParameterFieldDefinitions : LINK TO THE TUT
and i have in my table(the table linked o the crystalReport Document) field called numb that i assigned it to PARAMETER_FIELD_NAME .
and still dont know where is the error ???
|
|
|
|
|
Please loop through myParameterFieldDefinitions and check if any member is called numb (your fieldname). I'm not sure what the propertyname is, probably name or fieldname.
Tosch
|
|
|
|
|
I coudnt find any thing cause the error hapend in this line
Dim myParameterFieldDefinition As ParameterFieldDefinition = myParameterFieldDefinitions(PARAMETER_FIELD_NAME)
i looked for numb or name and fieldname but nothing ????
|
|
|
|
|
Please check the property ParameterFieldName .
You may have to loop through all items in ParameterFieldDefinitions and check the value of ParameterFieldName. What are the values for this field?
Tosch
|
|
|
|
|
sorry to bother you with an other problem,but now that i moved at home and i working on my pc (OS:windows 7)i got an error message with the same code :
<br />
An unhandled exception of type 'System.Exception' occurred in CrystalDecisions.CrystalReports.Engine.dll<br />
<br />
Additional information: Load report failed.<br />
on this line
impbonrecepReport.Load(reportPath)
|
|
|
|
|
Does the report that you pass to the load function exist?
Tosch
|
|
|
|
|
i just found a property called ParamName and it's equal=Nothing.
the other probelm happend with me when i work on windows 7 but when i worked with winXp i dont get this message error.
|
|
|
|
|
is that not normal that can be empty(ParamName=Nothing)?
please can you give me a hand
|
|
|
|
|
i am getting some trouble with a tutorial that i found on msdn web site : http://msdn.microsoft.com/en-us/library/ms227722.aspx.
i would like to pass a parameter to my CrystalReport document,but i would like to send an integer value to my CR document and just one value(because in the tut its sending and array of string values).
the code is the fellowing
Private Const PARAMETER_FIELD_NAME As String = "numb"
Private impbonrecepReport As ReportDocument
Private Sub ConfigureCrystalReports()
Dim myArrayList As ArrayList = New ArrayList()
myArrayList.Add(999)
Dim numbrecep As Integer
numbrecep = 999
SetCurrentValuesForParameterField(impbonrecepReport, myArrayList)
impbonrecepReport = New ReportDocument()
Dim reportPath As String = Application.StartupPath & "\" & "ImpBonReception.rpt"
impbonrecepReport.Load(reportPath)
CrystalReportViewer1.ReportSource = impbonrecepReport
End Sub
Private Sub SetCurrentValuesForParameterField(ByVal myReportDocument As ReportDocument, ByVal myArrayList As ArrayList)
Dim currentParameterValues As ParameterValues = New ParameterValues()
For Each submittedValue As Object In myArrayList
<big>Dim myParameterDiscreteValue As ParameterDiscreteValue = New ParameterDiscreteValue()</big>
myParameterDiscreteValue.Value = myArrayList.ToString()
currentParameterValues.Add(myParameterDiscreteValue)
Next
Dim myParameterFieldDefinitions As ParameterFieldDefinitions = myReportDocument.DataDefinition.ParameterFields
Dim myParameterFieldDefinition As ParameterFieldDefinition = myParameterFieldDefinitions(PARAMETER_FIELD_NAME)
myParameterFieldDefinition.ApplyCurrentValues(currentParameterValues)
End Sub
i got this error message
An unhandled exception of type 'System.NullReferenceException' occurred in GestionStock.exe
Additional information: La référence d'objet n'est pas définie à une instance d'un objet.
in this line
Dim myParameterFieldDefinitions As ParameterFieldDefinitions = myReportDocument.DataDefinition.ParameterFields<br />
can you help me to solve this problem? thank you
|
|
|
|
|
The error is telling you that the object isn't initialized. And it is right.
Change your code to the following:
impbonrecepReport = New ReportDocument()
Dim reportPath As String = Application.StartupPath & "\" & "ImpBonReception.rpt"
impbonrecepReport.Load(reportPath)
SetCurrentValuesForParameterField(impbonrecepReport, myArrayList)
CrystalReportViewer1.ReportSource = impbonrecepReport
Initialize and load your report first, then set the parameter value's and then show it.
You'll also have to change
ByVal myReportDocument As ReportDocument
to
ByRef myReportDocument As ReportDocument
Or make the sub into a function and return the report at the end.
Basicly you passed an empty object to the 'SetCurrentValuesForParameterField'.
|
|
|
|
|
Can I use the IDispatch::Invoke interface of an ActiveX control to retrieve specific data? The control in question is a Siebel List control and I want retrieve the value of a given cell in a specific column or set of columns. Is this possible?
Thank you in advance,
Caeanis
|
|
|
|
|
I have an MDI application. In it, I have a panel docked to the top as a 'header' and a flowlayoutpanel docked to the right for a menu. This leaves everything else to be the MDI container for children forms. Everything works well here, and while polishing off the application I decided to set a background image for the MDI container.
Great, looks great.
There is a button which will shrink the menu to expand the MDI container area, but for some reason, despite my background image being set to stretch, it is never repainted and I get a very awkward background. This applies for when you stretch the MDI container by using the horizontal and vertical scroll bars.
Anyone know how I can force the background to be repainted when my application is resized or controls are hidden / expanded to 'grow' the MDI container?
If requested, images will follow to demonstrate behavior.
|
|
|
|
|
From Your MDI-Form LOAD()
Dim Img As Image = Image.FromFile("C:\Eliotta\For_icons\Saudi_Sea.jpg")
Me.Controls(Me.Controls.Count - 1).BackColor = Color.LavenderBlush
Me.Controls(Me.Controls.Count - 1).BackgroundImageLayout = ImageLayout.Stretch
Me.Controls(Me.Controls.Count - 1).BackgroundImage = ResizeImage(Img, Me.Width, Me.Height)
end sub
Private Function ResizeImage(ByVal Img As Image, ByVal Width As Integer, ByVal Height As Integer) As Image
Return New Bitmap(Img, Width, Height)
End Function
|
|
|
|
|
Hi all.
How to check whether system is going to log-off or shutting down in vb.net
suggest me.
Thanks.
Gagan
|
|
|
|
|
Hi,
The Microsoft.Win32 namespace has a SystemEvents class containing a SessionEnding event. The associated SessionEndingEventArgs has a Reason property which can have a value of Logoff or SystemShutdown. I think that's what you need.
Alan.
|
|
|
|
|
Thanks for your reply.
I think that would work.
|
|
|
|
|
Hi all.
I want to get all files information stored in a network directory.
Suppose I have a website www.abc.com and it has a directory say www.abc.com/temp/
Now I want to get all the files stored in that temp directory.
Suggest me how can I do this?
Thanks.
Gagan
|
|
|
|
|
Log in through FTP and get the directories or files available, if it is a webserver and you're trying to get the contents of that directory, typically if there is no index file it will show you a list of files and directories available. If there is an index file, as far as I know you're out of luck.
|
|
|
|