Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Export to excel - filename should be constant?

Hi to all,

I'm using Crystal Report11.5,Asp.net2.0-C#.

I'm using this code to export the records from crystal report to excel file

MemoryStream oStream; // using System.IO

oStream = (MemoryStream)



Response.Buffer = true;

Response.ContentType = "application/";



This is working fine but it create a file name like

CA416XHE.xls, CAS1C10R.xls i want to set this like

ExportExcel.xls, how to do this.?

Former Member


ExportToStream has a filename property where you can set the file name you require.


ExportToHTTPResponse has the same:


Both of these properties are Microsoft properties outside of the Crystal Reports SDK.

We do recommend using ExportToHTTPResponse for security reasons.



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question