Changeset 1851


Ignore:
Timestamp:
Feb 18, 2013, 2:04:18 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

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.
Location:
extensions/net.sf.basedb.reggie/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/css/printable.css

    r1849 r1851  
    145145  }
    146146 
     147  .noprint-preview
     148  {
     149    display: none;
     150  }
    147151}
    148152
  • extensions/net.sf.basedb.reggie/trunk/resources/print_template.jsp

    r1849 r1851  
    4141      <br clear="all">
    4242    </div>
    43     <div id="printarea" style="text-align: center;"></div>
     43    <table style="margin: auto;">
     44      <tr><td><div id="printarea"></div></td></tr>
     45    </table>
    4446  </div>
    4547</body>
  • extensions/net.sf.basedb.reggie/trunk/resources/samplereportgenerator.jsp

    r1820 r1851  
    380380      cellElement.appendChild(multipleDatesTable);
    381381    }
    382     Main.show('gorestart');   
     382    Main.show('printButton');
     383    Main.show('gorestart');
    383384  }
    384385 
     
    19411942    var weekNo = Math.ceil(( ( (tmpDate - yearStart) / 86400000) + 1)/7);
    19421943    return weekNo;
     1944  }
     1945 
     1946  function goPrint()
     1947  {
     1948    var frm = document.forms['reggie'];
     1949    var reportName = frm.reporttype[frm.reporttype.selectedIndex].text;
     1950    var printNote = '<b>Note!</b> For better printing set page orientation to <i>landscape</i>.';
     1951    openPrintWindow('<%=ID%>', 'reportcell', reportName, 'landscape', printNote);
    19431952  }
    19441953
     
    20962105        <tr>
    20972106          <td rowspan="3" class="stepno">3</td>
    2098           <td class="steptitle">Generated report</td>
     2107          <td class="steptitle">Generated report
     2108            <span id="printButton" class="link" style="float:right; display: none;" onclick="goPrint()"><img src="images/print.png" style="padding-right: 0.5em;">Print version&hellip;</span>
     2109          </td>
    20992110        </tr>
    21002111        <tr>
  • extensions/net.sf.basedb.reggie/trunk/resources/scanbquartermonthreportgenerator.jsp

    r1849 r1851  
    148148  {
    149149    if (!intervalIsValid) return;
    150     var cellElement = document.getElementById('reportcell');
     150    var cellElement = document.getElementById('reportdiv');
    151151    var frm = document.forms['reggie'];   
    152152    var reportType = frm.reporttype[frm.reporttype.selectedIndex].value;   
     
    194194        var jsonStatisticsPlotArray = report.plotStatistics;
    195195        // Draw plots
    196         setInnerHTML('reportcell', '');
     196        setInnerHTML('reportdiv', '');
    197197        for (var plotIndex in jsonStatisticsPlotArray)
    198198        {
     
    206206          var boxPlotJsonData = plotJsonDataContainer['plotData'];
    207207          // Create plot from plot JSON data
    208           var spacer = document.createElement('text');
    209           spacer.innerHTML = "<BR>";
    210208          if (plotOptionalHeadline != null && plotOptionalHeadline != '')
    211209          {
     
    213211            var headlineText = document.createElement('text');
    214212            headlineText.innerHTML = "<BR>" + plotOptionalHeadline + "<BR>";
    215             cellElement.appendChild(spacer);
    216213            cellElement.appendChild(headlineText);
    217214          }
     
    230227          canvasInTable.setAttribute('height', draw_area_hgt);
    231228          createBoxPlot(boxPlotJsonData, canvasInTable, draw_area_wdt, draw_area_hgt);
    232           cellElement.appendChild(spacer);
    233           cellElement.appendChild(canvasInTable);
     229          cellElement.appendChild(canvasInTable);         
    234230        }
    235231        // Print optional appended info
     
    240236          var infoText = document.createElement('text');
    241237          infoText.innerHTML = "<BR>" + appendedInfo + "<BR>";
    242           cellElement.appendChild(spacer);
    243238          cellElement.appendChild(infoText);
    244239        }
     
    583578        <tr>
    584579          <td id="reportcell" class="stepfields">
     580            <div id="reportdiv" style="text-align: center;">
    585581            <i>Generating report...</i>
     582            </div>
    586583          </td>
    587584        </tr>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/ScanBQuarterMonthReportServlet.java

    r1850 r1851  
    529529    if (chartVariantList.contains(minutesToRnaLaterChart))
    530530    {
    531       appendedInfoText += "<h2>&nbsp;Appended Info</h2>";
     531      appendedInfoText += "<h2 class=\"pagebreak\">Appended Info</h2>";
    532532      appendedInfoText += "<br>";
    533533      appendedInfoText += createMinToRnaLaterAppendTextTable(dc, "Samples with negative min to RNAlater", sampleNegativeMinToRnaLaterList);
     
    560560    text += "<td class='reportsubheader'>Sampling date</td>";
    561561    text += "<td class='reportsubheader'>RNAlater date</td>";
    562     text += "<td class='reportsubheader'>Case summary</td>";
     562    text += "<td class='reportsubheader noprint-preview'>Case summary</td>";
    563563    text += "</tr>";
    564564    for (Sample s: sampleList)
     
    580580      text += "<td class='reportdata'>" + samplingDateStr + "</td>";
    581581      text += "<td class='reportdata'>" + rnaLaterDateStr + "</td>";
    582       text += "<td class='reportdata'>" + caseSummaryButtonCode + "</td>";
     582      text += "<td class='reportdata noprint-preview'>" + caseSummaryButtonCode + "</td>";
    583583      text += "</tr>";
    584584    }
Note: See TracChangeset for help on using the changeset viewer.