:: Forum >>

Printing the grid

I am trying to print the grid. If i try print preview in IE is see the headers, the rest of the page is blank and the number of pages is rapidly increasing... never stopping. I didn't dare real printing, but writing to a pdfwriter didn't work... . This problem does not occur in Firefox. Here is the code i use:

$userid = $_SESSION['user_id'];
$customerid = $_SESSION['customID'];

echo "<H2>Gebruikers</H2>\n";
//echo "<H2>".$itemnames['credentials_pheader_label']."</H2>\n";

//select the credentials of the logged in customer
$sql = "select * from CONTACT_PERSON where CP_REL_ID=".$customerid." order by CP_FIRSTNAME asc";
$result = exec_query($sql);
if($result != "") {
<div id=\"box\" style=\"height:25%;width:90%;\">
<div style=\"padding:0px 50px\">
<div class=\"line\">&nbsp;</div>
<div class=\"line2\">Laden van data...</div>
<div class=\"loading\"></div>
$columns = "[
\"Gebruiker type\",

$data = "";
while($resultarray = ibase_fetch_object($result)) {
$blocked = $resultarray->CP_BLOCKED;
if($blocked==0) {
$blocked = "Nee";
else {
$blocked = "Ja";
$usertype= $resultarray->CP_POWERUSER;
if($usertype==0) {
else if($usertype==1) {
else {
$userype="Hoger dan 1";
if($data=="") {
$data .= "[";
else {
$data .= ",";
$data .= "[
echo "
<link href=\"./xp/aw.css\" rel=\"stylesheet\" type=\"text/css\" ></link>
<script src=\"./aw.js\"></script>
var obj = new AW.UI.Grid;
var myData = ".$data."
var myColumns = ".$columns."
// provide cells and headers text

// set number of rows/columns

// enable row selectors
obj.setSelectorText(function(i){return this.getRowPosition(i)+1});

// set headers width/height

// set row selection


// write grid html to the page

try {
document.getElementById(\"box\").innerHTML = obj;
}, 100);

echo "<style>
.aw-grid-control {height: 100%; width: 100%; margin: 0px; border: none; font: menu;}
.aw-row-selector {text-align: center}

.aw-column-0 {width: 80px;}
.aw-column-1 {width: 150px;}

.aw-grid-cell {border-right: 1px solid threedlightshadow;}
.aw-grid-row {border-bottom: 1px solid threedlightshadow;}

.aw-alternate-even {background: #fff;}
.aw-alternate-odd {background: #eee;}

.aw-rows-selected {background: #316ac5;}

else {
echo "Geen gebruikers gevonden";
<br /><div id=\"print\"><a href=\"javascript:window.print()\" class=\"print\">Print deze pagina</a></div>";

Rik Smith
Monday, October 24, 2005
This is in version 2 beta BTW
Rik Smith
Monday, October 24, 2005

I was trying to make special stylesheet for printing for 1.0 without much success. For 2.0 I did not even try yet. At the moment I would rather recommend making separate nicely formatted page on the server-side (using TABLE tag etc.).
Alex (ActiveWidgets)
Monday, October 24, 2005
Tnx Alex, for version 1 however it was possible for me to print, with some css found on the forum. And the funny thing now is BTW that normally every thing works in IE and don't in FF but now thing are turned around :). I will make separate print page for now and hope for a solution in the future :).
Rik Smith
Monday, October 24, 2005

This topic is archived.

Back to support forum

Forum search