Pad Your Reports

Im not talking about filling your reports with fluff. I can remember, mistakenly filling my high school essays with fluff and padding. Why use 5 words when 10 can say it more eloquently and fill the word count more quickly. Sadly, there was no pulling the wool over my teacher's eyes - just had to learn more facts!

I have just been helping out on a demo for a customer proof of concept. They wanted the following report output.

Padding1.jpg

Nothing fancy there on the surface, building the report is straightforward enough. We can get this output very quickly.

Padding2.jpg

But have you noticed in the original, there is some space after each set of categories.

We can achieve this by manipulating the 'padding' in the first cell of the row to effectively increase the height of the whole row. This increases the space between the last row of the group and the beginning of the next.

Just insert the following in a form field in the first cell:

<?if:LAST='Y'?>
<?attribute@incontext:padding-bottom;'10.0pt'?>
<?end if?>

The LAST element was in the XML to define whether the current member of a group is the last. You could equally use a position() based if statement, you just need to have some means of identifying the last member of a give grouping. The next line just manipulates the 'padding-bottom' attribute - here we are making it 10pts. This effectively provides us the row height we need to provide the spacing between the rows we need. There are of course other padding attributes:

  • padding-top
  • padding-bottom
  • padding-start
  • padding-end

XSL uses 'end' and 'start' rather than 'right' and 'left' for internationalization purposes. With the extra conditional field we can now generate the required output.

Padding3.jpg

this post kinda begs the question, 'how the heck do you know what you can manipulate?' Well there is the XSL-FO spec available, if you want to wade through it. Personally, I dont very often. My best friend is the Template Builder for Word -> Tools > Export > XSL-FO Stylesheet. this will dump your current RTF template into the browser. There you can check out whats going on in the template. Its not that tough - it's bit like complex HTML, there are tables, rows, cells, etc and each have attributes that you can override to your hearts content. Yes, you have to write some code at the moment, but the extra power in the formatting is worth it I think. I have not touched Oracle Reports (in anger) in a while but I can not think how I would achieve the layout above, not off the top of my head anyway. So get padding!

Comments:

Tim, I'm using word 2007 and the XSL-FO that the add in generates doesn't seem to work using this solution. The code which is generated had the attribute set a cell level which I guess overrides the if statement earlier in the XSL Any Tips? Thanks

Posted by Alan Telford on April 11, 2010 at 10:30 PM MDT #

Tim, I am having the same problem as Alan above. The statement: does not execute in my RTF file. I am using Word 2007 as well. Is there an alternative? The problem I am facing is this: I have created a small template called: insertEmptyLines within my RTF file. The param to this is the number of lines to insert. This should work like a subroutine to insert as many empty lines as specified. An empty line in my case is not a blank line but a row with vertical bars spaced out (as per the columns of a form). It shows like this: ! ! ! ! ! ! ! ! This empty line when printed must align with the columns of the filled area. The above template does print the empty lines as expected. They are shifted a few points (an mm or so) to the right. It seems like whenever a text is printed via a called template, it is shifted a bit to the right. I tried to pad on the left side using your statement above but it did not work. Would you know of any solution to this? Thanks.

Posted by Alpesh Shah on August 25, 2010 at 12:08 AM MDT #

In my description above, I typed to show my empty line as a bunch of vertical bars spaced out. However those vertical bars got all grouped together after my message was sent. So please read it so.

Posted by Alpesh Shah on August 25, 2010 at 12:13 AM MDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today