Problem in Exporting From Crystal Reports.
-
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
-
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
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 :)
-
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 :)
Thanks Harini, Its working Perfect.
A.Surenth