Page 2 of 3

No SubReport printing if its DataTable has no rows.

Posted: Tue Aug 09, 2011 6:08 am
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.

No SubReport printing if its DataTable has no rows.

Posted: Wed Aug 10, 2011 2:46 am
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.

No SubReport printing if its DataTable has no rows.

Posted: Wed Aug 10, 2011 3:24 am
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....

No SubReport printing if its DataTable has no rows.

Posted: Thu Aug 11, 2011 2:49 am
by Alex K.
Hello,

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

Thank you.

No SubReport printing if its DataTable has no rows.

Posted: Thu Aug 11, 2011 3:11 am
by LukasT
Ok... but container is sorting subreports by name... not in original sequence...

No SubReport printing if its DataTable has no rows.

Posted: Thu Aug 11, 2011 3:16 am
by LukasT
And Top didn't help... try it with more subreports.... and modify data to have first three subreports without data...

No SubReport printing if its DataTable has no rows.

Posted: Fri Aug 12, 2011 2:36 am
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.

No SubReport printing if its DataTable has no rows.

Posted: Fri Aug 12, 2011 3:49 am
by LukasT
Hello,
Example attached... ;-)

No SubReport printing if its DataTable has no rows.

Posted: Fri Aug 12, 2011 6:27 am
by Alex K.
Hello,

Can you please send us .mrt file.

Thank you.

No SubReport printing if its DataTable has no rows.

Posted: Fri Aug 12, 2011 6:27 am
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.