Bug 36512 - Build printing into reports
Summary: Build printing into reports
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-03 22:21 UTC by Christopher Brannon
Modified: 2024-04-03 22:21 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Brannon 2024-04-03 22:21:12 UTC
Currently, to print a report via template, you have to export the report to an html file, then open it and print it.

I would like to suggest building the print into the report.  I currently use the following via jquery:

  //Report Printing (v23.05)
  if($('#rep_guided_reports_start #format').length) {
    $('#format').siblings('ul').append('<li><a id="mnuPrintReport" href="#">Print Report</a></li>');
    $('#mnuPrintReport').on('click', function () {
      var reportInfo = '<html><head></head><body>' + $('#ReportContent').html() + '</body></html>';
      var myWindow=window.open('','','');
      myWindow.document.write(reportInfo);
      myWindow.document.close();
      setTimeout(function(){ 
        myWindow.focus();
        myWindow.print();
        myWindow.close();
      },500);
    });
  }
  //END Report Printing

Any report I want to print must be wrapped in <div #ReportContent></div>

This works for templated reports, and might also work for regular reports.  The div could be baked into to code.