1
votes

We have crystal report which generates an invoice for our clients, crystal report's name is invoice.rpt. When crystal report is created and print to PDF file, the default pdf file name is invoice.pdf.

is there a way to change the pdf name to the invoice number (which is a variable inside crystal report)?

for example, we open inovice.rpt to create a invoice 10000, can we print to pdf file and name set to 1000 by default, instead of invoice.pdf?

3

3 Answers

0
votes

No such option with Crystal alone.

But several 3rd-party tools provide that functionality. See Ken Hamady's excellent web site for lists and reviews of 3rd-party Crystal Reports tools.

0
votes

Just change to name of CrystalReportViewerID as desired

CrystalReportViewerID="SaleReport-16Nov2019" in code

-2
votes

ReportClientDocument objReportClientDocument = new ReportClientDocument(); objReportClientDocument.open("WEB-INF\reports\Folder/report.rpt", 0);

IReportSource objIReportSource = objReportClientDocument.getReportSource(); ReportExportControl objReportExportControl = new ReportExportControl(); objReportExportControl.setReportSource(objIReportSource);

objReportExportControl.setName("Report_FileName");