2

I have a SharePoint 2013 farm with SSRS. On this farm, I have two web-apps (A and B). When we created web-app "A", we made some branding customizations to the RSViewerPage.aspx page.

The problem is that now that we have web-app "B" up and running, it is using the same RSViewerPage.aspx page and thus we are seeing the same branding customizations.

Is it possible to point the reports being opened from web-app "B" to a different RSViewerPage.aspx page, and still keep "A" pointed to the customized RSViewerPage.aspx?

Edit: Adding a little clarification

The issue is that SharePoint will still automatically direct reports (.rdl files) to the RSViewerPage.aspx page. I need to know how to make SharePoint automatically direct reports to my custom page, just like it currently does to the RSViewerPage.aspx page.

3 Answers 3

4
+50

The RSViewerPage.aspx is a Out the boxed application page in the _Layouts folder.

Application pages, which are also known as "_layouts" pages, are stored in a site's Microsoft Internet Information Services (IIS) virtual directory and support application implementations. Application pages are shared across all sites on the server, whereas a site page is specific to one site.

Change these files is not recommended, because when microsoft decides to change this page in a future release all your changes are gone.

What you can do is create your own application page.

Copy the RSViewerPage.aspx and rename it, for example RSViewerPageWebAppA.aspx than add your own branding.

Update

To override an applicationpage its also possible to HttpModule

An HTTP module is an assembly that is called on every request made to your application. HTTP modules are called as part of the ASP.NET request pipeline and have access to life cycle events throughout the request. HTTP modules therefore give you the opportunity to examine incoming and outgoing requests and take action based on the request.

First you create a new class that implements the IHttpModule interface

For example

public class RSViewerPageModule : IHttpModule

Add an event to the init function

public void Init(HttpApplication context)
{
  context.PreSendRequestHeaders += this.ChangeApplicationPage;
}

Create the method like

private void ChangeApplicationPage(object sender, EventArgs e)
{
 System.Web.HttpApplication httpApplication = (System.Web.HttpApplication)sender;
 if (httpApplication.Request.Path.Contains("RSViewPage.aspx"))
 {
   string path = httpApplication.Request.Path;
   httpApplication.Context.RewritePath(path.Replace("RSViewPageNew.aspx", @"customfolder/RSViewPageNew.aspx"));
  }
}

After you created the class you must register the module in the web.config This can be done manually, but in a feature its better

<httpModules>
      <add name="RSViewerPageModule" type="<here your type>" />
</httpModules>
3
  • Thanks for the reply, I have already done what you suggest, the issue is that SharePoint will still automatically direct reports (.rdl files) to the RSViewerPage.aspx page. I need to know how to make SharePoint automatically direct reports to my custom page. I will edit my question and clarify this point.
    – Schmalzy
    Jan 10, 2014 at 14:47
  • Updated my answer with another possible method you can use
    – Remko
    Jan 10, 2014 at 18:33
  • Sorry, but I had to unmark this as the answer. This solution caused issues when trying to load cascading parameters on a report. I found a different solution that is now working, and I will post that as the answer.
    – Schmalzy
    Jan 29, 2014 at 16:52
0

I am not sure about this, But here is very good blog( even though its for Sharepoint 2007 & Sql 2005) but still give you idea how to hack the page just like what you want. http://www.codeproject.com/Articles/42556/SharePoint-Report-Viewer-Page-Hacks

0

The solution I ended up using came from a Microsoft Support article, and I am a little embarrassed I didn't think of this before...

  1. Create a copy of the Layouts folder.
  2. For the Site Collection (web-app "A"), Point the IIS Virtual Directory for _layouts/15 to the newly copied layouts folder.
  3. Make modifications for web-app "A" in this directory. (Web-app "B" will then still use the OOTB, unbranded application pages)

Advantages

This method enables the customization of application pages for individual site collections.

Limitations

If a public update, a hotfix package, or a service pack is installed that contains updates to the files in the Layouts folder, the update is not applied to your custom Layouts folder. This method may cause excessive manageability and maintenance issues. Any hard-coded functionality in SharePoint that references the Layouts folder instead of the _layouts virtual directory may not function as expected.

http://support.microsoft.com/kb/944105

1
  • Nice, how did you point the IIS Virtual Directory for _layouts/15 to the newly copied layouts folder. Since I am doing it on IIS 8 how should I do that. Nov 30, 2015 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.