Getting Report Elements Properties from within VB.NET in RDLX reports

Posted by: cchiu on 9 July 2019, 8:26 am EST

    • Post Options:
    • Link

    Posted 9 July 2019, 8:26 am EST

    Hello Folks,

    I am trying to create a RDLx Report with VB.NET Code to pull Width’s of Containers to then calculate and set the widths of secondary containers.

    Something like a Bootstrap Grid where all the Report elements are responsive to each other.

    Looking at the Samples and Documentation for Active Reports 12, I found that you can call (Dim rpt As New GrapeCity.ActiveReports.PageReport())

    and then use a While loop to cycle through ReportITems and adjust various Item selected Properties.

    EX…

    Do While (i <= (rpt.Report.Body.ReportItems.Count - 1))

    Dim a As String = rpt.Report.Body.ReportItems(i).Name

    If (a = “TextBox5”) Then

    Dim temp As Style = New GrapeCity.ActiveReports.PageReportModel.Style

    temp.BackgroundColor = “LightPink”

    temp.Color = “DarkGreen”

    rpt.Report.Body.ReportItems(a).Style = temp

    rpt.Report.Body.ReportItems(a).Left = “2in”

    rpt.Report.Body.ReportItems(a).Style.FontFamily = “Algerian”

    rpt.Report.Body.ReportItems(a).Style.FontSize = “20pt”

    rpt.Report.Body.ReportItems(a).Style.FontWeight = “Bold”

    rpt.Report.Body.ReportItems(a).Style.TextAlign = “Center”

    End If

    i = (i + 1)

    Loop

    The Problem is that we are using the Active Reports 12 End User Designer and can only use RDLx Reports with VB.NET

    Is there a Correct way that I can pull Object properties from the End user Designer ?

  • Posted 9 July 2019, 9:56 pm EST

    Hello,

    You should load the existing Rdl report in the PageReport instance as follows, to set the report items’ properties at runtime:

     Dim rpt As New GrapeCity.ActiveReports.PageReport
     rpt.Load(New IO.FileInfo("../../RdlReport1.rdlx"))
    

    An application has been attached for your reference.

    Regards,

    Esha

    RdlReportApplication_RuntimeField.zip

  • Posted 10 July 2019, 1:20 am EST

    Hello Esha,

    Thanks for getting back to me.

    Unfortunately, Loading a RDLx inside the Script would not work in our environment. However, this would work Just fine in environments that would uses VB.NET executables. When Trying to get this to work I get permission errors exceptions in System.IO so it won’t work for us.

    The Environment we have setup currently is using Active Reports Server along with the Web Viewer (Similar to the setup in http://ardemos.grapecity.com/ar12-ReportsGallery/), is there another way that we can modify report elements without having initialize a new instance of a Page Report, essentially having the script modify the Report Items post initialization or During Runtime ?

    If it helps, all we are trying to do is Adjust a Container size based on a Script’s Return Variable. (Unfortunately the End User Designer does not allow me to setup =Code.GetColumnWidth() as the size for the container. Same with Location)

    We want to have Responsive Grid system for report elements where say if there’s a report item that are not shown I want the next Report Item to show up in the above row similar to what you get when you resize a HTML5 window and it starts removing columns and starts stacking elements and separate each item by a given size variable

    Example >> https://codepen.io/legarland/pen/EPZzXq

  • Posted 10 July 2019, 5:43 pm EST

    Hello,

    Sorry, but this is not possible. The generated report is what is seen in the HTML5 Viewer. It cannot be modified based on the container.

    Regards,

    Esha

Need extra support?

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

Learn More

Forum Channels