Sub Reports and Grow issue

Posted by: hbkelkar on 4 March 2025, 9:34 am EST

    • Post Options:
    • Link

    Posted 4 March 2025, 9:34 am EST - Updated 4 March 2025, 9:56 am EST

    Hello Team

    I am having trouble in understanding how sub report is behaving when it expands.

    There are 3 subreports placed in parent.

    sub report 1 and two kept adjacent to each other and sub report-3 just below sub report-1.

    But the Sub-report-3 is shown after length of sub report-2. Found no setting in property to correct this.

    I am using Active Reports 11.3x

    My requirement is to expand Sub reports without affecting others placement.

    I have attached the picture with explains my trouble :frowning:

    Pls assist to achieve my goal.

  • Posted 4 March 2025, 9:35 am EST - Updated 4 March 2025, 9:40 am EST

  • Posted 5 March 2025, 1:21 am EST

    Even after repositioning the Sub.Rep-3 and other two labels below back (subrep-1.top + subrep1.height) in the AfterPrint event is not helping.

    Report height is still increased ?

    Can’t figure out what’s wrong in this placement.

  • Posted 5 March 2025, 7:55 am EST

    Hi Hemanth,

    Please set the SubReport2.Top on BeforePrint event.

    Sample Code

    public void Detail_BeforePrint()
    {
    	this.SubReport3.Top = 1.125f;	
    }
    

    Regards,

    Akshay

  • Posted 5 March 2025, 10:42 am EST

    Hi,

    No Luck Akshay.

    I tried the above code with specific positioning.

    Private Sub Detail_BeforePrint(sender As Object, e As EventArgs) Handles Detail.BeforePrint
    
        SubRptCoS_C.Top = (SubRptCoS_A.Top + SubRptCoS_A.Height) + 0.5
    
        lblFaculty.Top = 19.69
        lblParent.Top = 19.69
        lblPrincipal.Top = 19.69
    
        lineControl.Top = 17  
        picWish.Top = 17.58
    
    End Sub
    

    But I think the report canvas is already pushed further. As you can see in the attached image, the content is pushed to the next page.

    Why the the height of Sub report-2 is affecting the top (placed position) of subreport-3?

    Is there any setting to make height of each sub report independent?

    Sub-report-Positioning_AfterPrint.zip

  • Posted 6 March 2025, 3:14 am EST - Updated 6 March 2025, 3:20 am EST

    Hi Hemanth,

    So the rendering of the controls occurs from Left → Right and then Top → Bottom.

    So assuming the layout is like this:

    | SubReport 1 | SubReport 2|

    | SubReport 3 |

    If the SubReport2 Expands the SubReport 3 will move downwards.

    I can suggest you three other solutions for this. The solutions are listed in the order of increasing complexity:

    1. I would suggest you to make sure the SubReport3 starts before SubReport 2 ends. See Screenshot:

    1. Create a Parent SubReport for SubReport 1 and SubReport 3. This way SubReport 1 and SubReport 3 will render before SubReport 2.

    2. Use RDL Reports instead, in RDL Reports you can use a Container Control to encapsulate the SubReport control ensuring the Controls in the Containers are grouped together and rendered together and does not lower their height based on adjacent controls

    I hope this helps you decide the solution optimal for your usecase.

    Regards,

    Akshay

  • Posted 6 March 2025, 4:10 am EST

    Hi Akshay,

    Thanks for the detailed options available. Understood the ordering of subreport rendering.

    I think i should go with solution-1.

    Will let you know the status.

    However, as an adhoc measure, I have made an alternative. I have used subreport-1 to show items of subreport-3 based on grouping.

    For better resolution, I’ll try Solution-1.

    Thanks for good support as always.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels