locked
SSRS 2008 Blank page when visibility is false RRS feed

  • Question

  • Hello,

    I have the following situation:

    Main Report: Contains two tablix. Each tablix has a conditional visibility.

    Sub Report: Contained within the main report after the two tablix. Visibility is again conditional.

    Each tablix in Main report acts like an individual page / report. In other words, main report can be attributed as two reports visually. Thus, what user sees on screen is three pages back to back: two of tablix in main report and the subreport in main report. Users like to call each page as a report.

    There is a user form with checkboxes for selection of each of these reports. Visibility is set according to the user selection in the respective checkbox.

    The visibility condition works on all the pages except the first tablix page. When user deselects checkbox 1 that corresponds to tablix 1 but selects checkbox for the second tablix and subreport, she sees a blank page for the deselected tablix. While ideally, the user should see only those tablix / reports that correspond to selected checkbox.

    Why is a blank page visible when the visibility condition is set correctly?

    Tuesday, January 3, 2012 6:28 PM

All replies

  • Namrata,

    In SSRS 2005, white spaces are automatically ignored. But in 2008 this behavior gets changed and by default whitespaces are not ignored.  But, There is Report property ConsumeContainerWhitespace which is set to False by default. We can remove blank space at end by setting ConsumeContainerWhitespace to true.

    The logic to prevent the unnecessary pagebreak is
    - ReportBody width should be less then Pagesize(width) – Left Margin – Right Margin
    - ReportBody height should be less then Pagesize(Height) – Top Margin – Bottom Margin – Header height – Footer height


    Thanks,
    Sandip Shinde
    Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
    • Proposed as answer by LearnerSql Sunday, January 8, 2012 12:05 PM
    Tuesday, January 3, 2012 6:49 PM
  • Thanks Namrata,

    Please take backup of your report before trying my tips here.

    Can you please add one Tablix with one column on report & add(cut & paste) individual report items to your tablix cells(add rows as per your requirements.) Change row hights accordingly to fit your controls(tablix, charts,..etc). Now you will have only one tablix & other controls are embeded into your main tablix.

    Try to set visibility of your first row according to your condition.

    Hope this will work for your :)


    Thanks,
    Sandip Shinde
    Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
    Tuesday, January 3, 2012 7:56 PM
  • Sandip,

    This is what I have:

    Since, the Report contains two tablix and a sub-report, Body-Height = 25.04in and Body-Width = 8.23in.

    Report Page Size: Width = 8.0 in and Height = 11.0in

    Page break is set on each tablix and it is set to "Add a page break before".

    Tablix height and width follow the aforementioned rule. I would think that, since each tablix appears on a new page and the tablix dimensions are less than the Report "Page" dimensions, there should not be any blank page.

    Let me know if I am wrong in my assumption and the possible solution for this issue.

    -Namrata

     

     

     

    Tuesday, January 3, 2012 7:58 PM
  • Namrata, you have one tablix on first page (with hidden expression) & another one appears after it right. Instead of this you can have only one tablix where you can cut & paste your existing tablix & first row hidden expression as per your condition should work for you.
    Thanks,
    Sandip Shinde
    Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
    Tuesday, January 3, 2012 8:08 PM
  • I am not sure I understand what you are saying.

     

    Tuesday, January 3, 2012 9:42 PM
  • Namrata,

    Instead of placing the Tablix/Chart directly (if they are using same dataset) on the body of the report, place a tablix on the body with the Tablix/Chart in it.  Then, set the ColumnVisibility (or RowVisibility) property to false.  Voila!  Using Column or Row Visibility set to false does remove the vertical white space (whereas the above Hidden property on the Tablix/Chart did not).

    Please refer Dealing with White Space due to a Hidden Textbox in Reporting Services


    Thanks,
    Sandip Shinde
    Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
    Wednesday, January 4, 2012 8:36 AM
  • Sandip,

    That did not work.. :-/

    -Namrata

    Wednesday, January 4, 2012 10:40 PM
  • Hi namrataghadi,

    It could be caused by the Page Break settings of first tablix and group.

    1) If your first tablix(or the tablix above can be hidden tablix) do not have groups, un-check the "Add a page break after" from first tablix properties and to check "Add a page break before" for can be hidden tablix.

    2) If your first tablix(or the tablix above can be hidden tablix) have groups groups, un-check the "Add a page break after" from first tablix properties and also uncheck "Also at end of group" in Page break tab of outermost group properties. Check "Add a page break before" for can be hidden tablix to get a page break.

    Another possible workaround to prevent the blank space is to nest the Tablix in the other Tablix row:

    1.Add a List control to the report.
    2.Select the List, in the grouping pane, right click the(Details) item and selectDelete Group. ClickOK in the Delete Group dialog.
    3.Right click the cell in the list, and selectDelete to delete the nested rectangle.
    4.Drag and drop the Tablix into the cell of the List.
    5.Select the List, in the grouping pane, click the small triangle at the top-right corner and selectAdvance Mode.
    6.Select the (Static) item in the Row Groups list, and then we can specify theHidden property to an expression to control the visibility of the Tablix.

    Thanks,
    Lola

    • Edited by Lola Wang Thursday, January 5, 2012 5:23 AM
    Thursday, January 5, 2012 5:21 AM
  • Lola,

    I tried what you said. But it doesnt work either.

    -Namrata

    Thursday, January 12, 2012 8:47 PM
  • Another thing I noted. I cannot create a "List" without a Dataset name. Any tablix added to the cell of the list as mentioned by you in the step 4 inherits the "List's" dataset name (which is empty in our case).
    Thursday, January 12, 2012 10:08 PM