![]() |
Sergey Kornilov 12/12/2024 |
A few things are possible here. Let me explain a few options.
|
E
|
ecornwell author 12/12/2024 |
Thanks Sergey. I'm using the PDFForms template to acomplish this. What wasn't clear was if I had to try and combine the the rows or if the PDFForms template would accomidate multiple rows. One of our requirements is to use the PDF provided to us. That's why we're using the PDFForms template. Any thoughts on creating a page for the filter to just output results from one PDF? |
![]() |
Sergey Kornilov 12/13/2024 |
I have checked PDFForms template API one more time and it appears that it works with a single data record only. So, basically you have two options here.
|
E
|
ecornwell author 12/16/2024 |
Thanks! I think I'm going to work on getting the SQL to return a single row with all the required data. Any thoughts on the specific page? So far it looks like I can create my own welcome page. I'd just have to figure out how to add an input box and pass it to the SQL. |
![]() |
Sergey Kornilov 12/16/2024 |
I guess creating your own page for this purpose is the best option. Maybe you can get away with using one of the Add pages for this purpose. Create a new dummy table with a single field in it. After the login redirect user to that Add page and make them enter that value. In BeforeAdd event save that value in the session variable and use it on all pages. |
E
|
ecornwell author 12/17/2024 |
I think I'm slowly getting there. I was looking at the extensiblity section and I think I want to try and use the showFormInBrowser() function triggered by a button. Where can I find the defintion of that function? I need to figure out how to amend the query to use the filter that I'll be defining with an input field. |
![]() |
Sergey Kornilov 12/17/2024 |
You can find this function description at https://xlinesoft.com/pdfforms The SQL query and fiter are irrevevant here as all you need to do is to pass the value of the key column there which points to the desired record. |
E
|
ecornwell author 12/17/2024 |
E
|
ecornwell author 12/17/2024 |
The SQL query and fiter are irrevevant here as all you need to do is to pass the value of the key column there which points to the desired record. I'm not sure what you mean by this... It is the array("id" => "1") section of the function? if my view has a column say, "orderid", I can pass it something like "array("orderid" -> TextBoxValue)" and it will pick the the right row? |
E
|
ecornwell author 12/17/2024 |
Thank you for all the help! I think I'm close. I have my page, the input box, and a custom button that is trying to execute the showFormInBrowser() function. I'm running into a stacktrace error however now: [17-Dec-2024 15:08:38 America/New_York] PHP Fatal error: Uncaught Error: Call to a member function fetchAssoc() on bool in C:\Projects\pdftest\output\include\pdfform_functions.php:111 Here is the code int he server section of the button: $filename = "file_" + $params["phid"] + ".pdf"; Thoughts? Edit: I think I figured it out. The code looks like it searches for "where" and does a substring then appends. My query is quite long, complex, and contains "where" 12 times in the query before even getting to the end. Looks like I need to make a couple changes there to support this better. Edit2: Yes, that did it. I ended up putting my query in a view and then called the view and was able to get farther. I've got one more question. $res = showFormInBrowser($formname, $keys, $pathfile) How do I pass the "$res" object back from the server tri-part? I created a DIV section I could try to display it in but I'm fine with it opening another window was well. |
![]() |
Sergey Kornilov 12/17/2024 |
I think you need to make sure that $params["phid"] variable is populated and in fact points to one of the records in the database table. |
E
|
ecornwell author 12/17/2024 |
Thanks Sergey, I was able to get the response back but now it's throwing an error that looks like it's the contents of the PDF. Using the "showFormInBrowser" function in the Server Tri-Part, how do I pass it back to view on the screen? My guess is I have to do something in the "client after" section but I'm at a loss right now. |
![]() |
Sergey Kornilov 12/17/2024 |
You need to read this function description one more time at https://xlinesoft.com/pdfforms. It explains where you can use this function, which event is suitable for it. |
E
|
ecornwell author 12/18/2024 |
I read it multiple times before posting. It seemed to indicate those were some options but not the only way to do it. I'm just about done now but I eneded up having to use the "saveFormToDisk" function instead. This means I'll have to do something on the server to clean up old files but I can write a script easy enough for that. With that in mind, I think I found a bug in the pdfform_functions.php file. What's the best way to report it? Here's the DB String for saveFormToDisk: DB::Select("pdf_forms", array("formname"=>str_replace("'","\'",$formname)."'")) Here's the showFormInBrowser: DB::Select("pdf_forms",array("formname"=>$formname)) I couldn't get the Save to work and it was because there was always and extra ' added to the end. |
E
|
ecornwell author 12/19/2024 |
I got it to work! For future reference, for those interested, here is what I did.
II. Server: $filename = "aaaa_" . $params["aaaa"] . ".pdf"; III. Client After: ajax.removeMessage(); 3c. Text Object <object class="pdf" width="100%" height="1000px" id="pdfdisp"></object>
The result: When you get to the page. |