Report preview differ from print preview

Stimulsoft Dashboards.JS discussion
Post Reply
csrt
Posts: 49
Joined: Thu Jan 17, 2019 12:38 pm

Report preview differ from print preview

Post by csrt »

I am trying to print a report. In the viewer it shows 8 pages, but when I try to print it via Print with/without preview - data doesn't fit on one page, or sometimes empty pages appear.
However, if I use report.printToPdf();, it prints 8 pages as shown in preview.

Questions:
1) Why report.printToPdf() is working, and simple Ctrl+P doesn't?
2) Why the data that doesn't fit just won't create an extra page (9 pages instead of 8 etc)?
3) Is there a way to force Scale to Fit?

Enclosed there are screenshots, report and report data.
Attachments
report_3.png
report_3.png (320.66 KiB) Viewed 6319 times
report_2.png
report_2.png (250.49 KiB) Viewed 6319 times
report_1.png
report_1.png (73.67 KiB) Viewed 6319 times
invent.json.mrt
(124.44 KiB) Downloaded 246 times
Report.csv
(26.59 KiB) Downloaded 228 times
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Report preview differ from print preview

Post by Lech Kulikowski »

Hello,

report.printToPdf(); - is exporting to PDF.
Print with/without preview - is printing with browser feature and results depend on the browser printing settings (margins, headers, footers, etc.)
Unfortunately, due to the browser security police, these settings cannot be set from the viewer.

Thank you.
csrt
Posts: 49
Joined: Thu Jan 17, 2019 12:38 pm

Re: Report preview differ from print preview

Post by csrt »

But how about this particular report I've attached? Can you take a look and say what we are doing wrong, so the result in the viewer and print preview doesn't match? Maybe we are setting the report wrong, or we are missing some key settings?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Report preview differ from print preview

Post by HighAley »

Hello.

The page size in your report is custom. The margins are set to zero.

We don't see the page size on the print settings. Maybe they are different.
The browser adds additional margins that can move content of the page to the next one.

Thank you.
csrt
Posts: 49
Joined: Thu Jan 17, 2019 12:38 pm

Re: Report preview differ from print preview

Post by csrt »

Hello, I've modified the report, so that the size would be A4, and margins 1cm each. In the printer settings I've set margins to default and custom(1cm each), and the problem still persists.
I even made a report with only the data band - no header, no footer, just data. And the problem is present. I've attached the reports and screenshots.

So maybe the problem is in some settings of the data band? Because, how I understand it, if the data doesn't fit - it should go on another page. But in my case I get next behavior - in the viewer it shows 8 pages, but in print it shows more (some content doesn't fit).

I would appreciate if you take a loot at the attached reports (especially that with the data band only), and could suggest me a solution to this situation. Thank you.
Attachments
report-margins.mrt
(101.32 KiB) Downloaded 240 times
report-onlyData.mrt
(66.59 KiB) Downloaded 238 times
report_4.png
report_4.png (175.01 KiB) Viewed 6306 times
report_5.png
report_5.png (293.36 KiB) Viewed 6306 times
report_6.png
report_6.png (185.15 KiB) Viewed 6306 times
report_7.png
report_7.png (269.75 KiB) Viewed 6306 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Report preview differ from print preview

Post by HighAley »

Hello.

Sorry, we can't reproduce the issue without data.
Please, try the Print To PDF feature.
If the report is right there then the issue is in print settings of the browser.

The same margins in the browser don't guarantee that the report fit in page.
Make the margins smaller.

Thank you.
csrt
Posts: 49
Joined: Thu Jan 17, 2019 12:38 pm

Re: Report preview differ from print preview

Post by csrt »

Hello again. I've attached again the report and data in csv. Can you please take a look at this report with data, and point me what seems to be the problem? Thank you in advance.
Attachments
invent.json.mrt
(124.44 KiB) Downloaded 264 times
Report.csv
(26.59 KiB) Downloaded 234 times
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Report preview differ from print preview

Post by Lech Kulikowski »

Hello,

We need some additional time to investigate the issue.

Thank you.
csrt
Posts: 49
Joined: Thu Jan 17, 2019 12:38 pm

Re: Report preview differ from print preview

Post by csrt »

Hello. Did you manage to check the issue? Can you tell me if there is a problem in the report itself, or some browser-library interaction issues, that doesn't allow the library to manipulate the browser print settings?
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Report preview differ from print preview

Post by Lech Kulikowski »

Hello,

It is not possible to change browser print settings from any library, it is the browser limitation (Security Policy).

Thank you.
Post Reply