Hi
I have reports which all have the SAME Setup_Report routine
eg. to determine the visibility of report items, groups etc.
(This routine is called in the NEW constructor)
Example:
-------------------------
Public Sub New()
InitializeComponent()
Me.Setup_Report()
End Sub
Public Sub Setup_Report()
If Me.ReportParameters("Group1").Value = eGroup.None Then
' No grouping, so clear Groups
Me.Report.Groups.Clear()
Me.TextBoxGroupTitle.Visible = False
-------------------------
This works fine, but I want to move the setup routine
to a Public class so that I can keep all the common code in one place
Example.
-------------------------
IN THE REPORT....
-------------------------
Private Shared myFunc As New MyFunctions ' Global Functions
Public Sub New()
InitializeComponent()
myFunc.Setup_Report(Me)
End Sub
-------------------------
IN A GLOBAL.VB ...
-------------------------
Public Class MyFunctions
Public Sub Setup_Report(ByVal Report As Telerik.Reporting.Report)
MyReport.ReportParameters.Add("CompanyName", ReportParameterType.String, "Bloggs Limited")
Dim TextBoxGroupTitle As TextBox = Report.Items("TextBoxGroupTitle")
TextBoxGroupTitle.Visible = False
-------------------------
In the example above
1) The ReportParameters.Add works
2) The reference to the textbox fails with exception "object reference not set"
Your help greatly appreciated, as this would save massive duplication of setup code....
Kind Regards
Martin
I have reports which all have the SAME Setup_Report routine
eg. to determine the visibility of report items, groups etc.
(This routine is called in the NEW constructor)
Example:
-------------------------
Public Sub New()
InitializeComponent()
Me.Setup_Report()
End Sub
Public Sub Setup_Report()
If Me.ReportParameters("Group1").Value = eGroup.None Then
' No grouping, so clear Groups
Me.Report.Groups.Clear()
Me.TextBoxGroupTitle.Visible = False
-------------------------
This works fine, but I want to move the setup routine
to a Public class so that I can keep all the common code in one place
Example.
-------------------------
IN THE REPORT....
-------------------------
Private Shared myFunc As New MyFunctions ' Global Functions
Public Sub New()
InitializeComponent()
myFunc.Setup_Report(Me)
End Sub
-------------------------
IN A GLOBAL.VB ...
-------------------------
Public Class MyFunctions
Public Sub Setup_Report(ByVal Report As Telerik.Reporting.Report)
MyReport.ReportParameters.Add("CompanyName", ReportParameterType.String, "Bloggs Limited")
Dim TextBoxGroupTitle As TextBox = Report.Items("TextBoxGroupTitle")
TextBoxGroupTitle.Visible = False
-------------------------
In the example above
1) The ReportParameters.Add works
2) The reference to the textbox fails with exception "object reference not set"
Your help greatly appreciated, as this would save massive duplication of setup code....
Kind Regards
Martin