diff --git a/.cr/personal/FavoritesList/List.xml b/.cr/personal/FavoritesList/List.xml new file mode 100644 index 0000000..a60e5ed --- /dev/null +++ b/.cr/personal/FavoritesList/List.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE index 4092bdf..733049d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013-2015 Ilya Verbitskiy +Copyright (c) 2013-2015 Ilya Verbitskiy, Adhemar Soria Galvarro Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/MvcReportViewer.sln b/MvcReportViewer.sln index e856c52..b3e0f50 100644 --- a/MvcReportViewer.sln +++ b/MvcReportViewer.sln @@ -1,15 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 +# Visual Studio Version 18 +VisualStudioVersion = 18.1.11304.174 d18.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcReportViewerExample", "MvcReportViewerExample\MvcReportViewerExample.csproj", "{5804FFD3-29D6-42FA-943B-94DE747CBE24}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcReportViewer", "MvcReportViewer\MvcReportViewer.csproj", "{6353720D-C784-4C00-A7B7-D652542FBCC9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcReportViewerTests", "MvcReportViewerTests\MvcReportViewerTests.csproj", "{20D0F976-2730-406D-A336-4056416CFF10}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcReportViewer_NET45", "MvcReportViewer_NET45\MvcReportViewer_NET45.csproj", "{BF8D2B0B-EFD0-44A6-B6E1-A3215B4C477B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvcReportViewer", "MvcReportViewer\MvcReportViewer.csproj", "{6353720D-C784-4C00-A7B7-D652542FBCC9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -17,24 +11,15 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5804FFD3-29D6-42FA-943B-94DE747CBE24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5804FFD3-29D6-42FA-943B-94DE747CBE24}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5804FFD3-29D6-42FA-943B-94DE747CBE24}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5804FFD3-29D6-42FA-943B-94DE747CBE24}.Release|Any CPU.Build.0 = Release|Any CPU {6353720D-C784-4C00-A7B7-D652542FBCC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6353720D-C784-4C00-A7B7-D652542FBCC9}.Debug|Any CPU.Build.0 = Debug|Any CPU {6353720D-C784-4C00-A7B7-D652542FBCC9}.Release|Any CPU.ActiveCfg = Release|Any CPU {6353720D-C784-4C00-A7B7-D652542FBCC9}.Release|Any CPU.Build.0 = Release|Any CPU - {20D0F976-2730-406D-A336-4056416CFF10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {20D0F976-2730-406D-A336-4056416CFF10}.Debug|Any CPU.Build.0 = Debug|Any CPU - {20D0F976-2730-406D-A336-4056416CFF10}.Release|Any CPU.ActiveCfg = Release|Any CPU - {20D0F976-2730-406D-A336-4056416CFF10}.Release|Any CPU.Build.0 = Release|Any CPU - {BF8D2B0B-EFD0-44A6-B6E1-A3215B4C477B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF8D2B0B-EFD0-44A6-B6E1-A3215B4C477B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF8D2B0B-EFD0-44A6-B6E1-A3215B4C477B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF8D2B0B-EFD0-44A6-B6E1-A3215B4C477B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E75B79A7-7DE7-4E4C-AD4C-94FA4109285D} + EndGlobalSection EndGlobal diff --git a/MvcReportViewer/MvcReportViewer.aspx b/MvcReportViewer/MvcReportViewer.aspx index 24e5f9a..ce1ffc1 100644 --- a/MvcReportViewer/MvcReportViewer.aspx +++ b/MvcReportViewer/MvcReportViewer.aspx @@ -1,53 +1,54 @@ <%@ Page Language="C#" AutoEventWireup="true" Inherits="MvcReportViewer.MvcReportViewer, MvcReportViewer" %> -<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> + +<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> - - - + + -
-
- - + +
+ +
- + - + + + +
+ + + + + + + + diff --git a/MvcReportViewer/MvcReportViewer.csproj b/MvcReportViewer/MvcReportViewer.csproj index a2d83e4..0762585 100644 --- a/MvcReportViewer/MvcReportViewer.csproj +++ b/MvcReportViewer/MvcReportViewer.csproj @@ -1,112 +1,16 @@ - - - + - Debug - AnyCPU - {6353720D-C784-4C00-A7B7-D652542FBCC9} Library - Properties - MvcReportViewer - MvcReportViewer - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - True - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - ..\packages\Newtonsoft.Json.8.0.2\lib\net40\Newtonsoft.Json.dll - True - - - - - - - True - ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll - - - True - ..\packages\Microsoft.AspNet.Mvc.4.0.40804.0\lib\net40\System.Web.Mvc.dll - - - True - ..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll - - - True - ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll - - - True - ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll - - - True - ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll - - - - - - - - - - - - - - - - + MvcReportViewer.aspx ASPXCodeBehind - - - - - - - - - - - - - - - - - @@ -115,18 +19,50 @@ - + + True + \ + + + True + \ + + + True + \ + + + + + 5.3.0 + + + 4.7.0 + + + 150.1652.0 + + + 170.1000.7 + + + 10.0.1 + + - + - - + net48 + false + True + 0.90.8 + $(MSBuildProjectName) + $(AssemblyName)BO + LICENSE + README.md + icon.png + https://github.com/Avaruz/MvcReportViewer + git + Dependencys Updates - \ No newline at end of file diff --git a/MvcReportViewer/MvcReportViewer.nuspec b/MvcReportViewer/MvcReportViewer.nuspec new file mode 100644 index 0000000..ba0ad1c --- /dev/null +++ b/MvcReportViewer/MvcReportViewer.nuspec @@ -0,0 +1,17 @@ + + + + MvcReportViewerBO + 0.90 + $title$ + Ilya Verbitskiy, Adhemar Soria Galvarro + false + MIT + ASP.NET MVC wrapped for Microsoft ReportViewer control + Summary of changes made in this release of the package. + $copyright$ + + + + + \ No newline at end of file diff --git a/MvcReportViewer/MvcReportViewerIframe.cs b/MvcReportViewer/MvcReportViewerIframe.cs index c3bbf4c..bdec9cd 100644 --- a/MvcReportViewer/MvcReportViewerIframe.cs +++ b/MvcReportViewer/MvcReportViewerIframe.cs @@ -3,716 +3,716 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Text.Json; using System.Text.RegularExpressions; using System.Web; using System.Web.Mvc; using System.Web.UI.WebControls; using Microsoft.Reporting.WebForms; using MvcReportViewer.Configuration; -using Newtonsoft.Json; namespace MvcReportViewer { - /// - /// HTML iframe rengering engine for MvcReportViewer HTML extension. - /// - public class MvcReportViewerIframe : IMvcReportViewerOptions + /// + /// HTML iframe rengering engine for MvcReportViewer HTML extension. + /// + public class MvcReportViewerIframe : IMvcReportViewerOptions + { + private static Func _applyAppPathModifier; + + internal static Func ApplyAppPathModifier { - private static Func _applyAppPathModifier; - - internal static Func ApplyAppPathModifier - { - get { return _applyAppPathModifier; } - set { _applyAppPathModifier = value; } - } + get { return _applyAppPathModifier; } + set { _applyAppPathModifier = value; } + } - internal static readonly string VisibilitySeparator = "~~~"; + internal static readonly string VisibilitySeparator = "~~~"; - private const string JsPostForm = @" + private const string JsPostForm = @" var formElement{0} = document.getElementById('{0}'); if (formElement{0}) {{ formElement{0}.submit(); }} "; - private readonly ControlSettingsManager _settingsManager = new ControlSettingsManager(); - - private readonly ReportViewerConfiguration _config = new ReportViewerConfiguration(); - - private string _reportPath; - - private string _reportServerUrl; + private readonly ControlSettingsManager _settingsManager = new ControlSettingsManager(); - private string _username; + private readonly ReportViewerConfiguration _config = new ReportViewerConfiguration(); - private string _password; + private string _reportPath; - private string _eventsHandlerType; + private string _reportServerUrl; - private FormMethod _method; + private string _username; - private ProcessingMode _processingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; + private string _password; - private IList> _reportParameters; + private string _eventsHandlerType; - private IDictionary _htmlAttributes; - - private ControlSettings _controlSettings; - - private DataSourceCredentials[] _dataSourceCredentials; - - private readonly string _aspxViewer; - - private readonly bool _encryptParameters; - - static MvcReportViewerIframe() - { - var response = HttpContext.Current?.Response; - if (response != null) - { - _applyAppPathModifier = response.ApplyAppPathModifier; - } - } + private FormMethod _method; - /// - /// Creates an instance of MvcReportViewerIframe class. - /// - /// The path to the report on the server. - public MvcReportViewerIframe(string reportPath) - : this(reportPath, null, null, null, null, null, null, FormMethod.Get) - { - } + private ProcessingMode _processingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; - /// - /// Creates an instance of MvcReportViewerIframe class. - /// - /// The path to the report on the server. - /// An object that contains the HTML attributes to set for the element. - public MvcReportViewerIframe( - string reportPath, - IDictionary htmlAttributes) - : this(reportPath, null, null, null, null, null, htmlAttributes, FormMethod.Get) - { - } + private IList> _reportParameters; - /// - /// Creates an instance of MvcReportViewerIframe class. - /// - /// The path to the report on the server. - /// The report parameter properties for the report. - /// An object that contains the HTML attributes to set for the element. - public MvcReportViewerIframe( - string reportPath, - IDictionary reportParameters, - IDictionary htmlAttributes) - : this(reportPath, null, null, null, reportParameters, null, htmlAttributes, FormMethod.Get) - { - } + private IDictionary _htmlAttributes; - /// - /// Creates an instance of MvcReportViewerIframe class. - /// - /// The path to the report on the server. - /// The report parameter properties for the report. - /// An object that contains the HTML attributes to set for the element. - public MvcReportViewerIframe( - string reportPath, - IEnumerable> reportParameters, - IDictionary htmlAttributes) - : this(reportPath, null, null, null, reportParameters, null, htmlAttributes, FormMethod.Get) - { - } + private ControlSettings _controlSettings; - /// - /// Creates an instance of MvcReportViewerIframe class. - /// - /// The path to the report on the server. - /// The URL for the report server. - /// The report server username. - /// The report server password. - /// The report parameter properties for the report. - /// The Report Viewer control's UI settings. - /// An object that contains the HTML attributes to set for the element. - /// Method for sending parameters to the iframe, either GET or POST. - public MvcReportViewerIframe( - string reportPath, - string reportServerUrl, - string username, - string password, - IDictionary reportParameters, - ControlSettings controlSettings, - IDictionary htmlAttributes, - FormMethod method) - : this( - reportPath, - reportServerUrl, - username, - password, - reportParameters?.ToList(), - controlSettings, - htmlAttributes, - method) - { - } + private DataSourceCredentials[] _dataSourceCredentials; - /// - /// Creates an instance of MvcReportViewerIframe class. - /// - /// The path to the report on the server. - /// The URL for the report server. - /// The report server username. - /// The report server password. - /// The report parameter properties for the report. - /// The Report Viewer control's UI settings. - /// An object that contains the HTML attributes to set for the element. - /// Method for sending parameters to the iframe, either GET or POST. - public MvcReportViewerIframe( - string reportPath, - string reportServerUrl, - string username, - string password, - IEnumerable> reportParameters, - ControlSettings controlSettings, - IDictionary htmlAttributes, - FormMethod method) - { - if (string.IsNullOrEmpty(_config.AspxViewerJavaScript)) - { - throw new MvcReportViewerException("MvcReportViewer.js location is not found. Make sure you have MvcReportViewer.AspxViewerJavaScript in your Web.config."); - } + private readonly string _aspxViewer; - _reportPath = reportPath; - _reportServerUrl = reportServerUrl; - _username = username; - _password = password; - _controlSettings = controlSettings; - _reportParameters = reportParameters?.ToList(); - _htmlAttributes = htmlAttributes; - _method = method; - _aspxViewer = _config.AspxViewer; - if (string.IsNullOrEmpty(_aspxViewer)) - { - throw new MvcReportViewerException("ASP.NET Web Forms viewer is not set. Make sure you have MvcReportViewer.AspxViewer in your Web.config."); - } + private readonly bool _encryptParameters; - _aspxViewer = _aspxViewer.Trim(); - if (_aspxViewer.StartsWith("~")) - { - _aspxViewer = VirtualPathUtility.ToAbsolute(_aspxViewer); - } - - _aspxViewer = ApplyAppPathModifier(_aspxViewer); + static MvcReportViewerIframe() + { + var response = HttpContext.Current?.Response; + if (response != null) + { + _applyAppPathModifier = response.ApplyAppPathModifier; + } + } - _encryptParameters = _config.EncryptParameters; - ControlId = Guid.NewGuid(); - } + /// + /// Creates an instance of MvcReportViewerIframe class. + /// + /// The path to the report on the server. + public MvcReportViewerIframe(string reportPath) + : this(reportPath, null, null, null, null, null, null, FormMethod.Get) + { + } - internal Guid ControlId - { - get; - set; - } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() - { - return RenderIframe(); - } + /// + /// Creates an instance of MvcReportViewerIframe class. + /// + /// The path to the report on the server. + /// An object that contains the HTML attributes to set for the element. + public MvcReportViewerIframe( + string reportPath, + IDictionary htmlAttributes) + : this(reportPath, null, null, null, null, null, htmlAttributes, FormMethod.Get) + { + } - /// - /// Returns an HTML-encoded string. - /// - /// An HTML-encoded string. - public string ToHtmlString() - { - return ToString(); - } + /// + /// Creates an instance of MvcReportViewerIframe class. + /// + /// The path to the report on the server. + /// The report parameter properties for the report. + /// An object that contains the HTML attributes to set for the element. + public MvcReportViewerIframe( + string reportPath, + IDictionary reportParameters, + IDictionary htmlAttributes) + : this(reportPath, null, null, null, reportParameters, null, htmlAttributes, FormMethod.Get) + { + } - private string RenderIframe() - { - switch (_method) - { - case FormMethod.Get: - return GetIframeUsingGetMethod(); - - case FormMethod.Post: - return GetIframeUsingPostMethod(); - } - - throw new InvalidOperationException(); - } + /// + /// Creates an instance of MvcReportViewerIframe class. + /// + /// The path to the report on the server. + /// The report parameter properties for the report. + /// An object that contains the HTML attributes to set for the element. + public MvcReportViewerIframe( + string reportPath, + IEnumerable> reportParameters, + IDictionary htmlAttributes) + : this(reportPath, null, null, null, reportParameters, null, htmlAttributes, FormMethod.Get) + { + } - private string GetIframeUsingPostMethod() - { - var iframeId = GenerateId(); - var formId = GenerateId(); - - //
...
- var form = new TagBuilder("form"); - form.MergeAttribute("method", "POST"); - form.MergeAttribute("action", _aspxViewer); - form.MergeAttribute("target", iframeId); - form.GenerateId(formId); - form.InnerHtml = BuildIframeFormFields(); - - //