How to Suggest Name when Saving Crystal Report

Asked

Viewed 232 times

2

Does anyone know how to suggest name when saving Crystal Report C#, in the dialog box, windows form? The format already managed to restrict...:

crystalRVEditoraNomeComeca.AllowedExportFormats = (int)(CrystalDecisions.Shared.ViewerExportFormats.ExcelRecordFormat);

Below picture to help in understanding: Sugerir Nome

2 answers

2

See if this solves, in this export, a class of options is used for the export. In it the property Diskfilename is the file name.

ExportOptions CrExportOptions ;
                DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
                PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
                CrDiskFileDestinationOptions.DiskFileName = "c:\\csharp.net-informations.pdf";
                CrExportOptions = cryRpt.ExportOptions;
                {
                    CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                    CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
                    CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
                    CrExportOptions.FormatOptions = CrFormatTypeOptions;
                }
                cryRpt.Export();
  • Didn’t work...only saved in Diskfilename address...

1


It worked that way :

ReportDocument rd = new ReportDocument();
rd.SummaryInfo.ReportTitle = "Nome Desejado";

Browser other questions tagged

You are not signed in. Login or sign up in order to post.