No SubReport printing if its DataTable has no rows.

Stimulsoft Reports.NET discussion
LukasT
Posts: 306
Joined: Mon May 03, 2010 2:50 am
Location: Czech Republic

No SubReport printing if its DataTable has no rows.

Post by LukasT »

Hello...
Normally in runtime I am putting data to StiReport using .RegData and DataSet ... but I have to post you example report and data separately as .mrt, data.xml a data.xsd and I have no problem with exporting ... I have problem if I try to open the report in designer, data and xsd I load into report using XmlData connection, relations between tables are configured correctly but relations are not visible in "View Data"... see DataSource in example.

Example is attached, but you have to solve this problem and after rendering you will see report width two Details. First of them has data in both subreports and second one only in one subreport... and I need some feature, which can hide subreport if it has no data.
Attachments
1243.example.zip
(23.54 KiB) Downloaded 590 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

No SubReport printing if its DataTable has no rows.

Post by Alex K. »

Hello,

As a way, you can use the HeaderBand component instead of the PageHeader. In this case, if data are empty then the Header will not be shown. Please find attached the modified report.

Thank you.
Attachments
1247.Report_modifed.mrt
(52.94 KiB) Downloaded 487 times
LukasT
Posts: 306
Joined: Mon May 03, 2010 2:50 am
Location: Czech Republic

No SubReport printing if its DataTable has no rows.

Post by LukasT »

Hello,
thank you... HeaderBand is partial solution of my problem... but here is one think yet. SubReport Band in main report occupies place of its design height and width event in case of its hidden content....
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

No SubReport printing if its DataTable has no rows.

Post by Alex K. »

Hello,

You can set the Dock Style property of Sub reports to Top.

Thank you.
Attachments
1251.Capture1.PNG
1251.Capture1.PNG (16.17 KiB) Viewed 4172 times
1250.Report_modifed.mrt
(53.07 KiB) Downloaded 695 times
LukasT
Posts: 306
Joined: Mon May 03, 2010 2:50 am
Location: Czech Republic

No SubReport printing if its DataTable has no rows.

Post by LukasT »

Ok... but container is sorting subreports by name... not in original sequence...
LukasT
Posts: 306
Joined: Mon May 03, 2010 2:50 am
Location: Czech Republic

No SubReport printing if its DataTable has no rows.

Post by LukasT »

And Top didn't help... try it with more subreports.... and modify data to have first three subreports without data...
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

No SubReport printing if its DataTable has no rows.

Post by HighAley »

Hello.
LukasT wrote:Ok... but container is sorting subreports by name... not in original sequence...

And Top didn't help... try it with more subreports.... and modify data to have first three subreports without data...
Please send us a sample report with more data to reproduce sorting issue and issue with more subreports.

Thank you.
LukasT
Posts: 306
Joined: Mon May 03, 2010 2:50 am
Location: Czech Republic

No SubReport printing if its DataTable has no rows.

Post by LukasT »

Hello,
Example attached... ;-)
Attachments
1256.example2.zip
(42.87 KiB) Downloaded 350 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

No SubReport printing if its DataTable has no rows.

Post by Alex K. »

Hello,

Can you please send us .mrt file.

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

No SubReport printing if its DataTable has no rows.

Post by HighAley »

Hello.
LukasT wrote:And Top didn't help... try it with more subreports.... and modify data to have first three subreports without data...
There are sub_9text_summary_Page1_summary_s_addline_2 and sub_9text_summary_Page1_summary_s_addline_1 on your sub_9Page1 subreport not on databand. Therefore this subreport has blank area. If you delete this text components or move then on DataBand the report wil be rendered without blank areas.
LukasT wrote:Ok... but container is sorting subreports by name... not in original sequence...
In Group Header you set sort direction. It is necessary for correct grouping. If you need sorting in another sequence you can set it in DataBand.

Thank you.
Post Reply