In my Reactive application I'm using UltimatePDF. I'm passing a long query string to UltimatePDFs PrintToPDF action as the URL input.
I end up getting af 404 error due to the limit set på IIS.
After reading threads here at the forum it seems that people suggest either to pass the query as POST, or increase the query size inside IIS or save the query inside the database with a guid and retrieve it from the database at the receving screen.
I'm not able to use POST or the database methods due to UltimatePDF. The settings inside ServiceCenter > Factory is nowhere to be found.
Thanks for reading.
The way you have done it is probably not the ideal. For example, since you are rendering invoice details in your PDF, and assuming you have an Invoice entity in your application, why don't you just pass the InvoiceId to the screen and then fetch the invoice fields using an aggregate? In this way, you won't need to create a new entity, and you will be reusing the entity from your application.
Again, it's very similar to how you would create a detail screen. Just pass the Id of your entity to the PDF screen. For example, if the PDF is an invoice, pass it the InvoiceId. If it's a quote, pass it the QuoteId. If it's a transaction history for a bank account, pass it the AccountId and maybe the Start and End dates.
Hi Mohammad.
Instead of passing a long argument as query string, you can save the arguments on a database entity, and pass the Id of the saved record into your pdf screen. You can then fetch all the arguments back from the database in an aggregate or data action.
Hi Leonardo
Even after I retrieve the query string from the database, I will still need to pass it to UltimatePDF as an url parameter in order for UltimatePDF to create an PDF file.
UltimatePDF seems to only be able to create PDF files by taking values from a query string.
You don't pass the string in the URL, instead you pass the database identifier and in the PDF screen you can retrieve the string from the database.
It's not different to how a detail screen works. If you have an EmployeeDetail screen, it doesn't receive the employee information in the URL. It just receives the EmployeeId, and then retrieves the Employee information from the database.
Thanks for your answer.
I've tried following your suggestion in the attached file. Unfortunately it's not working. I hope you can help me out.
You're passing a parameter QueryStringDbId in the URL, but you didn't define any corresponding input parameter.
Your PdfPage should have an input parameter called QueryStringDbId. Then you can fetch the values from the database using an aggregate.
I have also noticed that your screen is not accessible by any role. You need to select at least one role, otherwise the screen will reject any access to it, including from within Ultimate PDF.
BTW you don't need the "https://" and domain. You can simplify the URL to: "/UltimatePdfLongQueryString/PdfPage?QueryStringDbId=" + QueryStringDbId
Hi Leonardo,
Thanks for your corrections, I'm able to generate the pdf file now, however I'm not sure I understand the concept correctly.
I had to change the database structure and create an entity for each parameter that I'm passing into the query. At first I was saving a long query into the database inside one entity, but this makes it impossible to retrieve specific parameter values from the aggregate. I have uploaded the complete file, can you confirm if I have understood the concept correctly.
Thanks for your suggestions and help.
Hi Mohammad Mirza,
Check out this post related to
'URL length with query string parameters' where you can find the solution
https://www.outsystems.com/forums/discussion/54206/url-length-with-query-string-parameters/
Hope that it helps you
Hi Alexandre
Thanks for your message, however there are several suggestions in the thread, A) configuring the factory configuration (I can't seem to find the settings, maybe I don't have the rights to change that setting), B) using POST instead of GET, the thread does not mention how to do that.