Is hidding a 'empty' sub report really possible?

6 posts, 0 answers
  1. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 02 Aug Link to this post

    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.

  2. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 02 Aug in reply to Pierre Link to this post

    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. .. .
  3. DevCraft banner
  4. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 02 Aug Link to this post

    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 ..
  5. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 02 Aug Link to this post

    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.

  6. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 02 Aug Link to this post

    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;
    }

  7. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 03 Aug in reply to Pierre Link to this post

    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.


Back to Top
DevCraft banner