Omit header if data is empty in master detail report

Stimulsoft Reports.WPF discussion
Post Reply
chriga
Posts: 14
Joined: Thu Feb 21, 2013 1:15 pm

Omit header if data is empty in master detail report

Post by chriga »

Hi,
I have a master detail report with header and data. I have attached an example report (Report.mrt).
Screenshot1.png
Screenshot1.png (29.85 KiB) Viewed 3641 times
If data is existing all seams to be ok:
Screenshot2.png
Screenshot2.png (6.75 KiB) Viewed 3641 times
But if the data is empty the header is still shown:
Screenshot3.png
Screenshot3.png (5.26 KiB) Viewed 3641 times
How can I prevent showing header if data is empty?

Best regards,
Chris
Attachments
Report.mrt
(14.68 KiB) Downloaded 316 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Omit header if data is empty in master detail report

Post by Alex K. »

Hello,

We couldn't reproduce the issue.
Can you please send us a test data for your report.

Thank you.
Attachments
Capture.PNG
Capture.PNG (39.41 KiB) Viewed 3633 times
chriga
Posts: 14
Joined: Thu Feb 21, 2013 1:15 pm

Re: Omit header if data is empty in master detail report

Post by chriga »

Hi,
I have attached a VS project that creates example data for the report.

Best regards,
Chris
Attachments
ClassLibrary1.zip
(16.23 KiB) Downloaded 271 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Omit header if data is empty in master detail report

Post by HighAley »

Hello.

You have data in the Data2 band and the header is printed.
In this report you should swap Data2 band and HeaderBand2.

Thank you.
chriga
Posts: 14
Joined: Thu Feb 21, 2013 1:15 pm

Re: Omit header if data is empty in master detail report

Post by chriga »

Great! This works perfectly! But now, I have another case, where I want to omit the header and I don't know how.
Screenshot1.png
Screenshot1.png (22.39 KiB) Viewed 3621 times
If all data exists then there is no problem:
Screenshot2.png
Screenshot2.png (4.35 KiB) Viewed 3621 times
But if the data is null the header is still shown:
Screenshot3.png
Screenshot3.png (3.76 KiB) Viewed 3621 times
I can remove the second header if I create an empty collection, but the first header still exists:
Screenshot4.png
Screenshot4.png (2.67 KiB) Viewed 3621 times
How can I prevent showing header if data is empty in this case? For better understanding I have attached an example report within an example project.

Best regards,
Chirs
Attachments
ClassLibrary1.zip
(17.78 KiB) Downloaded 288 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Omit header if data is empty in master detail report

Post by HighAley »

Hello.

We have reproduced your issue.
We will let you know when it will be fixed.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Omit header if data is empty in master detail report

Post by HighAley »

Hello.

We have made an improvement. You could read more about this problem on our Knowledge Base.
It will be available in our next prerelease build.

You should add next code in your project:

Code: Select all

Stimulsoft.Report.Dictionary.StiBusinessObject.FieldsIgnoreList["Test.Result"] = null;

report.Load("Report.mrt");
report.RegBusinessObject("Tests", tests);
Thank you.
Post Reply