Current Position:Home > Error Exporting - File Not Found - due to Summary Information Title

Error Exporting - File Not Found - due to Summary Information Title

Update:11-30Source: network consolidation
Advertisement
I downloaded the vbnet_win_SimplePreviewReport and modified it slightly in order to duplicate the export problem I'm having.  I'm using Crystal Reports 2008 in VB.NET.
I opened the World Sales report and edited the Summary Info (Crystal Reports > Report > Summary Info) - by changing the Title from "World Sales Report" to "World Sales / Report". 
when you Run the application and press the Export button you will get an exception.  From what I can tell the Title of the report is used to populate the file name in the dialog that is presented.  When the title contains a character that is not allowed by a filename you get an exception.
I have a client with a number of reports and many of them contain the "/" in their Summary Info - they display this as the Title on their report.  I've created my own export button to test with and before calling CrystalReportViewer1.ExportReport() - I've changed the Title to be an empty string --- nothing works.  I always get an exception.  The only thing I can do is actually edit the report and change the summary info title - which I don't believe is something the client should be restricted to on what goes here. 
Does anyone have any thoughts or know what I could do in order to leave the client data as is and still export without errors?
Thanks.
Star Myers

The Best Answer

Advertisement
Hello, Star;
You are correct. Crystal Reports is using the Report Title by default as the filename on export.
There are options. When exporting from the viewer you can change the filename without changing the underlying report.
You can set an appropriate filename using code to export. In that case you might want to create your own export button with code behind.
You can change the Summary Field "Report Title" in code before passing it to the viewer without changing the original underlying report.
crReportDocument.SummaryInfo.ReportTitle = "World Sales Report 2008"
CrystalReportViewer.ReportSource = crReportDocument
You cannot use a character that Windows will not accept in a filename.
Elaine