The Timer Event is triggered when the user prints a report ( by pressing the OK button on the standard print dialog ). This can be trapped using JavaScript in your web page.
// get datawindow description of some property e.g. printer name PBRX1.SetArgElement( 1, "DataWindow.Printer" ); li_rc = PBRX1.InvokePBFunction( "uf_describe_datawindow", 1 ); ls_description = PBRX1.GetLastReturn(); PBRX1.ResetArgElements();
// debugging message alert( ls_description );
// get user domain and user name li_rc = PBRX1.InvokePBFunction( "uf_get_user_domain", 0 ); ls_user_domain = PBRX1.GetLastReturn(); li_rc = PBRX1.InvokePBFunction( "uf_get_user_name", 0 ); ls_user_name = PBRX1.GetLastReturn();
// set arguments for saving DataWindow results to a different format ls_data_file = ls_temp_dir + "\\copy_of_results.xls"; PBRX1.SetArgElement( 1, "Excel8!" ); PBRX1.SetArgElement( 2, ls_data_file ); PBRX1.SetArgElement( 3, "yes" ); // save DataWindow results to file li_rc = PBRX1.InvokePBFunction( "uf_save_datawindow", 3 ); // get number of rows saved to file li_rows_saved = parseInt( PBRX1.GetLastReturn() ); // reset argument elements PBRX1.ResetArgElements();
// debugging message if (li_rows_saved >= 0) { alert( "A copy of the results which the user " + ls_user_domain + "\\" + ls_user_name + " printed has been saved to a file " + ls_data_file ); }