how to custom print preview page

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
creat015
User
Posts: 79

how to custom print preview page

Post by creat015 »

Hello Sir

i want to ask how to custom print preview page?

i mean, i want to put some text in header in print preview page (data_productlist.php?export=print)

i try to write some text in Table Specific >> List Page >> Page_DataRendering like this

// Page Data Rendering event
function Page_DataRendering(&$header) {
// Example:
//$header = "your header";
$header = "<center>Data Product</center>";
}

but this text appears to in data_productlist.php (text "Data Product" it appears under the search column)

i want to ONLY show/appear text "Data Product" in Print Preview Page ONLY (i mean in this url page only : (data_productlist.php?export=print))

how to sir?

thank you


mobhar
User
Posts: 11660

Post by mobhar »

Simply change your code to the following one:

if (CurrentPage()->Export == "print") {
$header = "<center>Data Product</center>";
}


creat015
User
Posts: 79

Post by creat015 »

its works sir, thank you very much

so to edit export with PDF, Excel, or Docx

put this code in Table Specific >> List Page >> Page_DataRendering

code for export in PDF :

// Page Data Rendering event
function Page_DataRendering(&$header) {
// Example:
//$header = "your header";
if (CurrentPage()->Export == "pdf") {
$header = "<center>Data Product</center>";
}
}

code for export in excel :

if (CurrentPage()->Export == "excel") {
$header = "<center>Data Product</center>";
}

code for export in word :

if (CurrentPage()->Export == "word") {
$header = "<center>Data Product</center>";
}


Post Reply