VB Crystal Report >> code example of passing (2) parameters and running crystal report

by a bobby » Sat, 21 May 2005 04:26:15 GMT

Hi Iwould like code examples for passing parameters and running a crystal
report from a windows form in vb.net.
I am using crystal 9.0 and ms sql server db.

thank
you




Similar Threads

1. Passing parameters to Crystal reports VS 2005 - VB - Net 2.0 - VB.Net

2. How to pass parameter from vb.net to Crystal Report

Dear all,
   How to pass parameter from vb.net to Crystal Report? I'm now using 
ReportDocument and CrystalReportViewer. However, I don't know how to pass a 
parameter to the report and print the parameter in the report. Please help.
Thanks a lot,
Ray 


3. passing parameter from VB.NEt to crystal report - VB.Net

4. Crystal Reports issue Passing Parameter

I don't believe you add the paramters to the Viewer, you add it to the
report document within the viewer...


"mikl" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
> I've tried using a parameter in a report to look up a value and print the
report (value in db = long).   When I allow the parameter prompt to come up
in the report it works fine, but when I pass the value to the parameter in
runtime (see code below), it doesn't pull the record up?
>
> For example, when I let the prompt appear (i.e. comment out the below
code), I type in the prompt  60529, then the record with that ID is
displayed.  However, when I pass it runtime as in code below, I debug all
the way up to the point where the report shows, and the value is "60529D
{Decimal}", but the report is blank.
>
> Anyone with crystal report expertise please review the code below and tell
me where I'm going wrong.   Note that I'm doing this in the New sub of the
form that the report is shown in.
>
>
>
>
> Public Sub New(ByVal id As Long)
>         MyBase.New()
>         fWAIVER_KEY = id
>         'This call is required by the Windows Form Designer.
>         InitializeComponent()
>
>         'Add any initialization after the InitializeComponent() call
>
>         Dim paramFields As New CrystalDecisions.Shared.ParameterFields
>         Dim paramField As New CrystalDecisions.Shared.ParameterField
>         Dim discreteVal As New
CrystalDecisions.Shared.ParameterDiscreteValue
>
>         paramField.ParameterFieldName = "PetitionID"
>         discreteVal.Value = fWAIVER_KEY
>         paramField.CurrentValues.Add(discreteVal)
>         paramFields.Add(paramField)
>         CrystalReportViewer1.ParameterFieldInfo = paramFields
>
>
> Thanks,
>
> Mikl


5. How to pass a parameter from vb.net to Crystal Report - VB.Net

6. how to pass parameters to crystal reports from vb.net

7. to pass parameters to the Stored Procedure of the report in Crystal - VB Crystal Report

8. Crystal Reports passing parameter

started playing with VB .net 2003 and downloaded some sample code for
passing parameters...  When trying to run it I'm getting an error in
the line of code with the "IsRange" in it and am unsure as to why...

For Each myParameterValue In defaultParameterValues
     If (Not myParameterValue.IsRange) Then
         Dim myParameterDiscreteValue As
               ParameterDiscreteValue = CType(myParameterValue,
                ParameterDiscreteValue)
         myArrayList.Add(myParameterDiscreteValue.Value.ToString())
            End If
        Next


Any assistance would be appreciated...

C. Bensinger