Hierarchical Band multi column data band

Stimulsoft Reports.NET discussion
Post Reply
patwolf
Posts: 90
Joined: Thu May 29, 2008 1:38 pm
Location: Los Angles

Hierarchical Band multi column data band

Post by patwolf »

Hi,

I have the following structure:

Code: Select all

id    root    type    name    projectIsActive    taskResource    taskDetailCost
1    null    project    A    TRUE    null    null
2    1    task    A1    null    Peter    null
3    2    taskDetail    A1-1    null    null    25
4    2    taskDetail    A1-2    null    null    21
5    null    project    B    TRUE    null    null
6    5    task    B1    null    Bob    null
7    6    taskDetail    B1-1    null    null    2
And would like to display the following:

Code: Select all

A 
.A1 
..A1-1  | A1-2   | A1-3  
----- maybe new page ----------
A 
.A1 
..A1-4  | A1-5   | A1-6  
B
----- maybe new page (B should be on the next page with "keep togehter with next row" option) ----------
.B1
..B1-1  
One idea could a hierachical band with multiple containers inside. One gets displayed for a project row, one for a task row and a different one for taskDetail.
The one for taskDetail contains a column header and a multi column data band...
But I didn't get that one to work... The data band would always display all records again, or cause the parent to repeat itself.... not sure so how would I set this up please? It seemd like the parent child relationship wasn't working.

Thanks a lot,
Patrick
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Hierarchical Band multi column data band

Post by Edward »

Unfortunately this scenario is impossible in the current version of Hierarchical band. It is necessary to make some additional data processing outside the report for rendering such a report.

Thank you.
patwolf
Posts: 90
Joined: Thu May 29, 2008 1:38 pm
Location: Los Angles

Hierarchical Band multi column data band

Post by patwolf »

Thanks Edward.

Could you please describe which part is impossible?

>One idea could a hierachical band with multiple containers inside. One gets displayed for a project row, one for a task row and a different one for taskDetail.
This should be easily possible shouldn't it?
>The one for taskDetail contains a column header and a multi column data band...
This seems to be possible as I can at least drag the container and then the column header and multi column data band in it.... Just the data it displays isn't connected correctly to the hiearchy above it.
Since I'm working with custom business objects it would be possible to add pretty much any property to it e.g. a children property if that would help.
Could I add a sub-report inside the container?
etc.

Thank you,
Patrick
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Hierarchical Band multi column data band

Post by Edward »

patwolf wrote:>One idea could a hierachical band with multiple containers inside. One gets displayed for a project row, one for a task row and a different one for taskDetail.
This should be easily possible shouldn't it?
Yes, such representation of viewing of the tree is used now in the ideology of Hierarchical band, but the same textboxes are used for displaying of all levels of hierarchy.

Multiple containers are possible if you provide a data for them for each level. I fit is ok, then Each level can be adjusted additionally.
>The one for taskDetail contains a column header and a multi column data band...
This seems to be possible as I can at least drag the container and then the column header and multi column data band in it.... Just the data it displays isn't connected correctly to the hiearchy above it.
Since I'm working with custom business objects it would be possible to add pretty much any property to it e.g. a children property if that would help.
Yes, it is true. We need to process hierarchy with help of the report engine, or to do it in script or inside of your business objects. With the report engine is more preferable way, but it requires time for implementation.
Could I add a sub-report inside the container?[/qoute]

In the version of the report engine we are embedding write now it is possible. In the current version - no.

Thank you.
patwolf
Posts: 90
Joined: Thu May 29, 2008 1:38 pm
Location: Los Angles

Hierarchical Band multi column data band

Post by patwolf »

Edward wrote:Multiple containers are possible if you provide a data for them for each level. I fit is ok, then Each level can be adjusted additionally.
Each row contains enough data for the type the row has (all fields which aren't needed for the type are null):
id root type name projectIsActive taskResource taskDetailCost
Does this mean this part is covered / workable?
Edward wrote:Yes, it is true. We need to process hierarchy with help of the report engine, or to do it in script or inside of your business objects. With the report engine is more preferable way, but it requires time for implementation.
So if I provided a property "children" in the business object which contained a List of all children of the current processed row / business object would that be enough?
If yes how would I hook this up with the data band inside of the hierarchical band?

Here is how it would look:
- Hierarchical Band (Datasource MyItems) -----
-- Container Project
--- DataBand: Name, ProjectIsActive
-- Container Task
--- DataBand: Name, taskResource
-- Container TaskDetail
--- Column Band
--- DataBand (Datasource MyItem children): Name, taskDetailCost | Name, taskDetailCost | Name, taskDetailCost

Thanks a lot Edward,
Patrick
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Hierarchical Band multi column data band

Post by Edward »

patwolf wrote:Each row contains enough data for the type the row has (all fields which aren't needed for the type are null):
id root type name projectIsActive taskResource taskDetailCost
Does this mean this part is covered / workable?
I think so.
So if I provided a property "children" in the business object which contained a List of all children of the current processed row / business object would that be enough?
If yes how would I hook this up with the data band inside of the hierarchical band?

Here is how it would look:
- Hierarchical Band (Datasource MyItems) -----
-- Container Project
--- DataBand: Name, ProjectIsActive
-- Container Task
--- DataBand: Name, taskResource
-- Container TaskDetail
--- Column Band
--- DataBand (Datasource MyItem children): Name, taskDetailCost | Name, taskDetailCost | Name, taskDetailCost
Please see the sample report in the attachment. Just unpack it into: "d:\test"

A structure of the report is sligthly different, contains a lot of script but does realize a lot of your requirements, but this solution has some limitations:
- Always two parent levels will be shown
- There is no control of placement on the page of the entire group. Each new group just starts with a new page due to FooterBand with StartNewPage property set in true.
Thanks a lot Edward,
Patrick
You are welcome.

And concerning of project row repeating and the task row in the top of the page/band when group spreads on many pages. I can not say anything with confidence about support of this feature by our report engine, because it is not easy and not clear task. Maybe you have some ideas how it could be added? I mean property/method or algorithm of working with it, etc.

Thank you.
Attachments
77.test.zip
(6.52 KiB) Downloaded 320 times
patwolf
Posts: 90
Joined: Thu May 29, 2008 1:38 pm
Location: Los Angles

Hierarchical Band multi column data band

Post by patwolf »

Edward wrote:And concerning of project row repeating and the task row in the top of the page/band when group spreads on many pages. I can not say anything with confidence about support of this feature by our report engine, because it is not easy and not clear task. Maybe you have some ideas how it could be added? I mean property/method or algorithm of working with it, etc.
Hi Edward,
this might be a quick solution for you to implement and I think it would be good enough for my purposes :feelgood:
It seems like the main thing the hierarchical band is doing is sorting the rows in the correct order so that they make sense in the hierarchy...
So Report.NET iterates over the sorted rows and the hierarchical band displays them one by one.

What if the hierarchical band had in internal collection of rows: Dictionary_lastRowForLevel;
So every time a new row is encountered Report.NET does this:
_lastRowForLevel[GetLevel()] = _dataRow;

Then we have a property on the hierarchical band: "Repeat x levels on new page" which the user sets.
When Report.NET encounters a page break it checks the value in "Repeat x levels on new page" cycles through _lastRowForLevel[] and adds the rows to the beginning of the page.
Good would be if there was a method I could call from within my hierarchical band: IsDisplayedAsHeaderRow() so that I could react to the row being displayed as a header if need be.
Only caveat is that these rows shouldn't influence any sums, totals etc. they user might be calculating so they are just for display purposes.

Let me know if that would work for you.
Thanks,
Patrick
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Hierarchical Band multi column data band

Post by Edward »

Thank you very much for this suggestion. We will answer you about possibility of implementing such a collection a bit later in this topic.

Thank you.
Post Reply