Skip to main content



      Home
Home » Archived » BIRT » How to indent first column of row in a table?
How to indent first column of row in a table? [message #208452] Fri, 29 December 2006 09:55 Go to next message
Eclipse UserFriend
Originally posted by: joboe.gmx.de

Hello,

I want to display a Tree structure in a report using a table:

I have a data set linked to a table and the table shows me each row in the
dataset. One column in my dataset contains a value specifying the level of
each row (depth). Now I want to express the level of a row by indenting the
first column of the table.
So if dataSetRow["depth"] is 1 I want to indent the text of the first column
by three spaces. I depth is set to 2 I want to indent the text by six
spaces, ...

I tried to achieve this by a computed column in my data set which I could
prepend to the actual value I want to display, but I didn't find a
Javascript function which can compute the indention in one step.

I need something like: = getEmptyStringWithLength(row["depth"] * 3) for the
computation of the indention. Can I definde own JavaScript functions which I
can call from value expressions?

Or is there another approach I can use? Using Padding would also be
sufficient, but I can't define the padding in a script. Or can I use an
event handler to accomplish it?

Any pointers to the right direction would be greatly appreciated!

Regards
Jochen
Re: How to indent first column of row in a table? [message #208613 is a reply to message #208452] Tue, 02 January 2007 04:25 Go to previous message
Eclipse UserFriend
Originally posted by: joboe.gmx.de

> Or is there another approach I can use? Using Padding would also be
> sufficient, but I can't define the padding in a script. Or can I use an
> event handler to accomplish it?
>
> Any pointers to the right direction would be greatly appreciated!

Now I have a solution which works for me. I added an onRender Script to my
Data element containing the row's value:

indent = row["depth"] * 10;
this.getStyle().paddingLeft = indent + "px";
Previous Topic:ClassNotFound exceptions in Eclipse with Birth 2.2
Next Topic:Conversion of special characters
Goto Forum:
  


Current Time: Tue Jul 22 07:45:18 EDT 2025

Powered by FUDForum. Page generated in 0.08855 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top