on 10-15-2008 1:01 PM
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)
boReportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-excel";
Response.BinaryWrite(oStream.ToArray());
HttpContext.Current.ApplicationInstance.CompleteRequest();
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.?
Hello,
ExportToStream has a filename property where you can set the file name you require.
[Click|http://msdn.microsoft.com/en-us/library/ms227570.aspx]
ExportToHTTPResponse has the same:
[Click|http://msdn.microsoft.com/en-us/library/ms227586.aspx]
Both of these properties are Microsoft properties outside of the Crystal Reports SDK.
We do recommend using ExportToHTTPResponse for security reasons.
[Click|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
Elaine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.