cancel
Showing results for 
Search instead for 
Did you mean: 

why Crystal Reports doesn't support Print Dialog to browser?

SoftwareMemo
Explorer
0 Kudos
174

Hello SAP Community,

I do many search, find some questions about similar problem.

https://community.sap.com/t5/technology-q-a/print-dialog-in-crystal-report/qaq-p/12582149

But doesn't find any solution.

I must export report to PDF to print. Is there any idea to allow show Print Dialog?

Such as this dialog in Chrome, Firefox, Edge etc.

SoftwareMemo_0-1746503189198.png

I try to switch PrintMode = "ActiveX" but doesn't work. maybe beacuse ActiveX is not supported in modern browsers.

Please any solution to this problem?

 

Accepted Solutions (1)

Accepted Solutions (1)

DonWilliams
Active Contributor
0 Kudos

Did you enable the CR Viewers Print Button?

DonWilliams_0-1746701019859.png

You can also enable the Export Button.

If you want you can hide CR's print and export button and place your own buttons to do both through code.

Just remember you cannot print to PDF directly using CR's print button, I believe this is what you want to do using your own button, export then print to PDF.

Unfortunately there is no Print button click event:

DonWilliams_1-1746701277903.png

So your first suggestion to use your own button is the only option for you.

Also be aware the export is formatted for their default printer unless you add dialog boxes for them to select their printer first and then export and then print the PDF using WEB PDF API's.

Hope that's clear now...

SoftwareMemo
Explorer
0 Kudos

Hi Don!, thanks for you reply and your time, What I need is just show a browser Print Dialog when I click on print button. but CrystalReportViewer doesn't show Print dialog it forcibly export report to pdf. so the end-user can't show Print Dialog and then Print to their selected print from Browser Print Dialog like other Reporting tools. I wonder why this functionality not implemented in asp.net webform from many long time!

SoftwareMemo_0-1746703517397.png

The Browser Print Preview dialog should appeared rather than export then user manually open pdf then open print preview then print.

DonWilliams
Active Contributor
It's always been this way, CR says it's Pixel perfect so what you see on screen is what the PDF should look like, no need to bring up the Print dialog box. As I noted, hide CR's print button and use your own to export than open the PDF using PDF API's to view then print.

Answers (1)

Answers (1)

DonWilliams
Active Contributor
0 Kudos

You cannot print a report directly to a PDF file in a WEB app due to permissions etc. It must be Exported to PDF format first and then print the PDF.

Check with the developer to see if he can add an Export button to the application with a format type (PDF) and Export destination.

The problem is if you are accessing the app from an external site you may not have permissions to get the exported file. The Developers would need to be able to stream the PDF file to you.

CR's viewer can't get past what the WEB site allows.

SoftwareMemo
Explorer
0 Kudos

Hi Don, thanks for your reply, If I can't show Print Preview dialog directly in crystal report viewer. so is there a way to customize print button click-event? I think I can export PDF in guid format then open url in external tab and show Print Preview Dialog. or if you have an idea to show browser Print Preview dialog when click on Print. what I actually need is just show a Print Preview dialog for current viewed report. https://prnt.sc/rjXpKnvJitDq I don't mean direct printing. but I want show the browser preview dialog.

Edit:

I found little trick solution. but it doesn't show print preview for all report pages.

See my video

https://www.youtube.com/watch?v=4rAZ5Jb01hU

A trick is from
https://stackoverflow.com/questions/29486992/print-crystal-report-directly-in-asp-net-c-sharp

Please why Crystal Reports doesn't support Print Preview dialog?