using Microsoft.Reporting.WebForms; using System.Web; using System.Web.Mvc; namespace Vrh.Web.OneReport.ReportViewerForMvc { /// /// HTML helpers for ReportViewerForMvc /// public static class HtmlHelperExtensions { /// /// Returns an HTML iframe that renders an ASP.NET ReportViewer control. /// /// The HTML helper instance that this method extends. /// The object containing the ReportViewer control properties. /// /// An HTML iframe that sets its heigh and width based on the content of the report. public static HtmlString ReportViewer(this HtmlHelper helper, ReportViewer reportViewer, int asyncPostBackTimeout) { return ReportViewerForMvc.GetIframe(reportViewer, null, asyncPostBackTimeout); } /// /// Returns an HTML iframe that renders an ASP.NET ReportViewer control. /// /// The HTML helper instance that this method extends. /// The object containing the ReportViewer control properties. /// The object containing the HTML attributes of the iframe. /// /// An HTML iframe with the specified attributes that sets its heigh and width based on the content of the report. public static HtmlString ReportViewer(this HtmlHelper helper, ReportViewer reportViewer, object htmlAttributes, int asyncPostBackTimeout) { return ReportViewerForMvc.GetIframe(reportViewer, htmlAttributes, asyncPostBackTimeout); } /// /// Returns an HTML iframe that renders an ASP.NET ReportViewer control. /// /// The HTML helper instance that this method extends. /// The object containing the ReportViewer control properties. /// An object containing the LocalReport/ServerReport properties. /// /// An HTML iframe that sets its heigh and width based on the content of the report. 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); } /// /// Returns an HTML iframe that renders an ASP.NET ReportViewer control. /// /// The HTML helper instance that this method extends. /// The object containing the ReportViewer control properties. /// An object containing the LocalReport/ServerReport properties. /// The object containing the HTML attributes of the iframe. /// /// An HTML iframe with the specified attributes that sets its heigh and width based on the content of the report. 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); } /// /// Returns an HTML iframe that renders an ASP.NET ReportViewer control. /// /// The HTML helper instance that this method extends. /// The object containing the ReportViewer control properties. /// An object containing the LocalReport/ServerReport properties. /// Object that contains the parameters for a report. /// The object containing the HTML attributes of the iframe. /// /// An HTML iframe with the specified attributes that sets its heigh and width based on the content of the report. 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); } /// /// Returns an HTML iframe that renders an ASP.NET ReportViewer control. /// /// The HTML helper instance that this method extends. /// The object containing the ReportViewer control properties. /// An object containing the LocalReport/ServerReport properties. /// Object that contains the parameters for a report. /// The data sources to be added to the report. /// The object containing the HTML attributes of the iframe. /// /// An HTML iframe with the specified attributes that sets its heigh and width based on the content of the report. 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); } } }