Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

substitution strings in select-statemtens

Christian RopposchOct 9 2008 — edited Oct 9 2008
ahoj!

is it possible to use a substitution string in a select-statement as db-link? if yes, how? for example:
application definition -> substitution string: DB_WORK, substitution value: pwork_pwork
how can i use the substitution string DB_WORK in a select-statement?

select * from test@DB_WORK should result in select * from test@pwork_pwork, but this doesn't work. v('DB_WORK'), &DB_WORK. and :DB_WORK is also not possible. (error message: Query cannot be parsed within the Builder...)

background: i have a test- and production-application. in the test-app i use pwork_pwork as db-link, the production-app should use work_work. the apex-database is for both environments the same.

thx!

bye,
christian

Comments

Forms has nothing to do with Reports. Your question should actually be:
"How to print directly from Oracle Reports to the default printer"
All Forms does with regard to Reports is to tell Reports to run a job. What Reports does with that job is a function of Reports and not Forms. Think of it as "fire and forget it". Forms says; " Reports, please run this report...". It is then up to Reports to decide what to do with the result based on how Reports is configured.
That said, there really is no supported way to send a job directly to an individual's default printer because the output of the job is created on the server. You must first bring the output to the user's machine before it can be printed. Once on the local machine it is easy to print it.
Using WebUtil for the task is fairly simple. Just run the report (i.e. RUN_REPORT_OBJECT) then when the output has been created, use WebUtil to download the output file to the local machine. Once on the local machine use WebUtil to open it or send it directly to the printer. If desired, the file can be deleted when finish or whenever you prefer.

Iker Garcia Martin

Hi Michel,
Just run the report then when the output has been created on server.
I use the command webutil_file_transfer.as_to_client('c:/prueba/stockprueba.pdf','/tmp/stockprep.pdf') to download the file to the local machine. Once on the local machine, how send directly to the printer wit webutil?
To delete the file, i use webutil_file.delete_file('c:/prueba/stockprueba.pdf');
Thanks,
Iker

You need to either contact Adobe to determine exactly what command line switches they expose for Acrobat, but as far as I know the following should work on Windows:
"C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" /t "C:\filetoprint.pdf"
So here is an example of how you might do it in Forms code:

WEBUTIL_HOST.NONBLOCKING ('"C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" /t "C:\myfiletoprint.pdf"');

It is possible that this will result in Acrobat remaining open. This may not be avoidable using this method. There are third party utilities that can be used to directly print and not orphan the executable. Do some Googling ;-)
Again, for help printing PDF files you should contact Adobe. Note there may be some licensing issues associated with attempting to directly print PDF files. I seem to recall that the EULA for Acrobat used to not permit doing this with Acrobat Reader.

1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 6 2008
Added on Oct 9 2008
12 comments
512 views