Skip to Content
avatar image
Former Member

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)

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.?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer