Print event that fires for every line?

Is there a print event which fires for every line in a table?

Thank you,
Don

What are you trying to achieve exactly?

I would like to be able to show/hide colored boxes, so that particular cells in the table are blocked off. Right now all I can do is place a dash (-) in a box that should be blocked off.

I would also like to alternate between thin and thick horizontal lines for even/odd rows, to make the printed form easier to use.

Thank you,
Don

That could be done using the onRender event (rowBgColor for Servoy 5.x) and a dedicated CSS style for the print form, have a look at the wiki to start with.

Hi Nicola,

I see an ability to set color, but what about setting something to have no color? I would like to show and hide grayed-out areas (possibly rectangles). For the horizontal lines, would I have one thick horizontal line and one thin line, and alternately show and hide those by making one of them transparent?

http://wiki.servoy.com/display/public/D … properties

Also, is this stuff available for 6.0.x, or only 6.1?

Thank you,
Don

Well, I figured out how to get alternate lines to print, by using two lines of different thicknesses rather than trying to change the thickness of a single line. So the top portion of this works. When I try to read the value of the contents of a field, however, I get errors for every row printed. If I use the interactive console, I can see that “item” has properties, including a field value. But I cannot seem to test the field value with this method.

function onRender_register_1_prt(event) {	
	var item = event.getRenderable();	
	var itemName = item.getName();
	if(itemName == "row_separator") {
		row_CT = row_CT + 1;
		if (row_CT % 2) {
			item.visible = true;
		} else {
			item.visible = false;
		}		
	} else if(itemName == "row_separator2") {
		if (row_CT % 2) {
			item.visible = false;
		} else {
			item.visible = true;
		}
	} else if(/^arst_col/.test(itemName)) {
		var record = event.getRecord();
		if(record[itemName] == "-") {
			item.bgcolor = "#999999";
		} else {
			item.bgcolor = "#ffffff";
		}
	}
}

Thank you,
Don