3.2.0

Questions about printing?

I have a page that displays 4 grids on it. It is used to show information about previous visits that a student has made to a counselor. My question is, I would like to be able to select and print certain records from the grids, but not everyone. Is there a way I can select certain records and print only them, or select multiple records and send the data in those records to a new page to print. I would appreciate any help that I can get on this one. Thanks
Bart
September 27,
I've got something like this working nicely in my app. Might not be best way, but here is an overview.

1. Make the relevant grid multi-select
e.g.
obj.setSelectionProperty("multiple", true);


2. When user clicks the Report button, run a JavaScript function which checks number of rows selected and then responds accordingly:

var array = obj.getProperty("selection/values");
if (array.length == 0)
{
//include all items in the report
}
else
{
// ask user if wants to include just selected items in the report
// if yes, loop through array putting selected item values into a SQL "where" string (see below) which is passed to another page
// if not, include all items in the report
}


Looping through the array as follows:

var strWhere = "";
for (var i=0; i<array.length; i++)
{
var text = obj.getDataProperty("text", array[i], 0);
strWhere += "fieldname=" + text " or ";
}
strWhere = strWhere.substring(0,strWhere.length - 3);
etc.


Hope this gives you some ideas. Probably depends a lot on how you are generating the report in the first place.
Tony
September 28,

This topic is archived.

See also:


Back to support forum