![]() |
ChatGPT 6/23/2025 |
Yes, you can customize the PDF filename in PHPRunner. To achieve this, you will need to use the
This code will generate a PDF with a filename that includes the username and the record ID, making each filename unique. If you need further customization or run into any issues, you might want to consult the PHPRunner documentation or reach out to their support for more specific guidance. |
![]() |
Tandy author 6/23/2025 |
Thank you ChatGPT. Sorry that is not working for me.. It still has the file.pdf when exporting it.. |
![]() |
Tandy author 6/23/2025 |
I have change the name as it says in the documents. Mine is called TripSheet but I can not figure out how to add the file stuff in that name. like username_TripSheet_tripnumber.pdf was just wondering if there is a code like %username% to put in to auto pull the informatin from the so call TripSheet itself.. Been looking through the manual and even done a search. I was wondering if it was even posible.. |
C
|
copper21 6/23/2025 |
![]() |
Tandy author 6/23/2025 |
Copper21 that is to upload to the server. I am trying to take a PDF from the server but have it as the files number. See the problem I am having. Say I have 5 different Trip Sheets. 5 different drivers. If I want a PDF each sheet they all say TripSheet.pdf on downloading them. |
![]() |
Sergey Kornilov admin 6/23/2025 |
I recommend checking PDF API where you can create PDF files and have a full control over PDF file name: |
![]() |
Tandy author 6/23/2025 |
Thanks Sergey. I was trying that as well. But still having the same problem. Trying to figure out what code to use. Here is what I have that is not right. ajax.addPDF( 'pdf', {}, function() { It gives me: Trying to find out on the manual where I can learn how I can make it say: The 64534 is the trip number for that trip sheet on the page |
C
|
cristi 6/23/2025 |
That's because you are mixing php variables with js code more precisely $record["trip_number"] is a php variable that you are using in js code. |
![]() |
Tandy author 6/23/2025 |
Thank you cristi, |
C
|
cristi 6/23/2025 |
Assuming you are using a custom button inserted in grid you use it like this in "client before": var filename=row.getFieldText("trip_number"); //asuming your field of interest is called trip_number. |
![]() |
Tandy author 6/23/2025 |
Thank you very much on trying but that code there came as an error as well: TypeError: row is null |
![]() |
Tandy author 6/25/2025 |
Thanks Guys for trying to help. I have tried all different kinds of way.. Tried changing stock code and adding my own custom button. Nothing I have found will change the filename to a listing that is on that page (TripSheet645234.pdf. I am at the point that I do not have the knowleage or really wondering if it can or not be done. I have searched the forums as was as the manual. Just can not find anything that will do it. Thanks again all.. |
C
|
Chris Whitehead 6/26/2025 |
Are you clicking the PDF view button on the print page rather than a custom button? This is where I mean in designer click the print tab and then click the pdf view button, the filename is on the right, is this the filename you want to change? If it is that button, you can rename the filename on the button. You could get the any other value and store in a proxy then pass to the javascript on load. $(document).ready(function () { This is in the before display event in the "printer friendly page" $master = $pageObject->getMasterRecord(); |
C
|
cristi 6/27/2025 |
This action of yours takes place where?? List page, View page, Custom page? |
C
|
Chris Whitehead 6/27/2025 |
Sorry, I thought I'd said, it's just the printer friendly page which prints the records on the list page but I'm guessing this works on all pages that can produce a PDF view. If Printer friendly and PDF view are enabled in the pages section within PHPRunner. On the list page there's the print button, clicking this displays the printer friendly page. You will see the PDF view button in the printer friendly page. When then PDF view button is viewed in inspector, you can see the PDF filename stored in the data attribute, all the javascript does it change this value. |
![]() |
fhumanes 6/27/2025 |
Hello everyone, I am aware that my answer does not conform 100% to the question, but I believe that a more powerful and quite simple solution is what is explained in this article: https://asprunner.com/forums/topic/31059-Create-Invoice-or-Reports-with-PDFMake The problem of the name of the file, the quality of the generated PDF document, etc., is resolved "easily" with the solution of the example. I have been reading the answers and only, for opening an alternative to consider, I have decided to write this note. Greetings, |
![]() |
Tandy author 6/28/2025 |
Thanks Guys, Still trying to figure this out but it is on hold. Some how I screwed up my coding some where and trying to fix that first to get my site back up and running. Once I get whatever I did to it figured out I will be back trying this again. |
![]() |
Tandy author 6/28/2025 |
Trying to figure this code out I have now. Has to be something I did or hit working on this. It is in my Designer part at the bottom: {"message":"Uncaught (in promise): HttpErrorResponse: {\"headers\":{\"normalizedNames\":{\"_t\":\"Map\",\"_i\":{},\"_s\":0},\"lazyUpdate\":null,\"headers\":{\"_t\":\"Map\",\"_i\":{},\"_s\":0}},\"status\":0,\"statusText\":\"Unknown Error\",\"url\":null,\"ok\":false,\"name\":\"HttpErrorResponse\",\"message\":\"Http failure response for (unknown url): 0 Unknown Error\",\"error\":{\"message\":\"Http failure response for (pd/api/buildstyle)\",\"notes\":\"The operation failed and didn't complete.\"}}","stack":"Error: Uncaught (in promise): HttpErrorResponse: {\"headers\":{\"normalizedNames\":{\"_t\":\"Map\",\"_i\":{},\"_s\":0},\"lazyUpdate\":null,\"headers\":{\"_t\":\"Map\",\"_i\":{},\"_s\":0}},\"status\":0,\"statusText\":\"Unknown Error\",\"url\":null,\"ok\":false,\"name\":\"HttpErrorResponse\",\"message\":\"Http failure response for (unknown url): 0 Unknown Error\",\"error\":{\"message\":\"Http failure response for (pd/api/buildstyle)\",\"notes\":\"The operation failed and didn't complete.\"}}\n at resolvePromise (http://localhost:8085/polyfills.bundle.js:7313:25)\n at Anonymous function (http://localhost:8085/polyfills.bundle.js:7223:17)\n at Anonymous function (http://localhost:8085/polyfills.bundle.js:7239:17)\n at ZoneDelegate.prototype.invoke (http://localhost:8085/polyfills.bundle.js:6872:13'>http://localhost:8085/polyfills.bundle.js:6872:13)\n at onInvoke (http://localhost:8085/vendor.bundle.js:57777:17)\n at ZoneDelegate.prototype.invoke (http://localhost:8085/polyfills.bundle.js:6872:13'>http://localhost:8085/polyfills.bundle.js:6872:13)\n at Zone.prototype.run (http://localhost:8085/polyfills.bundle.js:6632:17)\n at Anonymous function (http://localhost:8085/polyfills.bundle.js:7371:17)\n at ZoneDelegate.prototype.invokeTask (http://localhost:8085/polyfills.bundle.js:6904:13'>http://localhost:8085/polyfills.bundle.js:6904:13)\n at onInvokeTask (http://localhost:8085/vendor.bundle.js:57768:17)\n at ZoneDelegate.prototype.invokeTask (http://localhost:8085/polyfills.bundle.js:6904:13'>http://localhost:8085/polyfills.bundle.js:6904:13)\n at Zone.prototype.runTask (http://localhost:8085/polyfills.bundle.js:6677:21)\n at drainMicroTaskQueue (http://localhost:8085/polyfills.bundle.js:7083:25)\n at ZoneTask.invokeTask (http://localhost:8085/polyfills.bundle.js:6984:21)\n at invokeTask (http://localhost:8085/polyfills.bundle.js:8226:9)\n at globalZoneAwareCallback (http://localhost:8085/polyfills.bundle.js:8252:17)"} |
C
|
Chris Whitehead 6/28/2025 |
That looks like something gone wrong in the built in server. I know code in the style section can affect that sometimes but other than that, I can't help with that. |
![]() |
Tandy author 6/28/2025 |
Yea, I re-installed the program. Think something is going on with my PC to do that. Don't think it had anything to do with PHPRunner at all.. Just had to re-install it. Then re-upload my last saved file.. That error went away. Now trying to fix different parts that got messed up or not on my last save.. Thank You.. |