Get Group from a Report in Report Script

Posted by: image322 on 20 February 2019, 1:07 am EST

    • Post Options:
    • Link

    Posted 20 February 2019, 1:07 am EST

    I would like to get group from a report, but has no clue.

    The sample are show below:

    for each thisGP1 as object in me.???

    if typeof(thisGP1) is

    Grapecity.ActiveReports.SectionReportModel.ReportHeader

    or typeof(thisGP1) is

    Grapecity.ActiveReports.SectionReportModel.PageHeader then

    ’ do something

    end if

    next

    I found that me.controls is not supported in your script.

    Help please …

  • Posted 22 February 2019, 3:00 am EST

    Hello,

    You can fetch GroupHeader / GroupFooter or any other section, using script as mentioned below:

    Dim gh As Type = Me.GroupHeader1.GetType
    Dim t3 As Type = GetType(GrapeCity.ActiveReports.SectionReportModel.GroupHeader)
    
    If gh.Equals(t3) Then
                TextBox3.Text = "It is the Group Header"
    End If
    
    

    This has been implemented for your reference, in the attached report. Here, we have added text to the fields in particular sections, based on the section we fetch.

    I found that me.controls is not supported in your script.

    You can use “Me.FieldName” instead:

    
    Sub ActiveReport_ReportStart
      Me.txt.BackColor=Color.Red
      Me.txt.Value="123"	
    End Sub
    
    

    Further, sections and fields from current report instance can be accessed using the “rpt” object, as shown in the below mentioned documentation link:

    https://help.grapecity.com/activereports/webhelp/AR13/webframe.html#UsingScriptinaSectionReport.html

    Best Regards,

    Esha

    GetGroupInScript.zip

Need extra support?

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

Learn More

Forum Channels