This topic is locked
[SOLVED]

 How to email the current page as PDF

4/1/2020 11:46:30 AM
PHPRunner General questions
C
charlesfolder author

Hi, everyone can some one help me here

What wrong with this code , phprunner 10.4
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;
I get an error "undefined" In custome button "ClientBefore"

Thank in advance.

Sergey Kornilov admin 4/1/2020

The same answer as before.
Troubleshooting Javascript errors starts here:

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

J
jacques 4/3/2020



The same answer as before.
Troubleshooting Javascript errors starts here:

https://xlinesoft.co...ript_errors.htm


hi everybody,
I had the same problem for some time.

today I found an old article reguarding map files.
My solution:
use www.example.com instead of example.com

lefty 4/4/2020



hi everybody,
I had the same problem for some time.

today I found an old article reguarding map files.
My solution:
use www.example.com instead of example.com


Jacques, Can you reiterate what your answer here has to do with the dialog API and the question above? I guess I am missing something as I have the same issue as charlesfoler's question. with absolutely no error's in javascript buttonhandler.

Seems we are supposed to guess what is wrong with the sample documentation as it flat out does not work. The sample itself should work "as is" it since we are just changing the values in the dialog popup. there is nothing to debug as the button does nothing. I get javascript void(0) with no errors. I click on button - nothing. response shows - status 200 green. okay.

J
jacques 4/5/2020



Jacques, Can you reiterate what your answer here has to do with the dialog API and the question above? I guess I am missing something as I have the same issue as charlesfoler's question. with absolutely no error's in javascript buttonhandler.

Seems we are supposed to guess what is wrong with the sample documentation as it flat out does not work. The sample itself should work "as is" it since we are just changing the values in the dialog popup. there is nothing to debug as the button does nothing. I get javascript void(0) with no errors. I click on button - nothing. response shows - status 200 green. okay.


John,
My button was not working, the same way as you described.
Sometimes I got I get javascript void(0) with no errors ans sometimes I get a undefined error and sometime I get an error with pdfmake.min.js.map not found.

I don't know enough about this but it didn't let me go.

Then I came across an old article that I applied and the button suddenly worked.

Maybe it has nothing to do with each other.

i can't explain, sorry.

lefty 4/5/2020



John,
My button was not working, the same way as you described.
Sometimes I got [size="2"]I get javascript void(0) with no errors ans sometimes I get a undefined error and sometime I get an error with pdfmake.min.js.map not found.[/size]

I don't know enough about this but it didn't let me go.

Then I came across an old article that I applied and the button suddenly worked.

Maybe it has nothing to do with each other.

i can't explain, sorry.


I actually had it working in 10.3 older build , then it stopped working for some reason.I got all three errors you mentioned but nothing in debug javascript except google map error which is unrelated but the pdfmake.min.js interests me as I did get that once awhile back and I suspect that is probably where the issue is but not sure what needs to change to fix it.as it is a huge file. ! and it is part of their library.
Can you supply the link to the article?

Quote "[size="2"]Then I came across an old article that I applied and the button suddenly worked.[/size][size="2"] " to this? It would really help as I am stumped?[/size]
[size="2"]Thanks[/size]

C
charlesfolder author 4/5/2020



hi everybody,
I had the same problem for some time.

today I found an old article reguarding map files.
My solution:
use www.example.com instead of example.com


Thank You, but can you explain more about "use www.example.com instead of example.com"

I think that the problem is in this function "ajax.addPDF" the error says undefine

lefty 4/5/2020



Thank You, but can you explain more about "use www.example.com instead of example.com"

I think that the problem is in this function "ajax.addPDF" the error says undefine


charlesfolder, That is what I am trying to get also . Not sure what jacgues means by that?

lefty 4/5/2020

[quote name='John' date='05 April 2020 - 05:33 PM' timestamp='1586125992' post='90787']
It has to be a little syntax error in the doc's that I just can't get my head around!

C
charlesfolder author 4/5/2020

[quote name='John' date='05 April 2020 - 06:36 PM' timestamp='1586126204' post='90788']
John, here an simple example I try to run
ajax.addPDF( 'pdf', {}, function() {
return ctrl.dialog( {

title: 'Save results as PDF',

fields: [{

name: 'filename',

value: 'file.pdf'

}]

});

});

return false;
just a dialog to enter file name, in a botton/ClientBefore it do not work

the only error undefine

lefty 4/5/2020

[quote name='charlesfolder' date='05 April 2020 - 06:16 PM' timestamp='1586128597' post='90789']
Thanks , Read above.

It's an issue that nobody seems to want to reply with a solution. I just took it out of my projects and use a button to send a session email . It's unfortunate. but it will come out eventually. We just have to wait.

Stay safe everyone and stay home!

Sergey Kornilov admin 4/6/2020

The correct answer is provided in the very first reply.
Troubleshooting Javascript errors starts here:

https://xlinesoft.com/phprunner/docs/troubleshooting_javascript_errors.htm
You need to find the Javascript error, you need to find the exact code that throws this error and fix it. There is no other way to fix.
All other "me too" posts just distracting you from the solution.

lefty 4/7/2020



The correct answer is provided in the very first reply.
Troubleshooting Javascript errors starts here:

https://xlinesoft.co...ript_errors.htm
You need to find the Javascript error, you need to find the exact code that throws this error and fix it. There is no other way to fix.
All other "me too" posts just distracting you from the solution.


Upgraded to 10.4 and guess what! . All the Dialog API samples work fine. So if you don't want to spend hours trying to fine the JS error just upgrade to 10.4.

C
charlesfolder author 4/7/2020



Upgraded to 10.4 and guess what! . All the Dialog API samples work fine. So if you don't want to spend hours trying to fine the JS error just upgrade to 10.4.


Thank you John,

I'm already using phprunner v10.4

lefty 4/7/2020



Thank you John,

I'm already using phprunner v10.4


So, Next question is it working in 10.4? for you?

C
charlesfolder author 4/8/2020



So, Next question is it working in 10.4?

C
charlesfolder author 4/27/2020

Thank You for you help Administrator.

I knew something was wrong. The problem fixed with build 34955.

lefty 4/27/2020



Thank You for you help Administrator.

I knew something was wrong. The problem fixed with build 34955.


Yea, I know it is working now. Only problem is I am not the administrator. LOL!