Click here to Skip to main content
15,914,111 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: trouble in passing parameter in crystal document Pin
tosch23-Nov-09 3:01
tosch23-Nov-09 3:01 
GeneralRe: trouble in passing parameter in crystal document Pin
aguest23-Nov-09 4:24
aguest23-Nov-09 4:24 
GeneralRe: trouble in passing parameter in crystal document Pin
tosch23-Nov-09 4:35
tosch23-Nov-09 4:35 
GeneralRe: trouble in passing parameter in crystal document Pin
aguest23-Nov-09 5:42
aguest23-Nov-09 5:42 
GeneralRe: trouble in passing parameter in crystal document Pin
tosch23-Nov-09 19:31
tosch23-Nov-09 19:31 
GeneralRe: trouble in passing parameter in crystal document Pin
aguest23-Nov-09 21:53
aguest23-Nov-09 21:53 
GeneralRe: trouble in passing parameter in crystal document Pin
aguest24-Nov-09 21:47
aguest24-Nov-09 21:47 
Questiontrouble in passing parameter in crystal document Pin
aguest20-Nov-09 12:04
aguest20-Nov-09 12:04 
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
AnswerRe: trouble in passing parameter in crystal document Pin
Tom Deketelaere22-Nov-09 23:50
professionalTom Deketelaere22-Nov-09 23:50 
QuestionUsing the IDispatch::Invoke interface to return data in ActiveX Control Pin
caeanis20-Nov-09 7:14
caeanis20-Nov-09 7:14 
QuestionWeird behavior in MDI application Pin
EliottA20-Nov-09 4:39
EliottA20-Nov-09 4:39 
AnswerRe: Weird behavior in MDI application Pin
Paramu197321-Nov-09 3:12
Paramu197321-Nov-09 3:12 
QuestionGet system shutdown info. Pin
Gagan.2020-Nov-09 1:07
Gagan.2020-Nov-09 1:07 
AnswerRe: Get system shutdown info. Pin
Alan N20-Nov-09 1:54
Alan N20-Nov-09 1:54 
GeneralRe: Get system shutdown info. Pin
Gagan.2020-Nov-09 22:07
Gagan.2020-Nov-09 22:07 
QuestionGet files info in a network directory Pin
Gagan.2020-Nov-09 1:02
Gagan.2020-Nov-09 1:02 
AnswerRe: Get files info in a network directory Pin
EliottA20-Nov-09 2:12
EliottA20-Nov-09 2:12 
GeneralRe: Get files info in a network directory Pin
Gagan.2020-Nov-09 22:06
Gagan.2020-Nov-09 22:06 
Questionhow to connect to a remote system using ssh client Pin
himanshu110120-Nov-09 0:38
himanshu110120-Nov-09 0:38 
RantRe: how to connect to a remote system using ssh client Pin
freakyit20-Nov-09 0:45
freakyit20-Nov-09 0:45 
QuestionHow to monitor the sites open on particular pc Pin
Sumit Prakash Sharma18-Nov-09 18:44
professionalSumit Prakash Sharma18-Nov-09 18:44 
AnswerRe: How to monitor the sites open on particular pc Pin
Mycroft Holmes18-Nov-09 21:35
professionalMycroft Holmes18-Nov-09 21:35 
GeneralRe: How to monitor the sites open on particular pc Pin
Johan Hakkesteegt18-Nov-09 22:13
Johan Hakkesteegt18-Nov-09 22:13 
GeneralRe: How to monitor the sites open on particular pc Pin
Mycroft Holmes18-Nov-09 22:30
professionalMycroft Holmes18-Nov-09 22:30 
GeneralRe: How to monitor the sites open on particular pc Pin
Sumit Prakash Sharma19-Nov-09 1:07
professionalSumit Prakash Sharma19-Nov-09 1:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.