Results 1 to 2 of 2

Thread: .NET, Parameter & Crystal Report

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93

    .NET, Parameter & Crystal Report

    Can someone help me with this problem? I have a .NET application that needs to print a report out to a printer(in this case a barcode printer). I have the report printing just fine to the printer except I've realized that I need to pass a parameter to the Select statement to print the correct label. I am NOT using a CrystalReportsViewer.
    This is what I have so far:

    Dim frmReport As New BarCode1()
    frmReport.PrintOptions.PrinterName = "\\IT1200"
    frmReport.PrintToPrinter(1, False, 0, 0)

    My question is: how do I pass the parameter? In the Crystal report (BarCode1) I have set up a parameter field (?ID), in the select expert I set the field in the table = to the parameter (?ID). When I select "Show SQL Query" under Database on the menu this is the query:
    SELECT "CusCushionInv"."BaseModel", "CusCushionInv"."SerialNum", "CusCushionInv"."ID"
    FROM "STKPRODDB"."dbo"."CusCushionInv" "CusCushionInv"
    WHERE "CusCushionInv"."ID"=222375

    Should 222375 be ?ID If so how do I change it at this point?

    Thanks,
    Corinne

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    dim d1 as new Parameter1.discreteValue

    dim p1 as new parameterValues

    d1.value = YourparameterValue

    p1.add(d1)

    YourReportDocument.Datadefinition.Parameterfields("YourParameterName").ApplyCurrentValues(p1)

    that will set the parameter value then in your report selection criteria you can use the value passed to form part of the selection criteria
    Last edited by RichardAtherton; Oct 13th, 2003 at 04:12 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width