'Print to PDF' not working when using chrome

Stimulsoft Reports.WEB discussion
buzallen
Posts: 11
Joined: Mon Jan 21, 2019 7:36 pm

'Print to PDF' not working when using chrome

Post by buzallen »

Using version 2019.3.6 (this also happened on 2019.3.5) using chrome as the browser we recently started having issues when the user is in the viewer or desginer and they select 'Print to PDF' from the stimulsoft menu. This had worked up until recently.

The only output from the console window is:

ViewerEvent?templateId=109&loadFromCache=true&stiweb_component=Viewer&stiweb_action=Resource&stiweb_data=scripts&stiweb_theme=Office2013LightGrayGreen&stiweb_cachemode=cache&stiweb_version=2019.3.5:433 Resource interpreted as Document but transferred with MIME type application/pdf: "blob:https://client.brytsoftware.com/0e25a31 ... fdf3ba5325".

At one point I also saw chrome report a CORS error but that is not consistent with this issue.

The print to PDF works fine using firefox.

This happens on any report, even if I just open the designer, add an element and select 'print to PDF'

Edit to add that this is a part of a ASP MVC Core App, V2.2

Thanks,
Brian
Andrew
Posts: 4105
Joined: Fri Jun 09, 2006 3:58 am

Re: 'Print to PDF' not working when using chrome

Post by Andrew »

Hello,

Please make sure that you are using the version 2019.3.6, form the text of your error I see "...version=2019.3.5..." Please double check this.

Thank you.
buzallen
Posts: 11
Joined: Mon Jan 21, 2019 7:36 pm

Re: 'Print to PDF' not working when using chrome

Post by buzallen »

Yes, sorry, I must have copied that console log from the staging machine that was still running 2019.3.5. It is doing the same thing on 2019.3.6, in fact this morning I am consistently getting the CORS error which previously only occasionally appeared. This is all being served from the same server so I am no sure why a CORS issue would pop up. This is the entirety of the console log when printing to PDF:

VM14:1 Resource interpreted as Document but transferred with MIME type application/pdf: "https://client.brytsoftware.com/CustomR ... Cache=true".

Uncaught DOMException: Blocked a frame with origin "https://client.brytsoftware.com" from accessing a cross-origin frame.
at HTMLIFrameElement.printFrame.onload (https://client.brytsoftware.com/CustomR ... 3.6:398:34)
Lech Kulikowski
Posts: 6265
Joined: Tue Mar 20, 2018 5:34 am

Re: 'Print to PDF' not working when using chrome

Post by Lech Kulikowski »

Hello,

Could you provide a sample which reproduces the issue for analysis?

Thank you.
terje.pedersen
Posts: 80
Joined: Thu Aug 18, 2016 7:29 am

Re: 'Print to PDF' not working when using chrome

Post by terje.pedersen »

It seems to be the latest version of Chrome browser on Windows (77.0.3865.90 64bit) which doesn't work anymore with 'Print to PDF' we have the same problem on earlier version of Stimulsoft 2018.2.2 and just testet it with 2019.3.1 which has exactly the same problem.

The header says you are sending "application/pdf"
stimulsoft-print-to-pdf1.png
stimulsoft-print-to-pdf1.png (15.87 KiB) Viewed 9461 times
But the content you deliver is not, its HTML with an embedded PDF.
stimulsoft-print-to-pdf2.png
stimulsoft-print-to-pdf2.png (8.97 KiB) Viewed 9461 times
Which also is now warned about in the console:
stimulsoft-print-to-pdf-console.png
stimulsoft-print-to-pdf-console.png (9.16 KiB) Viewed 9461 times
terje.pedersen
Posts: 80
Joined: Thu Aug 18, 2016 7:29 am

Re: 'Print to PDF' not working when using chrome

Post by terje.pedersen »

Found this one now viewtopic.php?f=7&t=57963
'Print to PDF' is now working in 2019.3.6, but it seems like you haven't fixed the issue just bypassed it because the "Resource interpreted as Document but transferred with MIME type application/pdf" still exists with 2019.3.6. with 77.x version of Chrome.

Testing with 2019.3.6 I also got an not so nice error poping up in the report viewer:
stimulsoft-print-to-pdf-report-error.png
stimulsoft-print-to-pdf-report-error.png (11.23 KiB) Viewed 9459 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: 'Print to PDF' not working when using chrome

Post by HighAley »

Hello.

We have found a way to print the PDF.
You could get such warning but it's working.

We don't know why you get the error on the screenshot.
We need more information about it to help you.

Thank you.
terje.pedersen
Posts: 80
Joined: Thu Aug 18, 2016 7:29 am

Re: 'Print to PDF' not working when using chrome

Post by terje.pedersen »

I have added the new issues found in 2019.3.6 to a new thread at viewtopic.php?f=27&t=57999&sid=907c27ac ... 34c4081a25 since the main issue of this thread is solved in 2019.3.6 "Print to PDF"
Andrew
Posts: 4105
Joined: Fri Jun 09, 2006 3:58 am

Re: 'Print to PDF' not working when using chrome

Post by Andrew »

Okay, thank we will work with those issues in another thread.

Have a nice day!
buzallen
Posts: 11
Joined: Mon Jan 21, 2019 7:36 pm

Re: 'Print to PDF' not working when using chrome

Post by buzallen »

Following up on the original post, we're still getting the issues with print to PDF on chrome. This issue persists on basic of examples of the tool. Here are examples of it with a demo project with the basic controller for the Sti functions:

Online demo, go to this page in chrome and preview the report and select 'print to pdf'. In firefox this works fine.

https://brytex.azurewebsites.net/StiEx

Here is the project for that site:

https://www.dropbox.com/s/793sfxaakeigc ... e.zip?dl=0

Probably not necessary to download that as the controller code is just the minimum required:

Code: Select all

    public class StiExController : Controller
    {
        public IActionResult Index()
        {
            return RedirectToAction("OpenDesignerForExistingTemplate");
        }

        public IActionResult OpenDesignerForExistingTemplate()
        {
            return View("OpenDesigner");
        }

        public IActionResult ExitDesigner()
        {
            return RedirectToAction("Index");
        }

        public IActionResult GetReportForDesigner()
        {
            var report = new StiReport
            {
                ReportName = "New Report",
                CalculationMode = StiCalculationMode.Interpretation
            };

            return StiNetCoreDesigner.GetReportResult(this, report);
        }

        public IActionResult PreviewReport()
        {
            StiReport report = StiNetCoreDesigner.GetReportObject(this);
            return StiNetCoreDesigner.PreviewReportResult(this, report);
        }

        public IActionResult DesignerEvent()
        {
            return StiNetCoreDesigner.DesignerEventResult(this);
        }

        public IActionResult SaveReport()
        {
            return StiNetCoreDesigner.SaveReportResult(this);
        }
    }
Post Reply