Home » Developer & Programmer » Forms » Forms to write pdf directly to database (Oracle Forms, 10.1.2.3.0, Linux)
Forms to write pdf directly to database [message #426564] Fri, 16 October 2009 11:51 Go to next message
dlwixon
Messages: 92
Registered: September 2008
Member
Does anyone know of a way to make forms create and write a pdf directly to the database?

I would like to avoid writing a file to the server and then uploading it to the database.

My goal is to have no scripts or utilities running in the background. So the user would fill in the fields on the form with the data that needs to be displayed in the pdf file. Then forms would create the pdf and commit it to the database without first writing it to the server.

Is it even possible?

Thanks
Re: Forms to write pdf directly to database [message #426581 is a reply to message #426564] Fri, 16 October 2009 14:02 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
Don`t think it`s possible to write PDF directly in the database. I am not even sure if it`s possible to generate PDF file from forms on the file system. I know reports can do this but not forms.

You can easily put your data in a CLOB directly in the DB without creating a file first, but this will give a clob that you can open the result with notepad.

Why do you need to generate a PDF file? Are you thinking about putting some layout in your PDF or if it`s only to show the data entered in the screen.
Re: Forms to write pdf directly to database [message #426585 is a reply to message #426581] Fri, 16 October 2009 14:23 Go to previous messageGo to next message
dlwixon
Messages: 92
Registered: September 2008
Member
Oracle Forms' builtin web.show_document can call reports and write them as pdf files directly to the server. If you've never used this, you should check it out.

I don't want to do this. If I do this, I'd have to have a script running to upload them to the database.

We have to store files that the user can query up and view from a website.



Re: Forms to write pdf directly to database [message #426586 is a reply to message #426564] Fri, 16 October 2009 14:27 Go to previous messageGo to next message
dlwixon
Messages: 92
Registered: September 2008
Member
Our requirements are that the file has to be a print-friendly file. So it does have to be formatted. We've been using pdf files. When we create pdf files, the layout remains the same whether the file is viewed or printed.


Re: Forms to write pdf directly to database [message #426587 is a reply to message #426564] Fri, 16 October 2009 14:27 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
I know this built in, but if you call it it`s not forms that produce the PDF but the report server.

You can produce your report output in PDF format directly on a specific directory on your oracle database.

From there you only have to call a database procedure that will execute dbms_lob.load_from_file and it will upload your pdf file in the database.
Re: Forms to write pdf directly to database [message #426589 is a reply to message #426564] Fri, 16 October 2009 14:47 Go to previous messageGo to next message
dlwixon
Messages: 92
Registered: September 2008
Member
I am not allowed to write to the database server. I can only write to the app server if needed. I'd rather not do that but it's looking like I will have to.
Re: Forms to write pdf directly to database [message #426596 is a reply to message #426564] Fri, 16 October 2009 16:02 Go to previous messageGo to next message
dlwixon
Messages: 92
Registered: September 2008
Member
I know it's the reports server that creates the file. But the form makes the report server create the file. So the form does it indirectly.

Sort of like if I shoot a cow, the gun is not responsible for shooting the cow. I would be responsible.






Re: Forms to write pdf directly to database [message #426603 is a reply to message #426564] Fri, 16 October 2009 19:48 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
If you produce your PDF on the App server directory here are some way you could try to upload your file.

1- write a procedure in Forms that will use TEXT_IO to read the file and you save it in the database
2- Use webutil library and function file_to_db to upload the file in the database.
3- If your database server services is running as a domain user instead of system maybe you can create directory on network drive to allow upload with dbms_lob.load_from_file on network drive
4- Using Java to upload the file in the database can probably work too.

Maybe there is more way to do it but those are the ideas i have right now.

Hope it can help.

Re: Forms to write pdf directly to database [message #428511 is a reply to message #426564] Wed, 28 October 2009 10:06 Go to previous message
dlwixon
Messages: 92
Registered: September 2008
Member
I have found one way to upload pdf files to the database.

The solution is found here.

However, the issue is how to save the pdf to the same record that I am commiting my form data to.

I don't want to have to commit the form data, write the pdf to the file system, upload the pdf to a temp table, update the record where the form data resides with the pdf in the temp table.

What I want is to commit the forms data and the pdf to the oracle table all at once.

Still searching.

[Updated on: Wed, 28 October 2009 10:06]

Report message to a moderator

Previous Topic: running reports from forms in oracle 10g
Next Topic: Oracle forms test automating
Goto Forum:
  


Current Time: Sat Oct 01 07:39:48 CDT 2016

Total time taken to generate the page: 0.15880 seconds