The (hi)story
In my posting RTF Documents in an Oracle Database I showed how to go about
- Creating RTF templates with substitution variables
- Generating RTF documents with substitution variables filled in run-time
- Data model and code to support the functionality in Oracle Apex
Too simple!
Well, the first version of the code I showcased was a bit on the simple side, but it was just meant to give a hint of the possibilities. Anyway, I challenged myself to make a more complex RTF-component, so I set about wasting my time on coding a PL/SQL package that can return a RTF-table based on a query. With heavy use of dbms_sql the code can:
- Describe and store query columns
This is used when defining the substitution variable. The columns are stored as rows in a table and have attributes such as title, text alignment, width. - Running the query and return a RTF-table
This is just a more advanced version of the simple substitution variables, but in stead of returning one column, one row as plain text, it now returns a RTF-table (but still as text).
Sample Application
I have updated the sample application to show the function. I have included some images here to explain some of the elements. First a screen shot of the listing of all substitution variables in the uploaded template:
And a screen shot of the substitution variable attributes:
You can test it in my sample application, you can also download all necessary sample code there.
Now I soon leave for my summer holiday, five (!) weeks of leisure with my family :-)
Hi! the sample code in your sample application doesn't include the RTF-Table enhancements you made, does it?
ReplyDeleteMonkey On Oracle: Dynamic Rtf Documents Revisited >>>>> Download Now
Delete>>>>> Download Full
Monkey On Oracle: Dynamic Rtf Documents Revisited >>>>> Download LINK
>>>>> Download Now
Monkey On Oracle: Dynamic Rtf Documents Revisited >>>>> Download Full
>>>>> Download LINK sq
@Paul:
ReplyDeleteErr... Yes, it does! After I corrected the link, of course ;-) A bit of vacation mode there...
Thank you for the heads up!
This comment has been removed by the author.
ReplyDeleteHello, I have successfully tested your application for RTF Templates. However, when I click on the link "Download the simple data model and package here" I get "Access denied." Could you please tell me why is that? I've logged in as welcome.
ReplyDeleteThanx!
@Jelena
ReplyDeleteThank you, fixed the link. I hope you find it useful :-)
Note to self: Test your code when not logged in as a developer!
Hi and thank you, when I want to edit substitution variable, it doesnt work.
ReplyDeleteErroColumn SHOW_TABLE_HEADER not found in table RTF_SUBST_SQL
Thank you in advance.
Can you explain how button gettemplate exactly works? You wrote "GetTemplate is url-redirect to: #OWNER#.rtf_p.get_rtf?p_rtf_template_id=&P3_RTF_TEMPLATE_ID.&p_only_template=N" but it dosnt work... Can you help ?
ReplyDeleteThanks for the inspiration.... I have used your code as the basis for my requirement, but slightly enhanced it. I've written a blog about this (given you credit) see rchallis.blogspot.co.uk, also the updated code has been put up on apex.com here http://apex.oracle.com/pls/apex/f?p=16542:LOGIN
ReplyDeleteOnce again, thanks for the inspiration and the sharing. Hopefully someone will find the additions of interest and share back.
@Richard
ReplyDeleteGreat work! I have notified the owner of the Alexandria PL/SQL Utility Library of your posts/code :-)
Excellent package. Very useful. Thanks a lot.
ReplyDeleteMonkey On Oracle: Dynamic Rtf Documents Revisited >>>>> Download Now
ReplyDelete>>>>> Download Full
Monkey On Oracle: Dynamic Rtf Documents Revisited >>>>> Download LINK
>>>>> Download Now
Monkey On Oracle: Dynamic Rtf Documents Revisited >>>>> Download Full
>>>>> Download LINK 0m