Viewer Control Object is in a read only state

  • Follow


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?

 
 
0
Reply Utf 12/4/2009 1:18:01 AM

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
==================================================

0
Reply v 12/4/2009 7:57:25 AM


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
> ==================================================
> 
> .
> 
0
Reply Utf 12/4/2009 6:50:01 PM

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: checkraiser@community.nospam <checkraiser@community.nospam>
| References:  <40606789-6E9B-4E65-B092-608AED5F1AC6@microsoft.com> 
<8DxaydLdKHA.828@TK2MSFTNGHUB02.phx.gbl>
| Subject: RE: Viewer Control Object is in a read only state
| Date: Fri, 4 Dec 2009 10:50:01 -0800
| Lines: 40
| Message-ID: <80C7F906-BD47-4CC5-8CF4-AE2A337924B1@microsoft.com>
| 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
| > ==================================================
| > 
| > .
| > 
| 

0
Reply v 12/7/2009 6:25:00 AM

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

0
Reply v 12/9/2009 9:50:45 AM

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
> 
> .
> 
0
Reply Utf 12/11/2009 1:23:01 AM

.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: checkraiser@community.nospam <checkraiser@community.nospam>
| References:  <40606789-6E9B-4E65-B092-608AED5F1AC6@microsoft.com> 
<8DxaydLdKHA.828@TK2MSFTNGHUB02.phx.gbl> 
<80C7F906-BD47-4CC5-8CF4-AE2A337924B1@microsoft.com> 
<trgmaULeKHA.3976@TK2MSFTNGHUB02.phx.gbl>
| Subject: RE: Viewer Control Object is in a read only state
| Date: Thu, 10 Dec 2009 17:23:01 -0800
| Lines: 35
| Message-ID: <B0C36EF7-6A07-489F-A628-B38C211C0EF5@microsoft.com>
| 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
| > 
| > .
| > 
| 

0
Reply v 12/15/2009 6:18:38 AM

Hi,

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

-- 

Sincerely,
 
Vince Xu
 
Microsoft Online Support

--------------------
| X-Tomcat-ID: 25549944
| References: <40606789-6E9B-4E65-B092-608AED5F1AC6@microsoft.com> 
<8DxaydLdKHA.828@TK2MSFTNGHUB02.phx.gbl> 
<80C7F906-BD47-4CC5-8CF4-AE2A337924B1@microsoft.com> 
<trgmaULeKHA.3976@TK2MSFTNGHUB02.phx.gbl> 
<B0C36EF7-6A07-489F-A628-B38C211C0EF5@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: v-vincex@online.microsoft.com (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: <fwDW55UfKHA.5176@TK2MSFTNGHUB02.phx.gbl>
| 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: checkraiser@community.nospam <checkraiser@community.nospam>
| | References:  <40606789-6E9B-4E65-B092-608AED5F1AC6@microsoft.com> 
| <8DxaydLdKHA.828@TK2MSFTNGHUB02.phx.gbl> 
| <80C7F906-BD47-4CC5-8CF4-AE2A337924B1@microsoft.com> 
| <trgmaULeKHA.3976@TK2MSFTNGHUB02.phx.gbl>
| | Subject: RE: Viewer Control Object is in a read only state
| | Date: Thu, 10 Dec 2009 17:23:01 -0800
| | Lines: 35
| | Message-ID: <B0C36EF7-6A07-489F-A628-B38C211C0EF5@microsoft.com>
| | 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
| | > 
| | > .
| | > 
| | 
| 
| 



0
Reply v 12/17/2009 9:47:56 AM

7 Replies
652 Views

(page loaded in 0.341 seconds)

Similiar Articles:
















7/26/2012 6:09:31 PM


Reply: