Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Export to pdf error Post Reply Post New Topic
Author Message
aspfun
Newbie
Newbie


Joined: 17 Jun 2010
Online Status: Offline
Posts: 27
Quote aspfun Replybullet Topic: Export to pdf error
     Posted: 15 Jul 2010 at 4:00am
My Crystal report use store procedure as data source. Code1 is works. Once I add code2 to export to pdf, an error occured.
How to fix it?      

//code1 works fine and displays report on screen.

        Dim crd As New ReportDocument
        crd.Load(Server.MapPath("myCrystalReport.rpt"))
        crd.SetDatabaseLogon("myID", "Password", "ServerName", "DBName")
        CrystalReportViewer1.ReportSource = crd

     //code2 do not work said that "Missing parameter values" at line bold font.

       Dim exp As New ExportOptions()
        exp.ExportFormatType = ExportFormatType.PortableDocFormat
        exp.FormatOptions = New PdfRtfWordFormatOptions()
        Dim req As New ExportRequestContext()
        req.ExportInfo = exp
        Dim st As System.IO.Stream
        st = crystalReportViewer1.FormatEngine.ExportToStream(req) //Missing parameter values
        Response.ClearHeaders()
        Response.ClearContent()
        Response.ContentType = "application/pdf"
        Dim b(st.Length - 1) As Byte
        st.Read(b, 0, CInt(Fix(st.Length)))
        Response.BinaryWrite(b)
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum