Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#462 closed task (fixed)

Implement a print function that can print complete pages

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: critical Milestone: Reggie v2.11
Component: net.sf.basedb.reggie Keywords:
Cc:

Description

There is a problem with the current BASE GUI implementation when printing. Due to the use of <frames> and absolutely positioned content, scrolling happens in a <div> tag when the information doesn't fit inside the visible browser window. This affects printing and browsers will only print the first page since from their point of view that is the only page.

This makes it impossible to print anything but the first one or two diagrams in the "Sample processing statistics". We need to solve this in Reggie for now (until BASE comes up with a generic solution). The current idea is to open a new window and then copy the printable contents into that window. This has the added benefit that it will allow us to get rid of the menu and other things that are generally not needed/wanted in the printed output.

Simply copying the innerHTML is a good starting point, but there are some issues:

  • We need to decorate with proper CSS to not loose the styling of certain elements.
  • <canvas> elements need special handling since that drawing is not included in the copy.

Change History (5)

comment:1 Changed 7 years ago by Nicklas Nordborg

Status: newassigned

comment:2 Changed 7 years ago by Nicklas Nordborg

(In [1849]) References #462: Implement a print function that can print complete pages

Implemented a javascript function that opens a popup window and copies the content of a specified html tag (given by the id) to the popup window.

openPrintWindow(ID, printElementId, pageTitle, pageOrientation, printNote)

The change also includes printing changes made in separate branch for #425 in [1723].

comment:3 Changed 7 years ago by Nicklas Nordborg

(In [1851]) References #461 and #462.

  • Added print functionality to the "Sample source report" function.
  • Minor adjustments to the print template to center-align the printed output on the page if possible.
  • Hide the "Case summary" links on the "Samples processing statistics" report when printing.
  • Force page break before the "Appended info" section since it seems like it often breaks in the middle of the table.
  • Get rid of hardcoded line-breaks between images in the "Samples processing statistics" so that scaling down a printout may create a 2-column layout. Or even 3 or 4 columns, but this create very small plots.

comment:4 Changed 7 years ago by Nicklas Nordborg

Resolution: fixed
Status: assignedclosed

Seems to work as expected.

comment:5 Changed 7 years ago by Nicklas Nordborg

(In [1859]) References #462: Implement a print function that can print complete pages

Removed table element in the print template. It was previously used to center the output on the printed page but didn't work well with tables from the "Sample source report" that appeared very compact with hard-to-read values since there was not enough white-space in the columns.

Note: See TracTickets for help on using tickets.