)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to load image and background color in print preview of chrome or firefox browser in Syncfusion JavaScript reportviewer

Platform: jQuery |
Control: ejReportViewer |
Published Date: December 11, 2018 |
Last Revised Date: May 22, 2019

Syncfusion Javascript ReportViewer allows you to prevent an external style sheet loading and image not displayed in print preview of Chrome or Firefox browser. The following sections guide you to view the background color and image in print preview with the help of reportPrint’ API.

 

To load background color in print preview

Background color of a report element is not updated in print layout due to external style overwrites the print layout style specified in the application. To avoid this, set the ‘isStyleLoad’ property value to false in the ReportViewer control render pages as shown in the following code snippet.

 

     <script type="text/javascript">
            $(function () {
                $("#container").ejReportViewer(
                    {
                        reportServiceUrl: "/api/ReportApi",                       
                        processingMode:ej.ReportViewer.ProcessingMode.Remote,          
                        reportPath: "~/Report/GroupingAgg.rdl",
                        reportPrint: "onReportPrint"
                    });
            });
 
            function onReportPrint(args) {
                args.isStyleLoad = false;
            }      
    </script>

 

To load image in print preview

 

Images are not displayed in print preview due to passing content or stream to browser before loading the image tag. This can be avoided by increasing the value of the ‘printDelay’ property value as in the following code snippet.

 

<script>
        $(function () {
                $("#container").ejReportViewer(
                    {
                        reportServiceUrl: "/api/ReportApi",                       
                        processingMode:ej.ReportViewer.ProcessingMode.Remote,          
                        reportPath: "~/Report/GroupingAgg.rdl",
                        reportPrint: "onPrintReport"
                    });
            });
 
        function onPrintReport(args) {
            var data = $("#reportsample").data('ejReportViewer');
            if (data.browserInfo.name != "msie")
            {
                args.printWind.printDelay = 2000;
            }
            args.isStyleLoad = false;
        }
</script>

 

Download reportviewer print preview sample here

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon