Visual Studio 2003 and Crystal Reports

Discussion in 'ASP .Net' started by David Lozzi, Jan 25, 2007.

  1. David Lozzi

    David Lozzi Guest

    Howdy,

    I have a web application that is using Crystal Reports which get converted
    to PDF for viewing. Works great on the production server. I have since
    installing the app reloaded my development machine and now they don't
    display on my machine. I don't get any errors, just a plain white screen.
    Its been about 2 years since I worked on this application and now they need
    updates and I forget how to view a crystal report as a PDF on my
    workstation. Please help!

    The script I'm using to convert to PDF is

    Dim crReport As New rptCustomerQuote

    Dim woid As Integer = Request("WOID")

    Dim ds As New DataSet

    Dim conn As New SqlConnection(ConnectionString)

    Dim adap As New SqlDataAdapter("cp_FrmCustomerQuote", conn)

    With adap

    ..SelectCommand.CommandType = CommandType.StoredProcedure

    ..SelectCommand.Parameters.Add(New SqlParameter("@WOID", woid))

    End With

    adap.Fill(ds, "cp_FrmCustomerQuote")

    crReport.SetDataSource(ds)



    'Change the output stream of the current form

    Dim strStream As New
    System.IO.BinaryReader(crReport.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat))

    Response.ClearContent()

    Response.ClearHeaders()

    Response.ContentType = "application/pdf"

    Response.BinaryWrite(strStream.ReadBytes(strStream.BaseStream.Length))

    Response.Flush()

    Response.Close()

    conn.Close()



    Thanks,

    David Lozzi
     
    David Lozzi, Jan 25, 2007
    #1
    1. Advertising

  2. David Lozzi

    sloan Guest

    http://scottonwriting.net/sowblog/posts/2148.aspx

    There is a tibbit there about streaming a Crystal Report To PDF.....




    "David Lozzi" <> wrote in message
    news:...
    > Howdy,
    >
    > I have a web application that is using Crystal Reports which get converted
    > to PDF for viewing. Works great on the production server. I have since
    > installing the app reloaded my development machine and now they don't
    > display on my machine. I don't get any errors, just a plain white screen.
    > Its been about 2 years since I worked on this application and now they

    need
    > updates and I forget how to view a crystal report as a PDF on my
    > workstation. Please help!
    >
    > The script I'm using to convert to PDF is
    >
    > Dim crReport As New rptCustomerQuote
    >
    > Dim woid As Integer = Request("WOID")
    >
    > Dim ds As New DataSet
    >
    > Dim conn As New SqlConnection(ConnectionString)
    >
    > Dim adap As New SqlDataAdapter("cp_FrmCustomerQuote", conn)
    >
    > With adap
    >
    > .SelectCommand.CommandType = CommandType.StoredProcedure
    >
    > .SelectCommand.Parameters.Add(New SqlParameter("@WOID", woid))
    >
    > End With
    >
    > adap.Fill(ds, "cp_FrmCustomerQuote")
    >
    > crReport.SetDataSource(ds)
    >
    >
    >
    > 'Change the output stream of the current form
    >
    > Dim strStream As New
    >

    System.IO.BinaryReader(crReport.ExportToStream(CrystalDecisions.[Shared].Exp
    ortFormatType.PortableDocFormat))
    >
    > Response.ClearContent()
    >
    > Response.ClearHeaders()
    >
    > Response.ContentType = "application/pdf"
    >
    > Response.BinaryWrite(strStream.ReadBytes(strStream.BaseStream.Length))
    >
    > Response.Flush()
    >
    > Response.Close()
    >
    > conn.Close()
    >
    >
    >
    > Thanks,
    >
    > David Lozzi
    >
    >
     
    sloan, Jan 25, 2007
    #2
    1. Advertising

  3. David Lozzi

    David Lozzi Guest

    Thanks for the link, however I have that part taken care of. Like I said, it
    works great on the server but it is not doing anything on my workstation.


    "sloan" <> wrote in message
    news:...
    >
    > http://scottonwriting.net/sowblog/posts/2148.aspx
    >
    > There is a tibbit there about streaming a Crystal Report To PDF.....
    >
    >
    >
    >
    > "David Lozzi" <> wrote in message
    > news:...
    >> Howdy,
    >>
    >> I have a web application that is using Crystal Reports which get
    >> converted
    >> to PDF for viewing. Works great on the production server. I have since
    >> installing the app reloaded my development machine and now they don't
    >> display on my machine. I don't get any errors, just a plain white screen.
    >> Its been about 2 years since I worked on this application and now they

    > need
    >> updates and I forget how to view a crystal report as a PDF on my
    >> workstation. Please help!
    >>
    >> The script I'm using to convert to PDF is
    >>
    >> Dim crReport As New rptCustomerQuote
    >>
    >> Dim woid As Integer = Request("WOID")
    >>
    >> Dim ds As New DataSet
    >>
    >> Dim conn As New SqlConnection(ConnectionString)
    >>
    >> Dim adap As New SqlDataAdapter("cp_FrmCustomerQuote", conn)
    >>
    >> With adap
    >>
    >> .SelectCommand.CommandType = CommandType.StoredProcedure
    >>
    >> .SelectCommand.Parameters.Add(New SqlParameter("@WOID", woid))
    >>
    >> End With
    >>
    >> adap.Fill(ds, "cp_FrmCustomerQuote")
    >>
    >> crReport.SetDataSource(ds)
    >>
    >>
    >>
    >> 'Change the output stream of the current form
    >>
    >> Dim strStream As New
    >>

    > System.IO.BinaryReader(crReport.ExportToStream(CrystalDecisions.[Shared].Exp
    > ortFormatType.PortableDocFormat))
    >>
    >> Response.ClearContent()
    >>
    >> Response.ClearHeaders()
    >>
    >> Response.ContentType = "application/pdf"
    >>
    >> Response.BinaryWrite(strStream.ReadBytes(strStream.BaseStream.Length))
    >>
    >> Response.Flush()
    >>
    >> Response.Close()
    >>
    >> conn.Close()
    >>
    >>
    >>
    >> Thanks,
    >>
    >> David Lozzi
    >>
    >>

    >
    >
     
    David Lozzi, Jan 26, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JJA
    Replies:
    0
    Views:
    582
  2. Peri
    Replies:
    1
    Views:
    3,019
    =?Utf-8?B?Um90aGFyaWdlcg==?=
    Jul 21, 2005
  3. Eric W. Holzapfel
    Replies:
    0
    Views:
    573
    Eric W. Holzapfel
    Jan 2, 2006
  4. xman
    Replies:
    0
    Views:
    526
  5. jason7069
    Replies:
    0
    Views:
    467
    jason7069
    Jun 19, 2008
Loading...

Share This Page