Issue with inablility to change width of textbox in subreport

Posted by: charlie.widdicombe on 10 January 2019, 5:03 am EST

    • Post Options:
    • Link

    Posted 10 January 2019, 5:03 am EST

    Hello,

    I am working on an application useing ActiveReports 12. There is a particular subreport that is used in a number of different reports that consists of a single textbox in the details section. I am currently having an issue with being unable to wrap the text in that textbox if the width of the subreport control is less than that of the subreport I am trying to populate it with. As it is now the text is simply cut off.

    I have tried setting the printwidth of the report to be equal to that of the control to no avail. The problem seems to be that the width of the textbox in the subreport is greater than that of the subreport control, since when I change the size of the textbox in the subreports designer to be sufficiently small it wraps as it should. However since this subreport is used in several different places with different sizes changing the size of the subreport this way is not a practical solution.

    The best solution would be to change the width of that textbox when running the report, but I have been unable to figure out a way to do so. I have tried changing the size of the control before it is assigned to the control. I was wondering if someone could help me resolve the issue.

  • Posted 10 January 2019, 4:15 pm EST

    Hello,

    To change the height of the Textbox at run time, I would suggest you to use the “Detail’s” Format event. I have created the sample for you to implemented the same. Please refer to the attachment.

    Hope it helps.

    Thanks.

    rpt_Runtime.zip

  • Posted 11 January 2019, 2:55 am EST

    I’m not sure the essence of the problem came across.

    The issue I am having is that I am trying to get the text on a subreport that is used in several different places with different widths on a report to wrap correctly everywhere it is used. There are places on the parent report where the space allocated for the subreport is shorter than in other places, which is causing text to be cut off.

    The problem is that the textbox in the subreport is longer than the subreport control on its parent form. I have not been able to change the width of the textbox in a subreport from its parent report, and I would prefer not to have to make type of subreport for every place where that subreport is used in our application.

    For example I have tried setting the text box width before assigning it.

    Dim subrep = New SubReportReport

    subrep.textbox1.width = 3

    SubReportControl.Report = subrep

    Which does not correctly change the length of the textbox in the subreport.

    I have also tried setting the printwidth of the of the subreport equal to the width of the subreport control similar to

    subReportControl.Report.printwidth = subReportControl.width

    but this does does not solve the problem of the text failing to wrap.

    I would like to know if there is something I can do to correct this specific problem.

  • Posted 13 January 2019, 5:59 pm EST

    Hello,

    I have created the project for you to change the width of the “TextBox” of subreport through Main Report. Please refer to the attached sample.

    Hope it helps.

    Thanks.

    SectionReportApplication2.zip

  • Posted 14 January 2019, 4:27 am EST

    (rptSub.Sections[“Detail”].Controls[“TextBox1”] as GrapeCity.ActiveReports.SectionReportModel.TextBox).Width = .5F;

    This was exactly what I was looking for, thank you very much.

Need extra support?

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

Learn More

Forum Channels