Generate PDF report in background, and save to pdf

Hello…
I need to run a process that generates some reports in PDF, and saves them, without user intervention, in blob fields.
Someone solve a problem of this type?
I can’t find, in the Report, where to add the code to save the PDF, and close the window …
Thanks a lot…

Hola…
Necesito ejecutar un proceso que genere algunos reportes en PDF, y los guarde, sin intervención del usuario, en campos blob.
Alguien resolvío un problema de este tipo?
No encuentro, en el Reporte, donde agregar el código para grabar el PDF, y cerrar la ventana…
Muchas gracias…

1 Like

Hola

Tenes que elegir en Destino del pdf = Servidor para que lo guarde. No se si te referís a eso

Saludos.

Ok. Pruebo, y luego de guardado, intento grabarlo en el blob…

Here’s how to save * .pdf to a server

Yes, this code is correct…, but not save the PDF in a blob field.
I solve the problem detecting the file exsistence and save in a blob field in the Validate Event, in the form whit call to PDF Procedure.
Thanks!!

That code only generates the pdf file as put save on server. The you can save it into a blob field.

Ese código sirve para crear el pdf en disco. Después deberías guardarlo en un campo blob.
Pregunta porque no guardas en un campo varchar el nombre del archivo pdf y el pdf en una carpeta?
No suelo guardar imágenes ni archivos en la base de datos. Ya que aumentan su tamaño considerablemente y para hacer backups de la base se torna eterno.

Saludos.

In my case, is manejable…

these are two separate problems,

  1. generate pdf in a file on the disk
  2. upload file to a blob field

why would anyone use blob fields to store files? this is a bad practice.
best practice is to keep files on a disk , not in the database.

you are absolutely right about the size of the database,
but there are always two sides to the coin

if a user moves the file to another directory or even deletes it (murphies law),
then the entry in the database does not necessarily help you

So you always have to clarify which solution is the better for you

2 Likes

The user doesn’t have access to the folder. That is my solution.

Hello…
In this case, for various reasons, the PDF needs to be saved to the Blob.
Thanks!

Oh yes, that’s a very good idea to reduce the database size

lso, I think that today I am more concerned about having 10,000 100Kb files in directories than 10,000 100Kb records in a database…
Have you ever tested the access performance with that many files in a directory? Scary…