This topic is locked

Email current page as PDF

11/8/2022 7:45:09 AM
PHPRunner General questions
1NET author

I have followed the documentation on emailing a current page as PDF

https://xlinesoft.com/phprunner/docs/how_to_email_the_current_page_as_pdf.htm

Following these instructions works.

I cannot seem to make any change that would make emailing this page a lot easier.
For example.

the ClientBefore script (as shown in the documentation)

ajax.addPDF( 'pdf', {}, function() {
return ctrl.dialog( {
title: 'Email this page',
fields: [{
name: 'email',
value: '**email@address.com**'
},
{
name: 'filename',
value: 'results.pdf'
}]
});
});
return false;

The page I am wanting to email as a PDF has a field called "Email_Address"
The "Email_Address" field changes based on the report page result displaying all orders for an individual client
I am trying to reference that exact field "Email_Address" so I do not have to manually type the clients email address manually each time

I have tried

params["email"] = row.getFieldValue("Email_Address");

...
fields: [{
name: 'email',
// value: 'email.value();'
// value: 'row.getFieldValue("Email_Address")'
// value: $params["email"]
// value: $params["Email_Address"]

none which work

Im more than certain my issue is caused by my lack of understanding about directly referencing field values of a record into the ClientBefore using Javascript

Can anyone shed some light on the correct syntax I should be using?

admin 11/8/2022

You omitted the most important detail, what page is this?

1NET author 11/8/2022

I've added the custom button to a report page

admin 11/9/2022

I see what you saying. Report pages do not have any API to access underlying data, the data displayed there is gropped and aggreagated. You can have better luck with pages like List or View.

1NET author 11/10/2022

Ok we can work with that option and leave it how it is.

I have another issue that the grid borders (table,th, td, tr border 2px) even though it is set in the report and rprint pages does not reflect the same border thickness when emailed as a pdf

The PDF sent to my email account displays and prints as hairline thickenss

By accessing the print page directly from the app I can see thick borders and they print as seen on the screen.
just not in the generated pdf

1NET author 11/10/2022

img alt

img alt

1NET author 11/10/2022

i have modified the Client Before on my custom button to change the orientation to landscape

ajax.addPDF( 'pdf', {orientation: 'landscape'}, function() {

is there an operator for (th, td,tr,table border thickness) ?