Click here to Skip to main content
15,905,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used these code to get the crystal report in pdf. Now I need to display it to Excel. I have not used report viewer.Thanks in advance.
C#
ReportDocument rptDoc = new ReportDocument();
MemoryStream oStream = default(MemoryStream);
oStream=(MemoryStream)rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.BinaryWrite(oStream.ToArray());
HttpContext.Current.Response.End();
rptDoc.Close();
rptDoc.Dispose();
Posted
Updated 30-Sep-15 23:24pm
v2

 
Share this answer
 
Comments
Sumon562 1-Oct-15 6:02am    
no this link not working
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900