Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Indention of hierarchycal data-levels
locutuz
Hello everybody,<br />
<br />
I have a hierarchical data-structure, where the amount of hierarchy-level is dynamic, but maximum 7 levels.<br />
The hierarchy-level shall be displayed on the report with indentions, e.g.:<br />
<br />
<p class='bbc_indent' style='margin-left: 40px;'>Element 1</p>
<p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'>- Element 1.1</p></p>
<p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'>- Element 1.1.1</p></p></p>
<p class='bbc_indent' style='margin-left: 40px;'><p class='bbc_indent' style='margin-left: 40px;'>- Element 1.2</p></p>
<p class='bbc_indent' style='margin-left: 40px;'>Element 2</p>
<p class='bbc_indent' style='margin-left: 40px;'>...</p>
<br />
The first thing I thought about was nesting 7 tables that depend on each other.<br />
but I think this approach could be very slow and is unhandy to develop (design).<br />
<br />
My question now is, if there is a possibility to "indent" the child-element(s) of a parent dynamically at report-render time.<br />
E.g.: I have the indention level of each element. Is it possible to insert new columns at runtime, each indent-level inserts 1 column?<br />
<br />
Or does anybody have a better solution for my problem?<br />
<br />
Thanks in advance.<br />
<br />
Sebastian
Find more posts tagged with
Comments
mwilliams
If you have an indentation level field and your data comes in the order it needs to be in, you could simply add dynamic forced spaces before the field value, depending on the indentation field. If this doesn't work, could you show a sample of what your data looks like, how you'd like it to appear, and your BIRT version, and I'll do some testing.
locutuz
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="107455" data-time="1343059312" data-date="23 July 2012 - 09:01 AM"><p>
If you have an indentation level field and your data comes in the order it needs to be in, you could simply add dynamic forced spaces before the field value, depending on the indentation field. If this doesn't work, could you show a sample of what your data looks like, how you'd like it to appear, and your BIRT version, and I'll do some testing.<br /></p></blockquote>
<br />
Hi Michael,<br />
<br />
thanks for your reply.<br />
Your suggestion sounds good to me, but the problem is a little more complex.<br />
The indent has to be before a table-report-element, not just a label.<br />
I tried to declare a label-element and a table element within the same table cell (of a surrounding table).<br />
Both report-elements are of Display="Inline".<br />
So I thought, I could insert as much "spaces" as the indent-field specifies.<br />
Unfortunately, the inline-option does not work correctly with a table-element.<br />
Is that right? Is there another method to add an indentation dynamically at report-rendering time?<br />
<br />
Thanks a lot!<br />
<br />
Regards,<br />
Sebastian
mwilliams
Can you show me a small sample of data (fake values are fine) and what it's supposed to look like? Also, can you let me know your BIRT version. I'll try to come up with something for you.
stevek
We faced a similar situation where there was XML data loaded into a table structure with a hierarchy. In the table are a name and parent column, so that a tree could be built. The table also has a column of the order of the elements in the original XML file. The files get re-loaded periodically and processed, so we were able to add an indent column representing the levels of the hierarchy (i.e., 1, 2, 3, ...).
Within Crystal Reports, this is easy to output indented using a grouping and the Hierarchical Group Options feature to sort and indent appropriately. I have not found a similar feature in BIRT.
To solve this in BIRT, we added the indent column to the database to represent the levels of the hierarchy. Next added a script to OnCreate for the cell containing name column to pad based on indent as follows -
this.getStyle().paddingLeft = String(row["INDENT"]*15) + " points";
mwilliams
This post might help:
http://www.birt-exchange.org/org/forum/index.php/topic/27853-to-display-data-in-tree-structure/