Symptom
- A web application developed using Crystal Reports 2008 .NET SDK to view report.
- If the report is exported using the Export button from the Crystal report viewer, the file dialog does not show any file name by dafault.
Environment
- Visual Studio 2008
- Crystal Reports 2008
Cause
- The Crystal reports viewer is not able to retrieve the name of the report as it is neither specified nor provided at runtime.
Resolution
- This behavior can be changed using below steps at design time.
- Open the report in the designer.
- Go to ‘Summary Info’ option in File menu.
- In the Summary tab Set the ‘Title’ to the name of the report.
- Save the report and use it in the application. The export file dialog has the report name by default.
- Same thing can be done at runtime by adding below piece of code (VB.NET) to the application.
Dim CrReportDocument As New ReportDocument
Dim CrReportClientDocument As ISCDReportClientDocument
Dim MyRptName As String = "C:\Documents and Settings\Administrator\Desktop\Report1.rpt"
CrReportDocument.Load(MyRptName)
CrReportClientDocument = CrReportDocument.ReportClientDocument
CrReportClientDocument.SummaryInfo.Title = MyRptName
CrystalReportViewer1.ReportSource = CrReportDocument
Keywords
KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , Problem
Product
Crystal Reports 2008 V1