none
Set a table Invisible when the row count is 0 RRS feed

  • Question

  • Hello

    In some of my printing I need to set the invisible Property to False where there is no row in the table (to gain some space)
    Any Idea how to do that

    maybe

    Hidden = (RowCount=0) ->this will not work, there is no RowCount

    Thanks

    Tuesday, September 9, 2008 2:01 PM

Answers

  • Hi Zash,

    One way to do this is with the Count function. Count a column in your dataset and see if it returns zero.

    Set this as the value of your table's Visibility.Hidden property

    =Count(Fields!AColumnInTheDataSet.Value, "NameOfTheDataSet") = 0 

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, September 9, 2008 4:08 PM

All replies

  • Hi Zash,

    One way to do this is with the Count function. Count a column in your dataset and see if it returns zero.

    Set this as the value of your table's Visibility.Hidden property

    =Count(Fields!AColumnInTheDataSet.Value, "NameOfTheDataSet") = 0 

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, September 9, 2008 4:08 PM
  • Hello

    It works fine,thanks !

    Greetings

    Zash
    Thursday, September 11, 2008 2:47 PM
  • Hello

    I have an other problem. In the table ,I use a filter.
    That means that the table doesn't display every element of the dataset.
    Is it possible to get a count directly from the table ?

    Greetings

    Zash
    Wednesday, October 15, 2008 7:04 AM
  • Just change the scope of the Count from the dataset to the table.

    =Count(Fields!AColumnInTheDataSet.Value, "NameOfTable") = 0

    Nick Allen, Microsoft SQL Server Reporting Services. This posting is provided "AS IS" with no warranties and confers no rights.
    Thursday, October 16, 2008 6:45 AM
  • Thanks,I will try that
    Thursday, October 16, 2008 6:53 AM
  • Maybe I need to add some explication because it doesn't work.
    The table is within a rectangle, when the table is empty I would like that the rectangle to be invisible
    In the rectangle ther eis some space on the top, when the table is empty I want to regain this space,that's why I want to set the rectangle invisible,tha'ts the only way I found to do this.I try the table alone, but the space on the top of the table canoot be regain

    Thursday, October 16, 2008 8:22 AM