This is a migrated thread and some comments may be shown as answers.

Is hidding a 'empty' sub report really possible?

5 Answers 372 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 1
Pierre asked on 02 Aug 2016, 12:25 PM

Hi,
I have a main Report, and i call a sub report.
In the main report the Sub report Size is set to 0.1cm. And it can grow.
This Subreport has:

- Label
- Table with rotate layout
 - Label


I try NoDataStyle visible false. But the header are still showing.

I did create a report parameter on the SubReport, using the DataSource of the table i want to hide, With value =Count(Fields.Id).
I did that because i wanted to create a conditional formating to hide the table.
But with this try i have "Missing or invalid parameter Value. please input valid data for all parameters." .

I am trying Every solution i can find for this .

I have no more Idea.

5 Answers, 1 is accepted

Sort by
0
Pierre
Top achievements
Rank 1
answered on 02 Aug 2016, 12:28 PM
For hidding the label,
I created 1 cell table, Used the same DataSource, Then used NoData Visible.
And it work that time ... ... .. I really dont know.

I recreated all my Sub report 3 times now to be sure. .. .
0
Pierre
Top achievements
Rank 1
answered on 02 Aug 2016, 02:25 PM
Hi,
It's me again! Guyz plz Editing post is a basic thing since WIT in 1994. (not in the 1rst version)
I'm pretty sure you can do something like this with a rule like ' post is editable if there is no reply under it.'
Because this was an option in BulletinBoards.com in 98. Even before V bultin and PhpBB comes public in 2000.
I have never see a forum so buggy. That can reset your reply every time you try to plly some format.

So i am here to explain a bit more my Issue.

It seems that NoData Style Visible= False Dont work on header.
So NoData is USELESS if you have a header. Great !

Lets try the Conditional Formatting!
1/. Create your SubReport With a Report Param To filter the DataSource.
2/. Create an other Report Param to Count the number of row in the DataSource.
This is where i Fail ! And i think its because My 2nd ReportParam Want To count a Datasource that use my 1rst ReportParam...
And you process the template before the data so when I create the 2nd param the Data source do not exist yet. Or something like this.

I see only 2 way Out!
1/. Create On EVERY Header cell A conditional Formatting .. .. .. Thats a lot lot of cell...
2/. Create an Other Layer Of SubReport and switch every header to table cell. The other layer is here to be sure that Table Cell like header dont repeat if you have multiple row.

Those 2 are ugly workaround. I am going for the 1rst one.


If someone has any idea. tips ..
0
Pierre
Top achievements
Rank 1
answered on 02 Aug 2016, 02:34 PM

Hi,

It's me again! Guyz plz Editing post is a basic thing since WIT in 1994. (not in the 1rst version)
I'm pretty sure you can do something like this with a rule like ' post is editable if there is no reply under it.'
Because this was an option in BulletinBoards.com in 98. Even before V bultin and PhpBB comes public in 2000.
I have never see a forum so buggy. That can reset your reply every time you try to apply some format.

So i am here to explain a bit more my Issue.

It seems that NoData Style Visible= False Dont work on header.
So NoData is USELESS if you have a header. Great !

Lets try the Conditional Formatting!
1/. Create your SubReport With a Report Param To filter the DataSource.
2/. Create an other Report Param to Count the number of row in the DataSource.
This is where i Fail ! And i think its because My 2nd ReportParam Want To count a Datasource that use my 1rst ReportParam...
And you process the template before the data so when I create the 2nd param the Data source do not exist yet. Or something like this.

I see only 2 way out:
1/. Create on EVERY Header cell A conditional Formatting .. .. .. Thats a lot lot of cell...
2/. Create an Other Layer Of SubReport and switch every header to table cell. The other layer is here to be sure that Table Cell like header dont repeat if you have multiple row.

Those 2 are ugly workaround but I am going for the 1rst one.

If someone has any idea. tips ..

PS: I am pretty sure That Hidden header still take Room.. i feel like bargaining with the Devil.

0
Pierre
Top achievements
Rank 1
answered on 02 Aug 2016, 02:53 PM

Solved!

http://www.telerik.com/support/kb/reporting/details/modifying-or-creating-a-report-at-run-time

Click an element > View code.
Insert your control logic!

 

if (table1.Items.Count != 0 )

{ 

table1.Style.Visible = false;
table2.Style.Visible = false;
table3.Style.Visible = false;
table4.Style.Visible = false;
}

0
Pierre
Top achievements
Rank 1
answered on 03 Aug 2016, 08:47 AM
Table1 is my custom trigger.
It's a 1 cell table ( size 0.1cm,0.1cm ), WITH NO HEADER !!!
Set the datasource. And the Nodata.Style Visible to False.
This way The table will exist only if there is some result.
Test the number of row , if 0 No result.

At the end of you test, you can either hide the "Trigger Table"  or tell it that he should not grow if there is result.
That wont disturb the layout or the code. Adding some logic Control in a SubReport is now easy.

An Alternative will be to access the number of row in a DataSource, and good luck with that.
And with the "Trigger Table" you can add a filter to test the right thing.


Tags
General Discussions
Asked by
Pierre
Top achievements
Rank 1
Answers by
Pierre
Top achievements
Rank 1
Share this question
or