locked
set parameters in crystal report RRS feed

  • Question

  • Dear all,

    I have the crystal report file with sql database store procedure. It has one in paramter to store procedure and three general in parameter from vb.net form.

    How to pass these parameters to crystal report and open it?? What the coding should be??

    • Moved by Mike Feng Friday, May 27, 2011 5:20 AM Crystal report (From:Visual Basic General)
    Wednesday, May 25, 2011 9:53 AM

Answers

All replies

  • Dear all,

    I have the crystal report file with sql database store procedure. It has one in paramter to store procedure and three general in parameter from vb.net form.

    How to pass these parameters to crystal report and open it?? What the coding should be??


    Hello Raymond Chiu,

    follow this thread

    http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/aee2d970-470f-4cfe-9765-cbf50c28bf24

    http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/410ceb34-610d-4baa-a4fc-e1fe4729cf3d

    Hello


    Carmelo La Monica  http://community.visual-basic.it/carmelolamonica/
    Wednesday, May 25, 2011 11:38 AM
  • Dear all,

    I am using below code. But find it does not work??

     Dim rd As New ReportDocument
                rd.Load(Path + "\Reports\StockTakeException.rpt")
                rd.SetDataSource(ds)
                rd.SetParameterValue("Printed By", printedby)
                rd.SetParameterValue("frmLoc", fromLoc)
                rd.SetParameterValue("toLoc", toLoc)

                rd.Refresh()

                rd.PrintOptions.PrinterName = LaserPrinter
                rd.PrintToPrinter(1, False, 0, 0)               // throw exception here : Missing Parameters

    Thursday, May 26, 2011 2:49 AM
  • Dear all,

    I am using below code. But find it does not work??

     Dim rd As New ReportDocument
                rd.Load(Path + "\Reports\StockTakeException.rpt")
                rd.SetDataSource(ds)
                rd.SetParameterValue("Printed By", printedby)
                rd.SetParameterValue("frmLoc", fromLoc)
                rd.SetParameterValue("toLoc", toLoc)

                rd.Refresh()

                rd.PrintOptions.PrinterName = LaserPrinter
                rd.PrintToPrinter(1, False, 0, 0)               // throw exception here : Missing Parameters

     

    How many parameter in your crystal 4 or 3 ?

    I think u have create 3 parameter in crystal and 1 parameter from store procedure.

    Thursday, May 26, 2011 4:59 PM
  • I only have three parameters in crystal and no using store procedure.
    Friday, May 27, 2011 1:03 AM
  • Hi Raymond,

     

    Welcome to the MSDN Forum.

     

    According to your description, it seems that it is about Crystal Report.

    So I move it to this queue: Crystal Reports for Visual Studio

     

    I hope this will be helpful.

     

    Thank you for your understanding and support.

     

    Best regards,
    Mike Feng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 27, 2011 5:19 AM
  • Have a look at the code in the first reply links, it should work. If not then use a report with saved data and comment out the rd.refresh().

    It may be that some other API is missing a parameter and not a CR parameter.

    Don


    Don Williams
    Friday, May 27, 2011 3:05 PM