Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 807969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:29:15+00:00 2026-05-15T00:29:15+00:00

My problem relates to trying to include an SSRS (SQL Server) Report inside my

  • 0

My problem relates to trying to include an SSRS (SQL Server) Report inside my MVC application.

I’ve settled on the hybrid solution of having a WebForm with the ReportViewer Control in and then on my MVC View pages having an iframe reference this WebForm page. The tricky part is that the iframe needs to be dynamically populated with the report rather than using src due to posting parameters to the WebForm.

It works perfectly in Firefox and Chrome, however IE throws a “Sys is Undefined” javascript error.

Using src on the iframe works in IE, but I can’t find a way to post parameters (don’t want to use something like /Report.aspx?param1=test due to the possible length).

Its a ASP.NET MVC 2 project, .NET 4, Visual Studio 2010 on Windows 7 x74 if its any help.

So here is the code (I could provide the VS2010 project files if anyone wants them)

In my webform:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Report.aspx.cs" Inherits="SSRSMVC.Views.Home.Report" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <form id="RSForm" runat="server">

    <asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="true" ScriptMode="Release">
    </asp:ScriptManager>

    <asp:UpdatePanel ID="ReportViewerUP" runat="server">
        <ContentTemplate>
            <rsweb:ReportViewer ID="ReportViewer" runat="server" Width="100%" Height="380px" ProcessingMode="Local"
             InteractivityPostBackMode="AlwaysAsynchronous" AsyncRendering="true">
                <LocalReport ReportPath="Models\\TestReport.rdlc">

                </LocalReport>
            </rsweb:ReportViewer>
        </ContentTemplate>
    </asp:UpdatePanel>

    </form>
</body>
</html>

And Codebehind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;

namespace SSRSMVC.Views.Home
{
    public partial class Report : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string test = Request.Params["val1"];

                ReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", new SSRSMVC.Models.DataProvider().GetData()));
            }
        }
    }
}

And lastly my View page,

<script type="text/javascript">
    $(window).load(function () {
        $.post('/Report.aspx', { val1: "Hello World" }, function (data) {
            var rv_frame = document.getElementById('Frame1');
            rv_frame = (rv_frame.contentWindow) ? rv_frame.contentWindow : (rv_frame.contentDocument.document) ? rv_frame.contentDocument.document : rv_frame.contentDocument;

            rv_frame.document.open();
            rv_frame.document.write(data);
            rv_frame.document.close();
        });
    });
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:29:16+00:00Added an answer on May 15, 2026 at 12:29 am

    The solution appears to be to use a form element to post and then populate the iframe, I’ve also posted a Microsoft Connect bug as any Microsoft AJAX inside an iframe causes the JavaScript error “sys is undefined”, I tried 1 script manager and 1 update panel and got the same error.

    Workaround code,

    <div id="HiddenFormTarget" style="display:none;"></div>
    
    <iframe frameborder="0" id="Frame1" name="Frame1" style="width: 100%;height: 400px; overflow: hidden;">
    </iframe>
    
    <script type="text/javascript">
        function ProcessReport() {
            var form = $('<form method="post" target="Frame1" action="/Report.aspx"></form>');
            form.append('<input type="hidden" id="val1" name="val1" value="Hello World!!!" />');
    
            $("#HiddenFormTarget").append(form);
    
            form.submit();
    
            $("#HiddenFormTarget").empty();
        }
    
        $(window).load(function () {
            ProcessReport();
        });
    
        $("H2").click(function () { ProcessReport(); });
    </script>
    

    http://connect.microsoft.com/VisualStudio/feedback/details/561066/reportviewer-2010-iframe-internet-explorer

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 401k
  • Answers 401k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer From an answer at http://forums.oracle.com/forums/thread.jspa?messageID=1791550 this might work, but don't… May 15, 2026 at 4:35 am
  • Editorial Team
    Editorial Team added an answer This is obviously implementation dependent but, on most implementations, the… May 15, 2026 at 4:35 am
  • Editorial Team
    Editorial Team added an answer It might be better to load your data into a… May 15, 2026 at 4:35 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.