none
How to show Subreport with no Data available ?(Preserve the space) RRS feed

  • Question

  • Hello Everyone,

     

    I have lot of Subreports on the Main Report and I want that if that data is not there, it still preserves that space :

     

    For Example :

    Subreporti1

     

     

    Subreport2

     

     

    Sub3                                               Sub4                                           Sub5

     

    If only Subreport 5 have data then only that is shown, but it should on the space it was set on, rather than moving to where subreport3 is .

     

    Thanks.

    Harsimrat 

    Wednesday, September 12, 2007 2:00 AM

Answers

  • OK, 5 rows, then, in any case a "known" amount of space.

     

    You can usually add padding to a row that is marked "Can Grow", conditionally, when you need to "push down" some content. 

     

    You can also create another element that is marked with a Visible/Hidden expression to show only when there are no rows in the dataset you use in the subreport. It must be marked "Can Shrink"

     

    Both these solutions require that the parent report be able to tell that the subreport is empty, or not.  Do you have that ability in your situation?

     

    If you do not, you have some other options:

     

    * -- create an element of the proper height in the *subreport* which is only visible when there are no rows

     

    * -- create a set of empty rows (any number, such as 5) that you can add to the result set for cases when there are no "real" rows.  You do this in the SQL rather than in the report itself.

     

    Which resolution appeals to you <s>?

     

    >L<

     

     

    Thursday, September 13, 2007 4:39 AM

All replies

  • Does the subreport always take up the same amount of space, when it *does* have data? 

     

    >L<

     

    Thursday, September 13, 2007 2:36 AM
  • No, it doesn't. It expands based on the data, I want it to use the same amount of space regardless with data there or not.

     

    Thursday, September 13, 2007 2:52 AM
  • >>No it doesn't. It expands based on the data, I want it to use the same amount of space regardless with data there or not.

     

    My point is this: if, when it has data, it doesn't always take up exactly the same amount of space, how do you decide how much space is the "right amount of space" when there is *no* data?

     

    IOW: It takes up a certain amount of space when there are 2 rows returned.  It takes a different amount of space, according to your answer to my question, if there are 10 rows returned.  So, when there are 0 rows returned, or 1 row returned, should it take up as much space as 2 rows, or as much space as 10 rows?

     

    >L<

     

    Thursday, September 13, 2007 2:58 AM
  • Yes, that is absolutely correct. Say When no data is returned I want it to have 5 row space and based on the subreport I should be able to change the number of space rows.

    Thursday, September 13, 2007 3:37 AM
  • OK, 5 rows, then, in any case a "known" amount of space.

     

    You can usually add padding to a row that is marked "Can Grow", conditionally, when you need to "push down" some content. 

     

    You can also create another element that is marked with a Visible/Hidden expression to show only when there are no rows in the dataset you use in the subreport. It must be marked "Can Shrink"

     

    Both these solutions require that the parent report be able to tell that the subreport is empty, or not.  Do you have that ability in your situation?

     

    If you do not, you have some other options:

     

    * -- create an element of the proper height in the *subreport* which is only visible when there are no rows

     

    * -- create a set of empty rows (any number, such as 5) that you can add to the result set for cases when there are no "real" rows.  You do this in the SQL rather than in the report itself.

     

    Which resolution appeals to you <s>?

     

    >L<

     

     

    Thursday, September 13, 2007 4:39 AM