My question is, is there a way to change the url without refreshing the whole web page when an hyperlink from the SSRS Report is clicked?
I tried 2 different implementations of hyperlink in SSRS Report RDLC which are indicated here: SSRS: How to display a hyperlink in sql services reporting
1st Way Textbox Properties > Action pane > Go to URL radio button > Selected URL: http:// localhost:(port)/#/Path/ViewDetails
2nd Way Create Placeholder > Right click > Placeholder Properties > General Pane > On Markup type: HTML - Interpret HTML tags at styles > Value: ="< a href="http:// localhost:(port)/#/Path/ViewDetails">View Details< /a>"
I have an MVC project that uses AngularJS and has implemented local processing mode of SSRS Report Viewer. The Report Viewer was implemented in an ASPX page (MVC.ViewPage)
ReportViewer.aspx
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<SampleProject.Models.ReportInfo>" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="scriptManager" runat="server" ScriptMode="Release"></asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer" runat="server"
SizeToReportContent="true" AsyncRendering="false" Visible="true"
ProcessingMode="Local" EnableViewState="true"
InternalBorderStyle="None" BorderStyle="None" InternalBorderWidth="0"
KeepSessionAlive="false" >
</rsweb:ReportViewer>
</form>
<script runat="server">
override protected void OnInit(EventArgs e){
// some report viewer initialization here
// some datasource data population code here
}
</script>
I put load this ASPX page into an IFrame of an MVC Partial View.
ViewDetail.cshtml
<div>
<iframe src="{{report.viewDetailPath}}"></iframe>
</div>
viewDetail.js (AngularJS Controller)
angular.module('project').controller("ViewDetailCtrl", function($scope){
$scope.report = {
id: // some guid,
viewDetailPath: '/Reports/ReportViewer';
}
}
I have a RDLC report with an hyperlink "View Detail".
I want my app to behave like a Single Page Application. When I click the "View Detail" link from the report, instead of refreshing the whole page, it will only change the URL and execute a javascript method from the AngularJS controller.
I have also implemented a $routeProvider of AngularJS in order to look like a single page application.
app.js
project.config(function($routeProvider){
$routeProvider.
when('/', {template: 'NYI'}).
when('/Path/ViewDetails', {controller: 'ViewDetailCtrl', templateUrl: '/Reports/ViewDetail'}).
otherwise({redirectTo: '/'});
});
ReportsController.cs(MVC Controller)
public PartialViewResult ViewDetail(){
return PartialView("~/Views/Reports/ViewDetail.cshtml");
}
public ActionResult ReportViewer(){
return View("~/Views/Reports/ReportViewer.aspx", new ReportInfo());
}
The $routeProvider to make the application like a single page app, does not work when the SSRS Report hyperlink changed the URL.