C
Chris McKenzie
I'm developing a server control to automatically display UI associated with
a report developed in SQL Server Reporting Services. One of the things I
want to do is to optionally display boolean parameters as a checkbox or a
radiobuttonlist.
I created an enum as follows:
Public Enum BooleanDisplayType
CheckBox
Radiobutton
End Enum
and an associated property as follows:
Public Property DisplayBooleanControlAs() As BooleanDisplayType
Get
Dim o As Object =
Me.ViewState(Me.GetPropertyLookup(PropertyLookup.BooleanControl))
Return CType(IIf(IsNothing(o), BooleanDisplayType.CheckBox, o),
BooleanDisplayType)
End Get
Set(ByVal Value As BooleanDisplayType)
Me.ViewState(Me.GetPropertyLookup(PropertyLookup.BooleanControl)) =
Value
End Set
End Property
I can drag/drop the control onto the webform without issue, but if I change
the default value for Control.DisplayBooleanControlAs, I get an error when
the Page tries to init.
Compiler Error Message: BC30456: 'ReportParamViewer' is not a member of
'System.Web.UI.ControlCollection'.
Here is the code from the aspx page:
<cc1:ReportParamViewer id=rpViewer
style="Z-INDEX: 105; LEFT: 552px; POSITION: absolute; TOP: 118px"
runat="server"
Height="542px" Width="577px" ResizeToFitContents="True" Columns="2"
BackColor="Linen"
BorderColor="Maroon" BorderStyle="Solid" BorderWidth="1px"
ForeColor="MediumOrchid"
Font-Names="Lucida Console" ParametersHeader="This is a test Report"
Font-Bold="True"
DisplayBooleanControlAs="Radiobutton">
</cc1:ReportParamViewer>
If I leave everything exactly as it is, and remove the last portion of the
ReportParamViewer declaration ("DisplayBooleanControlAs='RadioButton'") then
everything compiles and runs fine. If the value of DisplayBooleanControlAs
= "RadioButton" or "CheckBox", I get an the above compiler error. It
appears as if "RadioButton" and "CheckBox" are treated as reserved words by
the compiler--which doesn't make sense for attributes of a control element.
Can anyone confirm / deny this? Does anyone have any other ideas?
Thanks,
Chris
a report developed in SQL Server Reporting Services. One of the things I
want to do is to optionally display boolean parameters as a checkbox or a
radiobuttonlist.
I created an enum as follows:
Public Enum BooleanDisplayType
CheckBox
Radiobutton
End Enum
and an associated property as follows:
Public Property DisplayBooleanControlAs() As BooleanDisplayType
Get
Dim o As Object =
Me.ViewState(Me.GetPropertyLookup(PropertyLookup.BooleanControl))
Return CType(IIf(IsNothing(o), BooleanDisplayType.CheckBox, o),
BooleanDisplayType)
End Get
Set(ByVal Value As BooleanDisplayType)
Me.ViewState(Me.GetPropertyLookup(PropertyLookup.BooleanControl)) =
Value
End Set
End Property
I can drag/drop the control onto the webform without issue, but if I change
the default value for Control.DisplayBooleanControlAs, I get an error when
the Page tries to init.
Compiler Error Message: BC30456: 'ReportParamViewer' is not a member of
'System.Web.UI.ControlCollection'.
Here is the code from the aspx page:
<cc1:ReportParamViewer id=rpViewer
style="Z-INDEX: 105; LEFT: 552px; POSITION: absolute; TOP: 118px"
runat="server"
Height="542px" Width="577px" ResizeToFitContents="True" Columns="2"
BackColor="Linen"
BorderColor="Maroon" BorderStyle="Solid" BorderWidth="1px"
ForeColor="MediumOrchid"
Font-Names="Lucida Console" ParametersHeader="This is a test Report"
Font-Bold="True"
DisplayBooleanControlAs="Radiobutton">
</cc1:ReportParamViewer>
If I leave everything exactly as it is, and remove the last portion of the
ReportParamViewer declaration ("DisplayBooleanControlAs='RadioButton'") then
everything compiles and runs fine. If the value of DisplayBooleanControlAs
= "RadioButton" or "CheckBox", I get an the above compiler error. It
appears as if "RadioButton" and "CheckBox" are treated as reserved words by
the compiler--which doesn't make sense for attributes of a control element.
Can anyone confirm / deny this? Does anyone have any other ideas?
Thanks,
Chris