Dynamically setting ReportName property of sub report

  • Is it possible to set the ReportName property of a sub report dynamically.

    Eg: =Iif(Fields!Department.Value = "Development", "EmployeeReport", Nothing)

    OR =Code.SubReportName(Fields!Department.Value)

    I am receiving the error:

    The ReportName for the subreport “subreport1” is not valid.  Report names can not be empty strings or just whitespace.

    Is there a solution? Thanks.

  • I got around this problem by listing all the sub reports I needed in seperate rows of my table, and setting the visible property of each row depending on the data.

    If a table row is hidden, does the query of a sub report still execute?

  • Oh yes, thats the problem with Subreports if it can be toggled. Thats what I found at BLOG:

    "If subreports are hidden and cannot be made visible via a toggle item, they are not executed."

    Look at this BLOG here:

    http://blogs.msdn.com/supde/archive/2004/08/18/216635.aspx

    Thanks

  • Hi. Is not there really way of doing him directly from design on the report? Only through xml?

    Other question. Is there way of inserting of the expressions, for the dimensions whith of a cell?

    Thanks 🙂

  • Sarah, it sounds like you already knew that you can use an expression in the reportname parameter of the subreport, but instead of returning the empty value you can just call a 'dummy' subreport that consists of only a white background of 1 pixel height and width so that it looks like nothing is there.


    maddog

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply