Results 1 to 4 of 4

Thread: passing parameter issue in crystalreport

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    2

    passing parameter issue in crystalreport

    Hi 2 All,

    i am export crystal report to pdf and it is working fine but it give me error whenever i pass the parameter at runtime.

    Error:

    Code:
     Missing parameter values.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    
    Exception Details: System.Runtime.InteropServices.COMException: Missing parameter values.
    
    Source Error:
    
    Line 29:         'CrystalReportViewer1.ParameterFieldInfo = pram2
    Line 30: 
    Line 31:         report.ExportToStream(ExportFormatType.PortableDocFormat)
    Line 32: 
    Line 33:         Dim m As System.IO.MemoryStream
    and code i am using is:

    Code:
    Dim pram1 As New ParameterField
            Dim pram2 As New ParameterFields
            Dim pramval As New ParameterDiscreteValue
            Dim report As New ReportDocument
    
            pram1.ParameterFieldName = "ProjectID"
            pramval.Value = 44 'Request.QueryString("rpid")
            pram1.CurrentValues.Add(pramval)
            pram2.Add(pram1)          report.Load(Server.MapPath("ProjectTasks.rpt"))
            report.SetDatabaseLogon("aqeel", "aqeel")
            CrystalReportViewer1.ParameterFieldInfo.Add(pram1)
            report.ExportToStream(ExportFormatType.PortableDocFormat)
    
            Dim m As System.IO.MemoryStream
            m = report.ExportToStream(ExportFormatType.PortableDocFormat)
            report.Close()
            Response.ClearContent()
            Response.ClearHeaders()
            Response.ContentType = "Application/pdf"
            Response.Buffer = True
            Response.BinaryWrite(m.ToArray())
            Response.End()
    please help me in this issue

  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: passing parameter issue in crystalreport

    take a look at this thread that was resolved previously:

    http://www.vbforums.com/showthread.php?t=524736

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    2

    Re: passing parameter issue in crystalreport

    but this example is about to passing parameter to sub reports but in my case i m not using any subreport....

  4. #4
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: passing parameter issue in crystalreport

    post #7 of that link shows how to pass a parameter to a report.

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