Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Crystal Report in PDF

Crystal Report in PDF

Scheduled Pinned Locked Moved ASP.NET
help
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jmshastri
    wrote on last edited by
    #1

    Hi all. I am having problem in Crystal Report in PDF format. I write the following code. If there is a problem with that please tell me. I have designed a Crystal report Code: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load CrystalReportViewer1.ReportSource = report CrystalReportViewer1.Visible = True End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim ostream As System.IO.MemoryStream ostream = New System.IO.MemoryStream report.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat) Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Response.BinaryWrite(ostream.ToArray()) Response.End() End Sub When I click on the button the screen goes blank. NO error, no output nothing. Please help me solve my problem.

    J 1 Reply Last reply
    0
    • J Jmshastri

      Hi all. I am having problem in Crystal Report in PDF format. I write the following code. If there is a problem with that please tell me. I have designed a Crystal report Code: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load CrystalReportViewer1.ReportSource = report CrystalReportViewer1.Visible = True End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim ostream As System.IO.MemoryStream ostream = New System.IO.MemoryStream report.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat) Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Response.BinaryWrite(ostream.ToArray()) Response.End() End Sub When I click on the button the screen goes blank. NO error, no output nothing. Please help me solve my problem.

      J Offline
      J Offline
      jitendra gupta
      wrote on last edited by
      #2

      hi i am sending u some code please replace your button code from my code code is : Dim ms As MemoryStream ms = CType(report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat), System.IO.MemoryStream) Response.ClearHeaders Response.Clear Response.Buffer = True Response.ContentType = "application/pdf" Try Response.BinaryWrite(ms.ToArray) Dim filename As String = "c:\inetpub\wwwroot\jitu.pdf" report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, filename) Response.End Catch err As Exception Response.Write("< BR >") Response.Write(err.Message.ToString) End Try bye

      J 1 Reply Last reply
      0
      • J jitendra gupta

        hi i am sending u some code please replace your button code from my code code is : Dim ms As MemoryStream ms = CType(report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat), System.IO.MemoryStream) Response.ClearHeaders Response.Clear Response.Buffer = True Response.ContentType = "application/pdf" Try Response.BinaryWrite(ms.ToArray) Dim filename As String = "c:\inetpub\wwwroot\jitu.pdf" report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, filename) Response.End Catch err As Exception Response.Write("< BR >") Response.Write(err.Message.ToString) End Try bye

        J Offline
        J Offline
        Jmshastri
        wrote on last edited by
        #3

        Thank you Jintendra. The code is working fine. thanks a lot again..

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups