Hi, Nasko.
I've calculated the quantity of pages of the report, but the size of the panels and shapes still growing strangely.
As I have the final height of the detail by page, I can set the height of the components based on it.
To assure that I've been setting the right height for the components, I've even measured the desired space, that the subreports should occupy, after printing. But it seems that there's something been added to these height after I've set the property (I've debugged the application as a guarantee that the property was, indeed, receiving the value that I've sent).
The routine that feeds the property is in the constructor of the report, after the call of the method InitializeComponent.
Any idea of what could be happening to these component's height?
As an extra information, I've already changed the properties of all components from the report to TextWrap as false and CanGrow as false.
Summing up, I wish that the margins around the charts named as "Vale Pedágio" and "Condutores" meet the reportfooter section in all the pages that these are presented. But, as it is possible to see in the last but one page of the attached image from the printed pdf, there's some "extra height" being added to the subreport height.
Following, a code sample of the main calculation routine.
private void SetSubReportsLayouts()
{
// Receive the total number of pages of the report
int numberOfPages = ReturnReportNumberOfPages();
// the report footer section is set to apply a page break before it prints, so I subtract this page
numberOfPages = (this.reportFooterSection1.Visible) ? numberOfPages - 1 : numberOfPages;
// here I calculate how many pages of the report has the standard detail height, so I also subtract the first page
int numberOfPagesWithStandardHeight = numberOfPages - 1;
// the attribute standard detail height was manually set to 14.2cm globally
// the first page detail height from valePedagio was manually set to 10.5 cm globally
// valesPedagio is the name of the left subreport
double heightValePedagioDoubleType = (numberOfPagesWithStandardHeight) *
(_standardDetailHeight - valesPedagio.ReturnHeaderHeight().Value) +
_firstPageDetailHeightValePedagio - valesPedagio.ReturnHeaderHeight().Value;
Unit heightValePedagioUnitType = (new Telerik.Reporting.Drawing.Unit(heightValePedagioDoubleType, Telerik.Reporting.Drawing.UnitType.Cm));
// the first page detail height from condutor was manually set to 12.6 cm globally
// condutores is the name of the right subreport
Unit heightCondutorUnitType = (new Telerik.Reporting.Drawing.Unit(numberOfPagesWithStandardHeight, Telerik.Reporting.Drawing.UnitType.Cm).
Multiply((new Telerik.Reporting.Drawing.Unit(_standardDetailHeight, Telerik.Reporting.Drawing.UnitType.Cm).
Subtract(condutores.ReturnHeaderHeight())).Value)).
Add((new Telerik.Reporting.Drawing.Unit(_firstPageDetailHeightValePedagio, Telerik.Reporting.Drawing.UnitType.Cm).
Subtract(condutores.ReturnHeaderHeight())));
// I set the subreport panels and shapes height inside the detail through a method inside the subreport
this.valesPedagio.SetReportDetailHeight(heightValePedagioUnitType);
this.condutores.SetReportDetailHeight(heightCondutorUnitType);
// After executing this routine, the heights from ValesPedagio (panel and shapes) and Condutores (panel and shape) are, respectively,
// 49.1 cm
// 51.2 cm
}
Thanks.
Best regards,
Nathalia
I've calculated the quantity of pages of the report, but the size of the panels and shapes still growing strangely.
As I have the final height of the detail by page, I can set the height of the components based on it.
To assure that I've been setting the right height for the components, I've even measured the desired space, that the subreports should occupy, after printing. But it seems that there's something been added to these height after I've set the property (I've debugged the application as a guarantee that the property was, indeed, receiving the value that I've sent).
The routine that feeds the property is in the constructor of the report, after the call of the method InitializeComponent.
Any idea of what could be happening to these component's height?
As an extra information, I've already changed the properties of all components from the report to TextWrap as false and CanGrow as false.
Summing up, I wish that the margins around the charts named as "Vale Pedágio" and "Condutores" meet the reportfooter section in all the pages that these are presented. But, as it is possible to see in the last but one page of the attached image from the printed pdf, there's some "extra height" being added to the subreport height.
Following, a code sample of the main calculation routine.
private void SetSubReportsLayouts()
{
// Receive the total number of pages of the report
int numberOfPages = ReturnReportNumberOfPages();
// the report footer section is set to apply a page break before it prints, so I subtract this page
numberOfPages = (this.reportFooterSection1.Visible) ? numberOfPages - 1 : numberOfPages;
// here I calculate how many pages of the report has the standard detail height, so I also subtract the first page
int numberOfPagesWithStandardHeight = numberOfPages - 1;
// the attribute standard detail height was manually set to 14.2cm globally
// the first page detail height from valePedagio was manually set to 10.5 cm globally
// valesPedagio is the name of the left subreport
double heightValePedagioDoubleType = (numberOfPagesWithStandardHeight) *
(_standardDetailHeight - valesPedagio.ReturnHeaderHeight().Value) +
_firstPageDetailHeightValePedagio - valesPedagio.ReturnHeaderHeight().Value;
Unit heightValePedagioUnitType = (new Telerik.Reporting.Drawing.Unit(heightValePedagioDoubleType, Telerik.Reporting.Drawing.UnitType.Cm));
// the first page detail height from condutor was manually set to 12.6 cm globally
// condutores is the name of the right subreport
Unit heightCondutorUnitType = (new Telerik.Reporting.Drawing.Unit(numberOfPagesWithStandardHeight, Telerik.Reporting.Drawing.UnitType.Cm).
Multiply((new Telerik.Reporting.Drawing.Unit(_standardDetailHeight, Telerik.Reporting.Drawing.UnitType.Cm).
Subtract(condutores.ReturnHeaderHeight())).Value)).
Add((new Telerik.Reporting.Drawing.Unit(_firstPageDetailHeightValePedagio, Telerik.Reporting.Drawing.UnitType.Cm).
Subtract(condutores.ReturnHeaderHeight())));
// I set the subreport panels and shapes height inside the detail through a method inside the subreport
this.valesPedagio.SetReportDetailHeight(heightValePedagioUnitType);
this.condutores.SetReportDetailHeight(heightCondutorUnitType);
// After executing this routine, the heights from ValesPedagio (panel and shapes) and Condutores (panel and shape) are, respectively,
// 49.1 cm
// 51.2 cm
}
Thanks.
Best regards,
Nathalia