Indenting Lists

Here's an interesting problem that hit my inbox this morning that had me scratching my head for a while. I need to create the following output:















Employee: Ted Higgins
Jon Swanson
Ivor Problem
Helen Back

easy  I hear you say, but heres the catch - no tables allowed!

Ahhh ... you have me ... well at least for a while. BIP has a little know feature that allows you to show data inline, 'for-each@inlines:XXXXX', the user guide goes some way to explain, the best way to find out whats going on is to experiment. Just using the @inlines command I got


Employee:  Ted Higgins Jon Swanson Ivor Problem || 
Helen Back


Assuming the || is the edge of the page. Using:

Employee: <?for-each@inlines:G_EMP?><?NAME?><?end for-each?>

So the next step was to start looking at MSWords indenting capabilities and just how far BIP goes in supporting them :o) So I highlighted the whole line above, right click -> paragraph and on the resulting dialog selected a hanging indent, set it it to 1in to get things sitting under the word Employee correctly. But after generating the output I was left with:


Employee:  Ted Higgins Jon Swanson Ivor Problem || 
               Helen Back


Almost there but no cigar! I needed to have a carriage return after each name. After a little fiddling and googling ... for 'xslfo inserting new line characters' ... which yielded very little .. I tried adding an fo:block after each name et voila it worked. Not very scientific maybe but thats how things are discovered much of the time. Now I have the list as I wanted ... Im sure there are other ways to acheive the same result and if you find them please share. Sample files here ... 


 

Comments:

Hi Santosh

Sorry the formatting did not come out on your comment ... can you elaborate ?

Tim

Posted by Tim Dexter on March 06, 2007 at 01:24 AM MST #

Hi Santhosh

Sorry, Im being stupid here. You originally said:

I have a requirement where I need to print employee two times in one line. Like below

Ted Higgins Jan Swanson Ivor Problem Helen Black .... ....

But they only appear once in your example, do you need:

Ted Higgins Jan Swanson Ivor Problem Helen Black Ted Higgins Jan Swanson Ivor Problem Helen Black
or
Ted Higgins Ted Higgins Jan Swanson Jan Swanson Ivor Problem Ivor Problem Helen Black Helen Black ?

or have I missed the point completely ?


 

Posted by Tim Dexter on March 06, 2007 at 02:13 AM MST #

I have a requirement where I need to print employee two times in one line. Like below Ted Higgins Jan Swanson Ivor Problem Helen Black .... .... How is this possible? I cant break the page into columns because this is only for one section of the report. Thanks

Posted by santosh on March 06, 2007 at 03:04 AM MST #

like below [code] Ted Higgins Jan Swanson Ivor Problem Helen Black .... .... [/code]

Posted by santosh on March 06, 2007 at 03:28 AM MST #

How would you take this and then only grab the names for say, the 'Shipping' department? I am going off of the xml in the zip file I downloaded from the link above. Would you use something like the code below, or is there some other way to handle something like this using the inlines function? <?if:DEPT='Shipping'?> {current code from example above} <?end if?> Thanks, Andy Waldrop andy.waldrop@kniferiver.com

Posted by Andy Waldrop on September 22, 2009 at 07:56 AM MDT #

Andy Rather than use an if statement you can use an XPATH expression which is more efficient The part in the square braces is telling the rendering engine to go up a couple of levels in the tree (../../) and then check that the current DEPT='Shipping'. cheers tim

Posted by Tim on September 22, 2009 at 08:03 AM MDT #

You made some good points there. I did a search on the topic and found most people will agree with your blog.

Posted by Philadelphia SEO on February 04, 2010 at 03:37 PM MST #

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