Html2ToPdfConverter don't generate pdf of a list record

I'm in outsystems 11, and i've a custom sql, this one has as text parameter, in my sql is an IN clause:


This sql generate a report, if I send it via Html work fine, but I send it using "CreatePDF", oracle error is generated: "ORA-00936: missing expression", Seleccionados parameter recive a session variable, example: 1,24,15

My question is: HTMLtoPdfConverter doesn't work with list record o custom sql?



This doesn't seem to be a Html2PdfConverter-specific issue.


  1. How are you constructing the @Seleccionados parameter?
    Is it always a list of numbers?

  2. Is the "Expand Inline" option set to "Yes" for this parameter?

  3. Have you tried using the Test Query button to confirm whether the Advanced Query is OK?

  4. If you use Test Query with an empty input for @Seleccionados, what happens?
    Do you get the ORA-00936 error?


My suspicion is that the @Seleccionados parameter is empty and this is causing your error.

I would suggest you try to debug the Preparation and confirm whether the Input Parameter is correct, and then use the Test Query feature with this input value.


If this is OK, maybe you're missing a comma in your SELECT COL1, COL2, COL3 statement?

The ORA-00936 error is caused by incorrect SQL syntax somewhere in your Query. Can you check the final SQL query in the "Executed SQL" tab?

Gonçalo Soares wrote:

This doesn't seem to be a Html2PdfConverter-specific issue.


  1. How are you constructing the @Seleccionados parameter?
    Is it always a list of numbers?

  2. Is the "Expand Inline" option set to "Yes" for this parameter?

  3. Have you tried using the Test Query button to confirm whether the Advanced Query is OK?

  4. If you use Test Query with an empty input for @Seleccionados, what happens?
    Do you get the ORA-00936 error?


My suspicion is that the @Seleccionados parameter is empty and this is causing your error.

I would suggest you try to debug the Preparation and confirm whether the Input Parameter is correct, and then use the Test Query feature with this input value.


If this is OK, maybe you're missing a comma in your SELECT COL1, COL2, COL3 statement?

The ORA-00936 error is caused by incorrect SQL syntax somewhere in your Query. Can you check the final SQL query in the "Executed SQL" tab?

Hi!


I debug my sql and the @seleccionados parameter has a list of numbers, it is always a list, my parameter is expand inline and test query button works fine


send images to explain

If the Test Query feature shows the correct result, and the Debugger shows all inputs are correct, then the only remaining possibility is some sort of issue with the SQL compiler, which is causing your final SQL query to be read incorrectly by the platform.


The "most famous" one of these issues is the Single-Line Comment bug:


Ana, can you share your full query?


If you have single-line comments, can you remove them, or switch them to multi-line comments, and try again?

Gonçalo Soares wrote:

If the Test Query feature shows the correct result, and the Debugger shows all inputs are correct, then the only remaining possibility is some sort of issue with the SQL compiler, which is causing your final SQL query to be read incorrectly by the platform.


The "most famous" one of these issues is the Single-Line Comment bug:


Ana, can you share your full query?


If you have single-line comments, can you remove them, or switch them to multi-line comments, and try again?

Hi again


Share my sql, but i don't have "line comments", if I send the sql via an server action and this send  a web screen, works without problems, the problem is only with GeneratePDF Action

Thanks



Solution

From what I understand of your picture, you are:

  1. Saving the Seleccionados variable in a Session Variable (your Assign node)
  2. Making a request to another Webscreen (DeclaranetBackoffice) via HTTP Request (your MakeAbsoluteURL(..) call)
  3. Reading the Session Variable in the Preparation of your other Webscreen, and passing it as a parameter to your Advanced Query.


Unfortunately, this won't work, because your session won't be transferred via the HTTP Request.

Instead, when the Preparation is called, no login information will be received, and the Session.IdSeleccionados variable will always be empty.


The correct way for you to do this is to:

  1. Save the IdSeleccionados in a temporary table/ entity in your database, 
  2. Pass the Record Identifier as a URL parameter to Generate_PDF_Ficha.
  3. Add an Input Parameter to your DeclaranetBackoffice WebScreen, with the same name used for (ii)
  4. In your DeclaranetBackoffice Preparation, use a GetRecord or Aggregate to read the Record Identifier, and pass the Input from the temporary table to your Advanced Query.


Solution

Gonçalo Soares wrote:

From what I understand of your picture, you are:

  1. Saving the Seleccionados variable in a Session Variable (your Assign node)
  2. Making a request to another Webscreen (DeclaranetBackoffice) via HTTP Request (your MakeAbsoluteURL(..) call)
  3. Reading the Session Variable in the Preparation of your other Webscreen, and passing it as a parameter to your Advanced Query.


Unfortunately, this won't work, because your session won't be transferred via the HTTP Request.

Instead, when the Preparation is called, no login information will be received, and the Session.IdSeleccionados variable will always be empty.


The correct way for you to do this is to:

  1. Save the IdSeleccionados in a temporary table/ entity in your database, 
  2. Pass the Record Identifier as a URL parameter to Generate_PDF_Ficha.
  3. Add an Input Parameter to your DeclaranetBackoffice WebScreen, with the same name used for (ii)
  4. In your DeclaranetBackoffice Preparation, use a GetRecord or Aggregate to read the Record Identifier, and pass the Input from the temporary table to your Advanced Query.


Hi Gonçalo

I'm going to follow your steps, and I let you now my results


Thanks for your help and your time


Ana Karina Garcia Rojas wrote:

Gonçalo Soares wrote:

From what I understand of your picture, you are:

  1. Saving the Seleccionados variable in a Session Variable (your Assign node)
  2. Making a request to another Webscreen (DeclaranetBackoffice) via HTTP Request (your MakeAbsoluteURL(..) call)
  3. Reading the Session Variable in the Preparation of your other Webscreen, and passing it as a parameter to your Advanced Query.


Unfortunately, this won't work, because your session won't be transferred via the HTTP Request.

Instead, when the Preparation is called, no login information will be received, and the Session.IdSeleccionados variable will always be empty.


The correct way for you to do this is to:

  1. Save the IdSeleccionados in a temporary table/ entity in your database, 
  2. Pass the Record Identifier as a URL parameter to Generate_PDF_Ficha.
  3. Add an Input Parameter to your DeclaranetBackoffice WebScreen, with the same name used for (ii)
  4. In your DeclaranetBackoffice Preparation, use a GetRecord or Aggregate to read the Record Identifier, and pass the Input from the temporary table to your Advanced Query.


Hi Gonçalo

I'm going to follow your steps, and I let you now my results


Thanks for your help and your time


Hi, finally work, thanks for you help!!