This topic is locked

Export results on view page

4/26/2007 11:48:09 PM
PHPRunner General questions
K
karen price author

Hi,
Is it possible for me to have the printer friendly and export results functionality in the view page as well? If so, kindly post the solution on the forum so everyone can learn. Thanks.

J
Jane 4/27/2007

Hi,
you can do the following:

  1. open C:/Program Files/PHPRunner4.0/source/export.php file, find following snippet:
    foreach(@$_POST["mdelete"]as $ind)

    {

    $sWhere = $sWhere . " or ";

    foreach @TABLE.arrKeyFields as @k##

    $sWhere = $sWhere . GetFullFieldName("##@k s##","") . "=" . make_db_value("##@k s##", $_POST["mdelete##@index##"][$ind-1],"","");

    if !@last##

    $sWhere = $sWhere . " and ";

    endif##

    endfor##



    }





and replace it with this one:

foreach(@$_REQUEST["mdelete"]as $ind)

{

$sWhere = $sWhere . " or ";

foreach @TABLE.arrKeyFields as @k##

$sWhere = $sWhere . GetFullFieldName("##@k s##","") . "=" . make_db_value("##@k s##", $_REQUEST["mdelete##@index##"][$ind-1],"","");

if !@last##

$sWhere = $sWhere . " and ";

endif##

endfor##



}


Then open your project, proceed to the Visual Editor tab, choose VIEW page, switch to the HTML mode and add following links:

<A href="TableName_print.php?a=delete&amp;mdelete%5B%5D=1&amp;mdelete1%5B%5D={$show_key1}" target=_blank>Printer-friendly page</A>&nbsp;

<A href="TableName_export.php?a=delete&amp;mdelete%5B%5D=1&amp;mdelete1%5B%5D={$show_key1}" target=_blank>Export page</A>

K
karen price author 4/27/2007

Hi Jane,
Thanks for your prompt reply. I have done everything you asked but an error was generated:
Error type 2

Error description Invalid argument supplied for foreach()

URL 127.0.0.1/po/aluminium_print.php?a=delete&mdelete%5B%5D=1&mdelete1%5B%5D=1

Error file C:\Program Files\PHPRunner3.1\projects\po\output\aluminium_print.php

Error line 37
I actually modified the look of the view page via the visual editor. Do you think that caused the error?
Thank you for your help.

Hi,

you can do the following:

  1. open C:/Program Files/PHPRunner4.0/source/export.php file, find following snippet:
    and replace it with this one:
    Then open your project, proceed to the Visual Editor tab, choose VIEW page, switch to the HTML mode and add following links:

K
karen price author 5/1/2007

Hi,
Anyone who knows what went wrong with the above code? I keep getting errors with the export and printer friendly pages.

J
Jane 5/2/2007

It seems that you didn't modify export.php file.

Also please make sure that you use the latest PHPRunner update.