24 lines
898 B
JavaScript
24 lines
898 B
JavaScript
/* Generate print preview for table/graph contents generated by Tabulizer
|
|
http://www.tabulizer.com */
|
|
|
|
function printTabulizerArea(area_id) {
|
|
var open_in_new_window = false;
|
|
if (open_in_new_window) {
|
|
var areaElements = document.getElementById(area_id);
|
|
var printing = window.open('','','left=0,top=0,width=550,height=400,toolbar=0,scrollbars=0,status=0');
|
|
printing.document.write(areaElements.outerHTML);
|
|
printing.document.close();
|
|
printing.focus();
|
|
printing.print();
|
|
printing.close();
|
|
} else {
|
|
var areaElements = document.getElementById(area_id).outerHTML;
|
|
var oldHTML = document.body.innerHTML;
|
|
document.body.innerHTML = areaElements;
|
|
// Print Page
|
|
window.print();
|
|
// Restore original HTML
|
|
document.body.innerHTML = oldHTML;
|
|
return;
|
|
}
|
|
} |