This is a migrated thread and some comments may be shown as answers.

Error on add of Report Viewer

3 Answers 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 28 Jul 2010, 05:07 PM
Hello,

    I'm new to Telerik Reporting, heck I'm still using a trial... but I'm getting this error while trying to put a Report Viewer onto an aspx page within an already built web application as a trial run.....
    

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)


It is an ASP.NET 2.0 web page that has a master page.... 

I did build the report in a separate class library, and it works fine (connecting to a MySQL database and retrieving a simple set of data).

this is the code for the aspx page..... I've added no code to the aspx.cs ..... as it is not needed to view a report (I've done a trial run on a new web site earlier as another test, but now i'm trying to incorporate a report into a system)

===========================================================================================================

<%@ Page Language="C#" MasterPageFile="~/ApplicationLayout.master" AutoEventWireup="true" CodeFile="TestReporting.aspx.cs" Inherits="TelerikTest_TestReporting" Title="Telerik Test" %>

<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=4.0.10.423, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
    Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div>
        <telerik:ReportViewer ID="ReportViewer1" runat="server">
        </telerik:ReportViewer>
    </div>
</asp:Content>

======================================================================================================

At the moment.... I'm not connecting it to any report, as I just need to know if the viewer will display.... but it does not, I just get that error.

Oh, and I have searched this forum earlier for anything related to this error..... If I take the runat="server" away from the report viewer, the viewer does not show up on the page at all, but I don't see that error message come up.....

what do I do to get the viewer to display..... after I have it working can I attach a report to it.....   please help

Amit Missra

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 29 Jul 2010, 10:10 AM
Hello Amit,

This is a generic error that might occur due to various reasons not directly related to Telerik Reporting. For one thing, you're most likely using ASP.NET AJAX in your web page and have placed script in element with runat=server attribute. Check out the following threads that elaborate on how to escape such problems.

Sincerely yours,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Amit
Top achievements
Rank 1
answered on 04 Aug 2010, 03:29 PM
Hello again,

    Generic or not, it's still an issue.... but I have tracked it down quite a bit....
 
    As I mentioned before, the runat="server" was NOT the issue.  Excluding that from the report viewer, only caused the viewer to not appear on the page.

    The issue does not related to just the add of the report viewer, but has to do with assignment and javascript in the master page associated with the page I'm trying to add the report viewer on.

    In the master page there are code blocks with the %= characters within.... I found a link that stated that I should replace that sequence of characters %= with %# to get the report viewer to work...... it did.  However, replacing those characters in the master page for the whole system caused OTHER parts of the web application to stop functioning......

   Is there any other way to get the report viewer to work, without having to change the master page of the whole system?

Amit
0
Steve
Telerik team
answered on 09 Aug 2010, 06:19 PM
Hi Amit,

Can you point us to the topic where we've stated that you should replace the code blocks with %#?
If you're still having problems and believe that the error comes from the Report Viewer, please prepare and send us a sample project that shows the problematic behavior and we would advise you once we review it.

All the best,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Amit
Top achievements
Rank 1
Answers by
Steve
Telerik team
Amit
Top achievements
Rank 1
Share this question
or