Blame view

Vrh.Web.OneReport.Lib/ReportViewerForMVC/HtmlHelperExtensions.cs 6.45 KB
ab9f2fbe   Schwirg László   Add project files.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
  using Microsoft.Reporting.WebForms;
  using System.Web;
  using System.Web.Mvc;
  
  namespace Vrh.Web.OneReport.ReportViewerForMvc
  {
      /// <summary>
      /// HTML helpers for ReportViewerForMvc
      /// </summary>
      public static class HtmlHelperExtensions
      {
          /// <summary>
          /// Returns an HTML iframe that renders an ASP.NET ReportViewer control.
          /// </summary>
          /// <param name="helper">The HTML helper instance that this method extends.</param>
          /// <param name="reportViewer">The object containing the ReportViewer control properties.</param>
          /// <param name="asyncPostBackTimeout"></param>
          /// <returns>An HTML iframe that sets its heigh and width based on the content of the report.</returns>
          public static HtmlString ReportViewer(this HtmlHelper helper, ReportViewer reportViewer, int asyncPostBackTimeout)
          {
              return ReportViewerForMvc.GetIframe(reportViewer, null, asyncPostBackTimeout);
          }
  
          /// <summary>
          /// Returns an HTML iframe that renders an ASP.NET ReportViewer control.
          /// </summary>
          /// <param name="helper">The HTML helper instance that this method extends.</param>
          /// <param name="reportViewer">The object containing the ReportViewer control properties.</param>
          /// <param name="htmlAttributes">The object containing the HTML attributes of the iframe.</param>
          /// <param name="asyncPostBackTimeout"></param>
          /// <returns>An HTML iframe with the specified attributes that sets its heigh and width based on the content of the report.</returns>
          public static HtmlString ReportViewer(this HtmlHelper helper, ReportViewer reportViewer, object htmlAttributes, int asyncPostBackTimeout)
          {
              return ReportViewerForMvc.GetIframe(reportViewer, htmlAttributes, asyncPostBackTimeout);
          }
  
          /// <summary>
          /// Returns an HTML iframe that renders an ASP.NET ReportViewer control.
          /// </summary>
          /// <param name="helper">The HTML helper instance that this method extends.</param>
          /// <param name="reportViewer">The object containing the ReportViewer control properties.</param>
          /// <param name="report">An object containing the LocalReport/ServerReport properties.</param>
          /// <param name="asyncPostBackTimeout"></param>
          /// <returns>An HTML iframe that sets its heigh and width based on the content of the report.</returns>
          public static HtmlString ReportViewer(this HtmlHelper helper, object reportViewer, object report, int asyncPostBackTimeout)
          {
              ReportViewer reportViewerControl = ReportViewerForMvc.AnonymousReportViewer(reportViewer, report);
              return ReportViewerForMvc.GetIframe(reportViewerControl, null, asyncPostBackTimeout);
          }
  
          /// <summary>
          /// Returns an HTML iframe that renders an ASP.NET ReportViewer control.
          /// </summary>
          /// <param name="helper">The HTML helper instance that this method extends.</param>
          /// <param name="reportViewer">The object containing the ReportViewer control properties.</param>
          /// <param name="report">An object containing the LocalReport/ServerReport properties.</param>
          /// <param name="htmlAttributes">The object containing the HTML attributes of the iframe.</param>
          /// <param name="asyncPostBackTimeout"></param>
          /// <returns>An HTML iframe with the specified attributes that sets its heigh and width based on the content of the report.</returns>
          public static HtmlString ReportViewer(this HtmlHelper helper, object reportViewer, object report, object htmlAttributes, int asyncPostBackTimeout)
          {
              ReportViewer reportViewerControl = ReportViewerForMvc.AnonymousReportViewer(reportViewer, report);
              return ReportViewerForMvc.GetIframe(reportViewerControl, htmlAttributes, asyncPostBackTimeout);
          }
  
          /// <summary>
          /// Returns an HTML iframe that renders an ASP.NET ReportViewer control.
          /// </summary>
          /// <param name="helper">The HTML helper instance that this method extends.</param>
          /// <param name="reportViewer">The object containing the ReportViewer control properties.</param>
          /// <param name="report">An object containing the LocalReport/ServerReport properties.</param>
          /// <param name="parameters">Object that contains the parameters for a report.</param>
          /// <param name="htmlAttributes">The object containing the HTML attributes of the iframe.</param>
          /// <param name="asyncPostBackTimeout"></param>
          /// <returns>An HTML iframe with the specified attributes that sets its heigh and width based on the content of the report.</returns>
          public static HtmlString ReportViewer(this HtmlHelper helper, object reportViewer, object report, object parameters, object htmlAttributes, int asyncPostBackTimeout)
          {
              ReportViewer reportViewerControl = ReportViewerForMvc.AnonymousReportViewer(reportViewer, report, parameters);
  
              return ReportViewerForMvc.GetIframe(reportViewerControl, htmlAttributes, asyncPostBackTimeout);
          }
  
          /// <summary>
          /// Returns an HTML iframe that renders an ASP.NET ReportViewer control.
          /// </summary>
          /// <param name="helper">The HTML helper instance that this method extends.</param>
          /// <param name="reportViewer">The object containing the ReportViewer control properties.</param>
          /// <param name="report">An object containing the LocalReport/ServerReport properties.</param>
          /// <param name="parameters">Object that contains the parameters for a report.</param>
          /// <param name="dataSources">The data sources to be added to the report.</param>
          /// <param name="htmlAttributes">The object containing the HTML attributes of the iframe.</param>
          /// <param name="asyncPostBackTimeout"></param>
          /// <returns>An HTML iframe with the specified attributes that sets its heigh and width based on the content of the report.</returns>
          public static HtmlString ReportViewer(this HtmlHelper helper, object reportViewer, object report, object parameters, object dataSources, object htmlAttributes, int asyncPostBackTimeout)
          {
              ReportViewer reportViewerControl = ReportViewerForMvc.AnonymousReportViewer(reportViewer, report, parameters, dataSources);
  
              return ReportViewerForMvc.GetIframe(reportViewerControl, htmlAttributes, asyncPostBackTimeout);
          }
      }
  }