06 Oct 09 How to: Handle Fixed Row With Text Wrapping in BI Desktop Publisher

After seeing Tim Dixter post about fixed line and row filler I decided to post about the handling string wrapping in the template.

Here is the invoice template screens hot,

invoice print

Ok let me start explaining how I handle the string wrapping. Before that let me let me tell you the requirement.

1. Need to display fixed lines.

2. If there is only few lines and the page is not filled then we need to print blank lines to fill the page.

3. At the end of the report we need to display the summary as shown above.

4. At the end of the rows including the rows with values and blank rows we need to print a line to end the box.

To handle the string wrapping I had taken the number of characters that will fit into item description field (this is expected to wrap), in my example 24 characters will fit in a single line. So I took length(item_description) mod 24 which will give me no. of rows that item description will take. This I do it for all invoice rows.

And again as per my example 36 lines will fit into one page (including the summary).

Now let me give you the pseudocode of my logic.

START

Loop

1. Print the invoice row.

2. Keep the count of number of lines each invoice row is taking. ex: v_rowcount = v_rowcount + length(ITEM_DESCRIPTION) MOD 24 (this is the text wrapping handler)

IF v_rowcount >= 36 THEN

i) Prinit the line to close the box.

ii) Reset v_rowcount to zero.

END IF;

END LOOP

3. Take the balance rows available to print empty lines (ex v_balance_line = v_rowcount – 36)

4. Now I will have to cases. First is there may not be sufficient lines available to print the summary. In this case we need to display empty lines and then print at the end of next page. So,

IF v_balance_lines < 7 (this the number of lines required to print summary) THEN

i) Print blank lines for remaining lines to find the number of blank rows to be printed use the variable v_rowcount. so here the no of blank lines will be 36 – (v_rowcount)

ii) Print the line to close the box.

iii) enable a flag to say we need to print empty rows in the 29 empty rows in the next page. So that the summary comes at the end.

ELSE IF v_balance_lines > 7 THEN

i) print blank lines by making sure you leave 7 lines to print summary. to find the number of blank rows to be printed use the variable v_rowcount. so here the no of blank lines will be 36 – (v_rowcount+ 7)

ii) Print the line to close the box.

iii) Print the summary

END IF;

5. Check whether the flag is enables to print 29 blank lines. If yes,

i) Print 29 blank lines.

ii) Print the line to close the box.

iii) Print the summary

END

Thats all. If you closely watch the above pseudocode you will get the logic of handling text wrapping.

I know as usual I had not formatted this post well :) But for your convenience I had attached the sample rtf file also. If you need the exact RTF then do leave your comment and I will try to attach that also here.

Attached Files:

Related Posts

  1. Useful Sysadmin SQL statements
  2. Check Amount not printing the Units and Subunits
  3. How-To: Develope Facebook Application for Begineers
  4. Manage Your Clients, Projects, Invoices And Estimates using Ronin
  5. How-To: Shuffle game using C++

About the Author

AK Lakshmanan AK Lakshmanan

Lakshmanan Ashok Kumar is an oracle EBS technical enthusiastic. He has hands full of experience on Oracle forms, reports, and BI Desktop Publisher. Otherwise Lakshmanan Ashok Kumar is also a Techno Functional person in Order 2 Cash and Manufacturing modules. We are glad to have Lakshmanan's thoughts and views of various oracle EBS stand and hope you enjoy his posts.



Tags: , , ,

  • Raj
    Xcellent solution.
    But I have a typical problem in excel output. The problem here is I want to wrap a CELL in a table rather than a ROW. By default when I see the output in excel, it is wrapped, but I want to wrap the CELL character at a specific length. I want to evaluate how this row wrapping solution will work for a cell wrap. I will send you a sample template and xml file to discuss after I hear from you. This is a bit urgent. Please help me.
  • AKlakshmanan
    Raj,

    Thanks for your feedback. Regarding your question on excel cell wrap, As far I know text wrap in excel is part of excel functionality and I do not have any solution at this point. But I will try to find one and if you find anything please share it with us.

    Thanks
    AK Lakshmanan
  • Jacob
    Great solution. Can you please post a sample data also to view the out of this template
  • AKlakshmanan
    Jacob, please check in my blog
  • meib
    Hi...I have seen the RTF template you have designed and it is interesting...

    Could you please provide me the XML file that can be used with the RTF you have attached.

    Thanks in advance..
  • AKlakshmanan
    meib, you can check the rtf and xml in my blog.
  • AKlakshmanan
    I had uploaded the sample RTF template and XML file here http://flexfields.blogspot.com/2009/10/how-to-h...
blog comments powered by Disqus
msgbartop
© oOrch Blog / Design: alman and Ericulous
msgbarbottom