Ignore:
Timestamp:
Feb 18, 2013, 9:54:47 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

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].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/scanbquartermonthreportgenerator.jsp

    r1843 r1849  
    254254      reportTable = messageTable;     
    255255    }
     256    Main.show('printButton');
    256257    Main.show('gorestart');   
    257258  }
     
    408409  }
    409410
     411  function goPrint()
     412  {
     413    var printNote = '<b>Note!</b> For better printing set page orientation to <i>portrait</i>.';
     414    printNote += ' Scale down to <i>90%</i> to fit 2 plots per page.';
     415    openPrintWindow('<%=ID%>', 'reportcell', 'Sample processing statistics', 'portrait', printNote);
     416  }
    410417  </script>
    411418 
     
    415422    <p:path><p:pathelement
    416423      title="Reggie" href="<%="index.jsp?ID="+ID%>"
    417       /><p:pathelement title="Sample processing report"
     424      /><p:pathelement title="Sample processing statistics"
    418425      /></p:path>
    419426    <div class="content">
     
    570577        <tr>
    571578          <td rowspan="3" class="stepno">3</td>
    572           <td class="steptitle">Generated report</td>
     579          <td class="steptitle">Generated report
     580            <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>
     581          </td>
    573582        </tr>
    574583        <tr>
     
    578587        </tr>
    579588        </table>
    580         <div id="canvasDiv01" style="display: none;>
    581           <canvas id="plot01" width="700" height="550">
    582             <p>Your browser doesn't support canvas.</p>
    583           </canvas>
    584         </div>
    585         <div id="canvasDiv02" style="display: none;>
    586           <canvas id="plot02" width="700" height="550">
    587             <p>Your browser doesn't support canvas.</p>
    588           </canvas>
    589         </div>
    590         <div id="canvasDiv03" style="display: none;>
    591           <canvas id="plot03" width="700" height="450">
    592             <p>Your browser doesn't support canvas.</p>
    593           </canvas>
    594         </div>
    595589      </div> 
    596590     
Note: See TracChangeset for help on using the changeset viewer.