This topic is locked
[SOLVED]

 Print Report from listpage

8/1/2014 8:08:28 AM
PHPRunner General questions
C
cms001 author

Hi,
I would like to add a button to the list page, similar to this example: "http://xlinesoft.com/phprunner/docs/inserting_button.htm#examples"; where the print button show in every row
Once I click on the button, I would like to open that specific record in report friendly view to be printed.

  1. Where do I add the code on the button? (client before, server , client after)
  2. How do I get the primary key value from the list: so far I have: $KeyValue = data["KeyFieldname"]
  3. How do I filter the printer friendly page with the primary key value (players_t_Report_print.php) form:
    Thanks very much -

Q
quyennt_ptit 8/9/2014



Hi,
I would like to add a button to the list page, similar to this example: "http://xlinesoft.com/phprunner/docs/inserting_button.htm#examples"; where the print button show in every row
Once I click on the button, I would like to open that specific record in report friendly view to be printed.

  1. Where do I add the code on the button? (client before, server , client after)
  2. How do I get the primary key value from the list: so far I have: $KeyValue = data["KeyFieldname"]
  3. How do I filter the printer friendly page with the primary key value (players_t_Report_print.php) form:
    Thanks very much -


Still have to select a row
Clent Before:
//any java code you want.
Server:
$result["txt"]="";
foreach($keys as $idx => $val)

{

$result["txt"]=$val[KeyFieldname];

}
Client After:
window.open ("xxx_print.php?a=return&selection[0]="+result["txt"],"_blank","fullscreen=yes");

C
cms001 author 8/11/2014

Hi
Thanks for reply.

Cannot get code from quyen to work, so I found this in helpfile, but, it does not filter the correct record.
The code below opens the report and the url looks ok, but all records are showing in report:
Server:

$record = $button->getCurrentRecord();

$result["REGNO_GI"]=$record["REGNO_GI"];
Client After:

var url = 'registrations_t_print.php?REGNO_GI='+result["REGNO_GI"];

var myWindow = window.open(url, "", "");
I click the print btn, and it opens the report, but all records show,

the url looks like this: http://localhost:8085/registrations_t_print.php?REGNO_GI=4
Any help please - I am stuck with this !

C
cms001 author 8/12/2014

Hi,
I managed to fix this.

The code I have posted yesterday is 100%, the only thing I did not do, was to add the filter to the report
On report page: Before SQL query I added:

$strWhereClause = "REGNO_GI = ". $_GET["REGNO_GI"];
now working very nice, I understand it better now as well. Still new to this.
Thanks to Alexey.