cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

Elaine - thank you for the response.

Is there any other way to change this filename other then modifying the Report Title - I couldn't tell by your response if there were multiple ways to change the filename or if this was the only way?

My client displays the report title in the Report - so if I modify it as you indiciated:

crReportDocument.SummaryInfo.ReportTitle = "World Sales Report 2008"

CrystalReportViewer.ReportSource = crReportDocument

... then if they refresh the document at any time the title changes on the report as well.

- Star

0 Kudos

Hi Star,

You'll have to let your customers know that using reserved operating characters is not allowed. To show them it's not a Crystal limitation ask them to try renaming any file and putting a "/" in the name. Windows XP will pop up a message box info indicating you are using a reserved character.

Only other way would be to replace the "/" with some character that is allowed. Your job is to convince them they have to follow the OS rules.

Thank you

Don

nancy_budd
Participant
0 Kudos

We have converted our VB6 program (that uses the RDC) to VB.NET 2005

using the Crystal for .NET methods/properties, etc. (v12 aka CR2008).

Prior to .NET, the exported file name would default to the actual file name of

the report. It is now defaulting to the Report Title. I ask this as we have a

customer (where we have installed the runtime files) that is now getting the

same error exporting a report due to special characters.

Is there any way to change the export to default to the actual filename of the

report as it did before?

0 Kudos

Hi Nancy,

You are loading the report name in code so simply replace the name using the 2 lines of code Elaine provided. Other option is to capture the exporting event and parse the file name for invalid characters and replace them with an underscore "_" as we do when aliasing field names.

Also, the summary change will not be saved in the original report. But as noted, don't use invalid characters and let your customers know the same. It's a basic file system rule that we can't change.

Thank you

Don

nancy_budd
Participant
0 Kudos

Can you please confirm that Crystal used to use the report filename, but it has changed to use the report title from summary info? And did this change with the .NET methods (vs. RDC)? And with what version of Crystal?

Thank you.