Use Panel Height in Events

Stimulsoft Reports.NET discussion
Post Reply
MatthiasU
Posts: 68
Joined: Mon Sep 14, 2015 8:33 am

Use Panel Height in Events

Post by MatthiasU »

Hello,

I have a small problem and hope, you can help me :)

I have a report template with a panel on the left, and a chart on the right side of the page. The panel can grow depending on data. Now, I want to adjust the chart height to the printed height of the panel.

How can I achieve this?

And there seems to be a bug? The panel always grow to whole page height, when property "CanGrow" is set :( Please see attached sample template.


Many thanks & Regards,
Matthias
Attachments
PanelGrowIssue.mrt
(13.63 KiB) Downloaded 225 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Use Panel Height in Events

Post by Alex K. »

Hello,

Please try to use the additional band component on which place Panel and Chart and set the GrowToHeght property for Chart to true.

Thank you.
Attachments
PanelGrowIssue_modified.mrt
(15.04 KiB) Downloaded 304 times
MatthiasU
Posts: 68
Joined: Mon Sep 14, 2015 8:33 am

Re: Use Panel Height in Events

Post by MatthiasU »

Hello,

thanks, works fine for the amount of data in my sample, but please try again with 50 data records :( Now, I get 3 empty pages and a part of the data on the last page :(

Thanks & Regards,
Matthias
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Use Panel Height in Events

Post by Alex K. »

Hello,

In this case, you can make the following modifications:
- set the MaxSize for the Chart
- or set UnlimitedHeight=true and UnlimitedBreakable=false for the Page

Thank you.
Attachments
PanelGrowIssue_modified2.mrt
(15.42 KiB) Downloaded 187 times
PanelGrowIssue_modified1.mrt
(15.32 KiB) Downloaded 195 times
MatthiasU
Posts: 68
Joined: Mon Sep 14, 2015 8:33 am

Re: Use Panel Height in Events

Post by MatthiasU »

Hello,

thank you for the reply.
set the MaxSize for the Chart
My sample was simplified. In real case, we don't know the possible max size for the chart, because of additional (header/footer) bands before/after panel/chart which can grow & shrink :( So, I have to check if this solution may work for us (I don't think so).
But there is a further issue with this solution: The data bands are splitted between two pages. I have set KeepDetails=KeepDetailsTogether and CanBreak=false and combinations of them, but no impact on ouput :(
set UnlimitedHeight=true and UnlimitedBreakable=false for the Page
With these options, the chart will be printed over all pages. Sorry, I have forgot to set the PrintOn property for the chart to "OnlyFirstPage", which is required :( And all pages are printed on one large page? Can I get three separate pages?
Attachments
Result with issues for Chart MaxSize solution.
Result with issues for Chart MaxSize solution.
issue_maxsize.png (2.6 KiB) Viewed 4489 times
Result with issues for UnlimitedHeight/UnlimitedBreakable solution.
Result with issues for UnlimitedHeight/UnlimitedBreakable solution.
issue_unlimitedheight.png (8.66 KiB) Viewed 4489 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Use Panel Height in Events

Post by Alex K. »

Hello,

Sorry, maybe we did not exactly understand your task. Could you explain your task in more details?
Can you please send us a sample how it should look like.

Thank you.
MatthiasU
Posts: 68
Joined: Mon Sep 14, 2015 8:33 am

Re: Use Panel Height in Events

Post by MatthiasU »

Hello,

pleasse see attachement for expected output.

Thanks & Regards,
Matthias
Attachments
Expected output with 30 data records and page break
Expected output with 30 data records and page break
sample_growing_Chart.png (17.53 KiB) Viewed 4482 times
Expected output with 20 data records
Expected output with 20 data records
sample_20-records.png (10.7 KiB) Viewed 4482 times
Expected output with 10 data records
Expected output with 10 data records
sample_10-records.png (10.47 KiB) Viewed 4482 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Use Panel Height in Events

Post by Alex K. »

Hello,

In this case, you can use the additional code, in which calculate height of the Header info and then in the ProcessChart event set the height for the Chart.

Thank you.
Attachments
PanelGrowIssue_modified4.mrt
(16.81 KiB) Downloaded 199 times
MatthiasU
Posts: 68
Joined: Mon Sep 14, 2015 8:33 am

Re: Use Panel Height in Events

Post by MatthiasU »

Hello,

thanks for your reply.

But your proposed solution does not fit the described requirements in all points :(

With your solution, the chart always fills the rest of the page. My target was to set the height of the chart to the height of the panel. I've tried to implement a similar solution with additional code, but I can't get the final height of the panel :(

Do you have any solution for this problem?

Many thanks & Regards,
Matthias
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Use Panel Height in Events

Post by Alex K. »

Dear Matthias,

In this case, you can add the additional variable for the calculating height of data section and check the PageCount or make other necessary checks in your working report.
Please check the modified report in the attachment.

Thank you.
Attachments
PanelGrowIssue_modified5.mrt
(17.09 KiB) Downloaded 221 times
Post Reply