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
  1. Home
  2. General Programming
  3. C#
  4. Problem in Exporting From Crystal Reports.

Problem in Exporting From Crystal Reports.

Scheduled Pinned Locked Moved C#
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.
  • A Offline
    A Offline
    Anthony Surendran
    wrote on last edited by
    #1

    I am getting an Error while Exporting from crystal report to PDF. cannot convert type 'CrystalDecisions.Shared.ExportFormatType' to 'System.IO.MemoryStream' Can any one help me pls. thanks in advance.:-O

    A.Surenth

    H 1 Reply Last reply
    0
    • A Anthony Surendran

      I am getting an Error while Exporting from crystal report to PDF. cannot convert type 'CrystalDecisions.Shared.ExportFormatType' to 'System.IO.MemoryStream' Can any one help me pls. thanks in advance.:-O

      A.Surenth

      H Offline
      H Offline
      Harini N K
      wrote on last edited by
      #2

      Hi I think you need to type cast to Memory Stream from ReportDocument. See the sample code below for exporting from Crystal Report to PDF.

      MemoryStream oStream; // using System.IO
      rptDocument.SetDatabaseLogon(StrUID, StrPwd, StrServer, StrDatabase);
      oStream = (MemoryStream)rptDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

      Response.Clear();
      Response.Buffer = true;
      Response.ContentType = "application/pdf";
      Response.BinaryWrite(oStream.ToArray());
      Response.End();

      I used Crystal Report 10 in VS2005.

      Rate this message. Thank you. Harini :)

      A 1 Reply Last reply
      0
      • H Harini N K

        Hi I think you need to type cast to Memory Stream from ReportDocument. See the sample code below for exporting from Crystal Report to PDF.

        MemoryStream oStream; // using System.IO
        rptDocument.SetDatabaseLogon(StrUID, StrPwd, StrServer, StrDatabase);
        oStream = (MemoryStream)rptDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

        Response.Clear();
        Response.Buffer = true;
        Response.ContentType = "application/pdf";
        Response.BinaryWrite(oStream.ToArray());
        Response.End();

        I used Crystal Report 10 in VS2005.

        Rate this message. Thank you. Harini :)

        A Offline
        A Offline
        Anthony Surendran
        wrote on last edited by
        #3

        Thanks Harini, Its working Perfect.

        A.Surenth

        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