Use same report as standalone or sub-report

4 posts, 0 answers
  1. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 28 May 2011 Link to this post

    I have an application where we would like to combine several individual reports into one master report.

    I created all six of the sub-reports, and they each have specific report header sections which describe the content.

    When embedding these reports, I need to suppress the display of the report header.

    I am thinking I can either make that section invisible by default, and then change to visible when the report runs all by itself.

    Or the opposite, making the header invisible when I detect that the report is contained inside a parent report.

    Question #1: is there a way within the sub-port code to determine if there is a "parent"?

    Question #2: is there a way to access the sub-report header setting (visibility) from within the code of the master report?

    As an example, in another thread I learned how to set properties in the main report. I am lacking in the knowledge of how to dig deeper into the content of the subreports. In effect, "....some kind of cast....some report property.....find something or other inside subreport1..."

    Dim report As Telerik.Reporting.Report = DirectCast(Me.ReportViewer1.Report, Telerik.Reporting.Report)
    Dim txt As Telerik.Reporting.HtmlTextBox = TryCast(report.Items.Find("filter_description", True)(0), Telerik.Reporting.HtmlTextBox)
    txt.Value = HttpContext.Current.Session("grid_title")
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 30 May 2011 Link to this post

    Hi Tomica,

    According to your scenario description, a better option would be to use the Report Book feature which main purpose is combining different reports into one. Unlike the SubReports, each report part of a report book keeps its page sections and layout.

    Regards,
    Steve
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 30 May 2011 Link to this post

    I was under the impression that each report in the "book" would start out on a new page.

    As the sub-report sections vary significantly in size, sometimes only a few lines, there would be too much whitespace (i.e. jump to new page).

    I resolved this in the sub-report scenario by removing the "keep together" setting.

    Is there a similar option with report books?
  5. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 31 May 2011 Link to this post

    Hi Tomica,

    The by design behavior of the ReportBook item is to start the reports on a new page. If you have lots of small reports and you want to show them continuously on the page it makes sense to utilize SubReports instead.

    Best wishes,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top