Skip to main content
Topic: Print and Chart issues are urgent to be fixed (Read 1021 times) previous topic - next topic

Print and Chart issues are urgent to be fixed

Dear Developers,

Although we have been helped by good fellows in this forum with some turnarounds, these basic features are part of PHPRad´s functionality and even the turnarounds have some conflicts when you publish the applications.

Please, do your best to launch a correction release ASAP. It´s becoming frustrating but I still have hope on PHPRad due to the wonderful work that you have done so far.

Give me some answer here to renew my hope.

Many thanks.

Euder Ribeiro

 

Re: Print and Chart issues are urgent to be fixed

Reply #1
Hi friends,

My alternative to print issue on PHPRad. Insert a Button on Page Layout as a Custom View component with the following code:

Code: [Select]
<div>
    <!---   Print Button
            Author:         Euder Ribeiro
            Last Update:    21-Jul-2020
            Obs:            The links bellow may be exchanged to local files
    -->
    <link rel="stylesheet" href="https://printjs-4de6.kxcdn.com/print.min.css"/>
    <script src="https://printjs-4de6.kxcdn.com/print.min.js"></script>
   
    <script>
        function PrintElem(elem)
        {
            var mywindow = window.open('', 'PRINT', 'height=400,width=600');
       
            mywindow.document.write('<html><head><title>' + document.title  + '</title>');
            mywindow.document.write('<html><head><link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">');
            mywindow.document.write('</head><body >');
            mywindow.document.write('<h1>' + document.title  + '</h1>');
            mywindow.document.write(document.getElementById(elem).innerHTML);
            mywindow.document.write('</body></html>');
       
            mywindow.document.close(); // necessary for IE >= 10
            mywindow.focus(); // necessary for IE >= 10*/
            mywindow.print();
            mywindow.close();
       
            return true;
        }
    </script>
   
    <button type="button" class="btn btn-primary" onclick="PrintElem('page-report-body')">
    <i class="fa fa-print"></i>                             
                Print
    </button>
</div>