Viewer Control Object is in a read only state

  • Thread starter Thread starter checkraiser
  • Start date Start date
C

checkraiser

I'm displaying an RDLC file in a Reporting Viewer Control in an aspx page.
The page accepts parameters from a dropdownlist control. Intermittently, I'm
getting an error that the Viewer Control Object is in a read only state on my
aspx page. From the event viewer logs, it appears that this is coming from
my OnSelectedIndexChanged event.

at Microsoft.Reporting.WebForms.ReportViewer.OnReportChanged(Object
sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at Microsoft.Reporting.WebForms.Report.OnChange()
at Microsoft.Reporting.WebForms.LocalReport.Refresh()
at mymktpage.ddlCCode_SelectedIndexChanged(Object sender, EventArgs e)
at System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs
e)
at System.Web.UI.WebControls.DropDownList.RaisePostDataChangedEvent()
at
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent()
at System.Web.UI.Page.RaiseChangedEvents()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


I do have the dropdown set to autopostback=true and the
onselectedindexchanged property set to go to the event
ddlCCode_SelectedIndexChanged, but I'm not really doing anything inside the
event. I'm just trying to trigger the postback when the value is changed on
the dropdown.

Any ideas on what's causing this?
 
Hello,

Did you use any code behind on Report Viewer control in Initial, PageLoad
or other events which are executed before OnPreRenderCompleted event?
We have to modify the properties of Report Viewer or do some code on Report
Viewer after OnPreRenderComplete event. Otherwise, it will encounter the
client error "Viewer Control Object is in a read only state".


--
Sincerely,

Vince Xu

Microsoft Online Support


==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

MSDN Managed Newsgroup support offering is for non-urgent issues where an
initial response from the community or a Microsoft Support Engineer within
2 business day is acceptable. Please note that each follow up response may
take approximately 2 business days as the support professional working with
you may need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
 
Yes, I do have logic--parameter processing--in the pageload event. How do I
get around the error?
 
Hi,

You can put the related code on ReportViewer into OnPreRenderComplete event
instead of PageLoad.

--
Sincerely,

Vince Xu

Microsoft Online Support

--------------------
| Thread-Topic: Viewer Control Object is in a read only state
| thread-index: Acp1EpWEdGuNHKGWQlWznRSLqOCYgQ==
| X-WBNR-Posting-Host: 198.246.249.35
| From: (e-mail address removed) <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: RE: Viewer Control Object is in a read only state
| Date: Fri, 4 Dec 2009 10:50:01 -0800
| Lines: 40
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:94801
| NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Yes, I do have logic--parameter processing--in the pageload event. How
do I
| get around the error?
|
| "Vince Xu [MSFT]" wrote:
|
| > Hello,
| >
| > Did you use any code behind on Report Viewer control in Initial,
PageLoad
| > or other events which are executed before OnPreRenderCompleted event?
| > We have to modify the properties of Report Viewer or do some code on
Report
| > Viewer after OnPreRenderComplete event. Otherwise, it will encounter
the
| > client error "Viewer Control Object is in a read only state".
| >
| >
| > --
| > Sincerely,
| >
| > Vince Xu
| >
| > Microsoft Online Support
| >
| >
| > ==================================================
| > Get notification to my posts through email? Please refer to
| >
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
| >
| > MSDN Managed Newsgroup support offering is for non-urgent issues where
an
| > initial response from the community or a Microsoft Support Engineer
within
| > 2 business day is acceptable. Please note that each follow up response
may
| > take approximately 2 business days as the support professional working
with
| > you may need further investigation to reach the most efficient
resolution.
| > The offering is not appropriate for situations that require urgent,
| > real-time or phone-based interactions. Issues of this nature are best
| > handled working with a dedicated Microsoft Support Engineer by
contacting
| > Microsoft Customer Support Services (CSS) at
| > http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
| > ==================================================
| >
| > .
| >
|
 
Hi,

Did you resolve this issue?

This is Vince Xu from MSDN Managed Newsgroup support team, since I
haven't seen your reply after I last posted my reply. Please feel free
to let me know if there's anything else I can help. Thanks.

--
Sincerely,

Vince Xu

Microsoft Online Support
 
Hi Vince,

Unfortunately, I ran into another problem. I'm adding parameters to the
datasource in Page Load. If I move the parameter add logic to the
pre-render event that you mention, the object data source which is a tag on
the aspx page, fires the getdata method PRIOR to the parameters being added
in the pre-render event. In contrast, when the parameters are added in the
page load event instead of the pre render event, the parameters get added
first and then the get data method fires off. So how do I get around this
issue?

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetData"
TypeName="MyTableAdapters.MyTableAdapter">
</asp:ObjectDataSource>
 
aspx file
Hi,

You can't modify the properties of Report Viewerin Page Load, but you can
do it on Local DataSource in Page Load.

I listed a sample as below, hope that can help you.

HTML:

<rsweb:ReportViewer ID="ReportViewer1" runat="server"
Font-Names="Verdana"
Font-Size="8pt" Height="400px" Width="400px">
<LocalReport ReportPath="TestReport.rdlc">
<DataSources>
<rsweb:ReportDataSource
DataSourceId="ObjectDataSource1"
Name="GalacticDataSet_Customer" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetData"
TypeName="GalacticDataSetTableAdapters.CustomerTableAdapter">
</asp:ObjectDataSource>

Code Behind:

protected void Page_Load(object sender, EventArgs e)
{
ReportParameter rp = new ReportParameter("CustomerNO", "34938");
// Pass the value to the report parameter.
ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp
});
ReportViewer1.LocalReport.Refresh();
}


--
Sincerely,

Vince Xu

Microsoft Online Support

--------------------
| Thread-Topic: Viewer Control Object is in a read only state
| thread-index: Acp6AHrQuQMx/QRETVS2ufm8+ucjMw==
| X-WBNR-Posting-Host: 198.246.249.35
| From: (e-mail address removed) <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: RE: Viewer Control Object is in a read only state
| Date: Thu, 10 Dec 2009 17:23:01 -0800
| Lines: 35
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:94996
| NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi Vince,
|
| Unfortunately, I ran into another problem. I'm adding parameters to the
| datasource in Page Load. If I move the parameter add logic to the
| pre-render event that you mention, the object data source which is a tag
on
| the aspx page, fires the getdata method PRIOR to the parameters being
added
| in the pre-render event. In contrast, when the parameters are added in
the
| page load event instead of the pre render event, the parameters get added
| first and then the get data method fires off. So how do I get around
this
| issue?
|
| <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
| SelectMethod="GetData"
| TypeName="MyTableAdapters.MyTableAdapter">
| </asp:ObjectDataSource>
|
| "Vince Xu [MSFT]" wrote:
|
| > Hi,
| >
| > Did you resolve this issue?
| >
| > This is Vince Xu from MSDN Managed Newsgroup support team, since I
| > haven't seen your reply after I last posted my reply. Please feel free
| > to let me know if there's anything else I can help. Thanks.
| >
| > --
| > Sincerely,
| >
| > Vince Xu
| >
| > Microsoft Online Support
| >
| > .
| >
|
 
Hi,

Did you resolve the issue? I look forword for you response.

--

Sincerely,

Vince Xu

Microsoft Online Support

--------------------
| X-Tomcat-ID: 25549944
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Vince Xu [MSFT])
| Organization: Microsoft
| Date: Tue, 15 Dec 2009 06:18:38 GMT
| Subject: RE: Viewer Control Object is in a read only state
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 94
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:95069
| NNTP-Posting-Host: tk2tomimport1.phx.gbl 10.230.18.247
|
|
| .aspx file
| Hi,
|
| You can't modify the properties of Report Viewerin Page Load, but you can
| do it on Local DataSource in Page Load.
|
| I listed a sample as below, hope that can help you.
|
| HTML:
|
| <rsweb:ReportViewer ID="ReportViewer1" runat="server"
| Font-Names="Verdana"
| Font-Size="8pt" Height="400px" Width="400px">
| <LocalReport ReportPath="TestReport.rdlc">
| <DataSources>
| <rsweb:ReportDataSource
| DataSourceId="ObjectDataSource1"
| Name="GalacticDataSet_Customer" />
| </DataSources>
| </LocalReport>
| </rsweb:ReportViewer>
| <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
| SelectMethod="GetData"
| TypeName="GalacticDataSetTableAdapters.CustomerTableAdapter">
| </asp:ObjectDataSource>
|
| Code Behind:
|
| protected void Page_Load(object sender, EventArgs e)
| {
| ReportParameter rp = new ReportParameter("CustomerNO", "34938");
| // Pass the value to the report parameter.
| ReportViewer1.LocalReport.SetParameters(new ReportParameter[] {
rp
| });
| ReportViewer1.LocalReport.Refresh();
| }
|
|
| --
| Sincerely,
|
| Vince Xu
|
| Microsoft Online Support
|
| --------------------
| | Thread-Topic: Viewer Control Object is in a read only state
| | thread-index: Acp6AHrQuQMx/QRETVS2ufm8+ucjMw==
| | X-WBNR-Posting-Host: 198.246.249.35
| | From: (e-mail address removed) <[email protected]>
| | References: <[email protected]>
| <[email protected]>
| <[email protected]>
| <[email protected]>
| | Subject: RE: Viewer Control Object is in a read only state
| | Date: Thu, 10 Dec 2009 17:23:01 -0800
| | Lines: 35
| | Message-ID: <[email protected]>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | Path: TK2MSFTNGHUB02.phx.gbl
| | Xref: TK2MSFTNGHUB02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:94996
| | NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | Hi Vince,
| |
| | Unfortunately, I ran into another problem. I'm adding parameters to the
| | datasource in Page Load. If I move the parameter add logic to the
| | pre-render event that you mention, the object data source which is a
tag
| on
| | the aspx page, fires the getdata method PRIOR to the parameters being
| added
| | in the pre-render event. In contrast, when the parameters are added in
| the
| | page load event instead of the pre render event, the parameters get
added
| | first and then the get data method fires off. So how do I get around
| this
| | issue?
| |
| | <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
| | SelectMethod="GetData"
| | TypeName="MyTableAdapters.MyTableAdapter">
| | </asp:ObjectDataSource>
| |
| | "Vince Xu [MSFT]" wrote:
| |
| | > Hi,
| | >
| | > Did you resolve this issue?
| | >
| | > This is Vince Xu from MSDN Managed Newsgroup support team, since I
| | > haven't seen your reply after I last posted my reply. Please feel free
| | > to let me know if there's anything else I can help. Thanks.
| | >
| | > --
| | > Sincerely,
| | >
| | > Vince Xu
| | >
| | > Microsoft Online Support
| | >
| | > .
| | >
| |
|
|
 
Back
Top