Hello,
I'd like to build an hierarchical master detail report. The master should be hierarchical, the detail should indent with the master. I did this by first creating a hierarchical band with some fields and adding a container on it with a databand.
This works file, but as the hierarchical band indents, the container indents with it, over the right border of the page. How can I make the container and its contents autoschrink to the max width of the parent hierarchical band.
Jacco
Hierarchical master detail
-
- Posts: 4
- Joined: Thu Apr 03, 2008 7:00 am
- Location: Netherlands
Hierarchical master detail
Please do as follows:
- Place a hierarchical band with zero height before your hierarchical band. All properties ofthis bands must be the same (except height).
- Declare a double type variable Dist in the Dictionary.
- In the new Hierarchical Band write the following EvenHandlers:
BeforePrintEvent:
EndRenderEvent:
You can open the attached report in the Demo example application from the standard delivery and see all that in action.
Thank you.
- Place a hierarchical band with zero height before your hierarchical band. All properties ofthis bands must be the same (except height).
- Declare a double type variable Dist in the Dictionary.
- In the new Hierarchical Band write the following EvenHandlers:
BeforePrintEvent:
Code: Select all
int level = (sender as StiHierarchicalBand).DataSource.GetLevel();
if (level > 0)
{
if (level * this.Unit.ConvertFromHInches((sender as StiHierarchicalBand).Indent) > Dist)
{
Dist = level * this.Unit.ConvertFromHInches((sender as StiHierarchicalBand).Indent);
}
}
Code: Select all
Container1.Width = Container1.Width - Dist;
TextInsideTheContainer.Width = TextInsideTheContainer.Width - Dist;
Thank you.
- Attachments
-
- 52.HierarchicalBandIndentControl.mrt
- (22.34 KiB) Downloaded 237 times