Skip to content

Commit

Permalink
Pushed new NuGet packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Juden committed Feb 28, 2017
1 parent c741c6e commit 4cbda98
Show file tree
Hide file tree
Showing 14 changed files with 389 additions and 341 deletions.
4 changes: 2 additions & 2 deletions AlanJuden.MvcReportViewer.NetCore/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d911da30-3023-413c-97ac-e4901b1ceb7b")]

[assembly: AssemblyVersion("1.0.0.4")]
[assembly: AssemblyFileVersion("1.0.0.4")]
[assembly: AssemblyVersion("1.0.0.5")]
[assembly: AssemblyFileVersion("1.0.0.5")]
2 changes: 1 addition & 1 deletion AlanJuden.MvcReportViewer.NetCore/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.4-*",
"version": "1.0.5-*",
"dependencies": {
"Microsoft.AspNetCore.Html.Abstractions": "1.0.0",
"Microsoft.AspNetCore.Http.Abstractions": "1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions AlanJuden.MvcReportViewer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.4")]
[assembly: AssemblyFileVersion("1.0.0.4")]
[assembly: AssemblyVersion("1.0.0.5")]
[assembly: AssemblyFileVersion("1.0.0.5")]
Binary file not shown.
4 changes: 2 additions & 2 deletions nuget.netcore/AlanJuden.MvcReportViewer.NetCore.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<package >
<metadata>
<id>AlanJuden.MvcReportViewer.NetCore</id>
<version>1.0.4.0</version>
<version>1.0.5.0</version>
<title>AlanJuden.MvcReportViewer.NetCore</title>
<authors>alanjuden</authors>
<owners>alanjuden</owners>
<licenseUrl>https://github.com/alanjuden/MvcReportViewer/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/alanjuden/MvcReportViewer</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>.NetCore Custom Report Viewer control to replace MS Report Viewer on MVC projects (*this is for .NetCore projects only*)</description>
<releaseNotes>Modified the report loading logic to check for any missing required parameters before pre-loading the report.</releaseNotes>
<releaseNotes>Fixed the "find in report" because it wasn't functioning properly. Fixed an issue with Unicode report names not being treated properly. Changed the progress icon from cog to refresh. Attempted a fix for HTTPS SSRS servers.</releaseNotes>
<copyright>Copyright 2017</copyright>
<tags>SSRS ReportViewer MVC Report Viewer Reporting HtmlHelpers Helpers NetCore</tags>
</metadata>
Expand Down
350 changes: 185 additions & 165 deletions nuget.netcore/content/Views/Report/ReportViewer.cshtml
Original file line number Diff line number Diff line change
@@ -1,166 +1,186 @@
@model AlanJuden.MvcReportViewer.ReportViewerModel
@using AlanJuden.MvcReportViewer

@{
ViewBag.Title = "ReportViewer";
Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>ReportViewer</h2>

@section AdditionalHeadContent {
<link type="text/css" rel="stylesheet" href="~/css/select2.min.css" />
<link type="text/css" rel="stylesheet" href="~/css/select2-bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="~/css/mvcreportviewer-bootstrap.css" />
<script type="text/javascript" src="~/js/select2.min.4.0.3.js"></script>
<script type="text/javascript" src="~/js/jquery.highlight-5.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('select').select2();
$('.FirstPage, .ViewReport, .Refresh').click(function () {
if (!$(this).attr('disabled')) {
viewReportPage(1);
}
});
$('.PreviousPage').click(function () {
if (!$(this).attr('disabled')) {
var page = parseInt($('#ReportViewerCurrentPage').val()) - 1;
viewReportPage(page);
}
});
$('.NextPage').click(function () {
if (!$(this).attr('disabled')) {
var page = parseInt($('#ReportViewerCurrentPage').val()) + 1;
viewReportPage(page);
}
});
$('.LastPage').click(function () {
if (!$(this).attr('disabled')) {
var page = parseInt($('#ReportViewerTotalPages').text());
viewReportPage(page);
}
});
$('#ReportViewerCurrentPage').change(function () {
var page = $(this).val();
viewReportPage(page);
});
$('.ExportXml, .ExportCsv, .ExportPdf, .ExportMhtml, .ExportExcelOpenXml, .ExportTiff, .ExportWordOpenXml').click(function () {
exportReport($(this));
});
$('#ReportViewerSearchText').change(function () {
findText();
});
$('.FindTextButton').click(function () {
findText();
});
$('.Print').click(function () {
printReport();
});
});
function showLoadingProgress(message) {
$('.ReportViewerContent').hide();
$('.ReportViewerContentContainer').append('<div class="loadingContainer"><div style="margin: 0 auto; width: 100%; text-align: center; vertical-align: middle;"><h2><i class="glyphicon glyphicon-cog gly-spin"></i>' + message + '</h2></div></div>');
}
function hideLoadingProgress() {
$('.loadingContainer').remove();
$('.ReportViewerContent').show();
}
function printReport() {
var params = $('.ParametersContainer :input').serializeArray();
var urlParams = $.param(params);
window.open("/Report/PrintReport/[email protected]&" + urlParams, "_blank");
}
function findText() {
$('.ReportViewerContent').removeHighlight();
var searchText = $("#ReportViewerSearchText").val();
if (searchText != undefined && searchText != null && searchText != "") {
showLoadingProgress('Searching Report...');
var params = $('.ParametersContainer :input').serializeArray();
var urlParams = $.param(params);
var page = parseInt($('#ReportViewerCurrentPage').val()) + 1;
$.get("/Report/FindStringInReport/[email protected]&page=" + page + "&" + urlParams).done(function (data) {
if (data > 0) {
viewReportPage(data);
}
$('.ReportViewerContent').highlight(searchText);
hideLoadingProgress();
});
}
}
function viewReportPage(page) {
showLoadingProgress('Loading Report Page...');
var params = $('.ParametersContainer :input').serializeArray();
var urlParams = $.param(params);
var totalPages = parseInt($('#ReportViewerTotalPages').text());
if (page == undefined || page == null || page < 1) {
page = 1;
} else if (page > totalPages) {
page = totalPages;
}
$.get("/Report/ViewReportPage/[email protected]&page=" + page + "&" + urlParams)
.done(function (data) {
updateReportContent(data);
hideLoadingProgress();
})
.fail(function (data) {
$('.ReportViewerContent').html("<div class='ReportViewerError'>Report failed to load, check report parameters...</div>");
hideLoadingProgress();
});
}
function exportReport(element) {
var params = $('.ParametersContainer :input').serializeArray();
var urlParams = $.param(params);
var format = $(element).attr('class').replace("Export", "");
window.location.href = "/Report/ExportReport/[email protected]&format=" + format + "&" + urlParams;
}
function updateReportContent(data) {
if (data != undefined && data != null) {
$('#ReportViewerCurrentPage').val(data.CurrentPage);
$('#ReportViewerTotalPages').text(data.TotalPages);
$('.ReportViewerContent').html(data.Content);
if (data.TotalPages <= 1) {
$('.FirstPage').attr('disabled', true);
$('.PreviousPage').attr('disabled', true);
$('.NextPage').attr('disabled', true);
$('.LastPage').attr('disabled', true);
} else {
$('.FirstPage').attr('disabled', false);
$('.PreviousPage').attr('disabled', false);
$('.NextPage').attr('disabled', false);
$('.LastPage').attr('disabled', false);
}
}
}
</script>
}

@section Content {
@Html.RenderReportViewer(Model)
@model AlanJuden.MvcReportViewer.ReportViewerModel
@using AlanJuden.MvcReportViewer

@{
ViewBag.Title = "ReportViewer";
Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>ReportViewer</h2>

@section AdditionalHeadContent {
<link type="text/css" rel="stylesheet" href="~/css/select2.min.css" />
<link type="text/css" rel="stylesheet" href="~/css/select2-bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="~/css/mvcreportviewer-bootstrap.css" />
<style type="text/css">
.row {
margin-left: 0;
margin-right: 0;
}
</style>
<script type="text/javascript" src="~/js/select2.min.4.0.3.js"></script>
<script type="text/javascript" src="~/js/jquery.highlight-5.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('select').select2();
$('.FirstPage, .ViewReport, .Refresh').click(function () {
if (!$(this).attr('disabled')) {
viewReportPage(1);
}
});
$('.PreviousPage').click(function () {
if (!$(this).attr('disabled')) {
var page = parseInt($('#ReportViewerCurrentPage').val()) - 1;
viewReportPage(page);
}
});
$('.NextPage').click(function () {
if (!$(this).attr('disabled')) {
var page = parseInt($('#ReportViewerCurrentPage').val()) + 1;
viewReportPage(page);
}
});
$('.LastPage').click(function () {
if (!$(this).attr('disabled')) {
var page = parseInt($('#ReportViewerTotalPages').text());
viewReportPage(page);
}
});
$('#ReportViewerCurrentPage').change(function () {
var page = $(this).val();
viewReportPage(page);
});
$('.ExportXml, .ExportCsv, .ExportPdf, .ExportMhtml, .ExportExcelOpenXml, .ExportTiff, .ExportWordOpenXml').click(function () {
exportReport($(this));
});
$('#ReportViewerSearchText').on("keypress", function (e) {
if (e.keyCode == 13) {
// Cancel the default action on keypress event
e.preventDefault();
findText();
}
});
$('.FindTextButton').click(function () {
findText();
});
$('.Print').click(function () {
printReport();
});
});
function showLoadingProgress(message) {
hideLoadingProgress();
$('.ReportViewerContent').hide();
$('.ReportViewerContentContainer').append('<div class="loadingContainer"><div style="margin: 0 auto; width: 100%; text-align: center; vertical-align: middle;"><h2><i class="glyphicon glyphicon-refresh gly-spin"></i>' + message + '</h2></div></div>');
}
function hideLoadingProgress() {
$('.loadingContainer').remove();
$('.ReportViewerContent').show();
}
function printReport() {
var params = $('.ParametersContainer :input').serializeArray();
var urlParams = $.param(params);
window.open("/Report/PrintReport/[email protected]()&" + urlParams, "_blank");
}
function findText() {
$('.ReportViewerContent').removeHighlight();
var searchText = $("#ReportViewerSearchText").val();
if (searchText != undefined && searchText != null && searchText != "") {
showLoadingProgress('Searching Report...');
var params = $('.ParametersContainer :input').serializeArray();
var urlParams = $.param(params);
var page = parseInt($('#ReportViewerCurrentPage').val());
$.get("/Report/FindStringInReport/[email protected]()&page=" + page + "&searchText=" + searchText + "&" + urlParams).done(function (data) {
if (data > 0) {
viewReportPage(data, function () {
$('.ReportViewerContent').highlight(searchText);
hideLoadingProgress();
});
} else {
$('.ReportViewerContent').highlight(searchText);
hideLoadingProgress();
}
});
}
}
function viewReportPage(page, afterReportLoadedCallback) {
showLoadingProgress('Loading Report Page...');
var params = $('.ParametersContainer :input').serializeArray();
var urlParams = $.param(params);
var totalPages = parseInt($('#ReportViewerTotalPages').text());
if (page == undefined || page == null || page < 1) {
page = 1;
} else if (page > totalPages) {
page = totalPages;
}
$.get("/Report/ViewReportPage/[email protected]()&page=" + page + "&" + urlParams)
.done(function (data) {
updateReportContent(data);
hideLoadingProgress();
if (afterReportLoadedCallback && typeof (afterReportLoadedCallback) == "function") {
afterReportLoadedCallback();
}
})
.fail(function (data) {
$('.ReportViewerContent').html("<div class='ReportViewerError'>Report failed to load, check report parameters...</div>");
hideLoadingProgress();
});
}
function exportReport(element) {
var params = $('.ParametersContainer :input').serializeArray();
var urlParams = $.param(params);
var format = $(element).attr('class').replace("Export", "");
window.location.href = "/Report/ExportReport/[email protected]()&format=" + format + "&" + urlParams;
}
function updateReportContent(data) {
if (data != undefined && data != null) {
$('#ReportViewerCurrentPage').val(data.CurrentPage);
$('#ReportViewerTotalPages').text(data.TotalPages);
$('.ReportViewerContent').html(data.Content);
if (data.TotalPages <= 1) {
$('.FirstPage').attr('disabled', true);
$('.PreviousPage').attr('disabled', true);
$('.NextPage').attr('disabled', true);
$('.LastPage').attr('disabled', true);
} else {
$('.FirstPage').attr('disabled', false);
$('.PreviousPage').attr('disabled', false);
$('.NextPage').attr('disabled', false);
$('.LastPage').attr('disabled', false);
}
}
}
</script>
}

@section Content {
@Html.RenderReportViewer(Model)
}
Loading

0 comments on commit 4cbda98

Please sign in to comment.