Esempio n. 1
0
        /// <summary>
        /// Load a detailed diskspace report.
        /// </summary>
        /// <param name="reportName">Name of detailed diskspace report.</param>
        /// <param name="localReport">
        /// Instance or <see cref="LocalReport"/> class.
        /// This instance serves as a container for report being loaded.
        /// </param>
        protected void BindHostingSpaceDiskspaceOverusageDetailsReport(string reportName, LocalReport localReport)
        {
            // 1. Localize report
            localReport.DisplayName = reportName;
            localReport.LoadReportDefinition(
                ReportingServicesUtils.LoadReportFromFile(
                    GetReportFullPath(reportName)
                    , reportName
                    , this
                    )
                );

            // 2. Update parameters
            //    Note: here we are always in Drill-through mode.
            localReport.SetParameters(localReport.OriginalParametersToDrillthrough);
            string hostingSpaceId = localReport.GetParameters()["HostingSpaceId"].Values[0];


            // 3. Update DataSet
            DataSet report = ES.Services.Packages
                             .GetDiskspaceOverusageDetailsReport(
                PanelSecurity.SelectedUserId
                , int.Parse(hostingSpaceId)
                );

            localReport.DataSources.Clear();

            TranslateStatusField(report.Tables["HostingSpace"]);

            BindDataTableToReport(localReport, "OverusageReport_HostingSpace", report.Tables["HostingSpace"]);
            BindDataTableToReport(localReport, "OverusageReport_DiskspaceOverusage", report.Tables["DiskspaceOverusage"]);
            BindDataTableToReport(localReport, "OverusageReport_OverusageDetails", report.Tables["OverusageDetails"]);

            localReport.Refresh();
        }
Esempio n. 2
0
        /// <summary>
        /// Loads Overusage summary report.
        /// </summary>
        /// <param name="reportName">Name of overusage summary report.</param>
        /// <param name="localReport">
        /// Instance or <see cref="LocalReport"/> class.
        /// This instance serves as a container for report being loaded.
        /// </param>
        protected void BindOverusageSummaryReport(string reportName, LocalReport localReport)
        {
            // 1. Localize report
            localReport.DisplayName = reportName;
            localReport.LoadReportDefinition(
                ReportingServicesUtils.LoadReportFromFile(
                    GetReportFullPath(reportName)
                    , reportName
                    , this
                    )
                );

            // 2. Update parameters
            List <ReportParameter> parameters = new List <ReportParameter>();

            parameters.Add(
                new ReportParameter(
                    ParameterBandwidthStartDate
                    , startDateCalendar.SelectedDate.ToString()
                    )
                );
            parameters.Add(
                new ReportParameter(
                    ParameterBandwidthEndDate
                    , endDateCalendar.SelectedDate.ToString()
                    )
                );

            localReport.SetParameters(parameters);

            // 3. Update DataSet
            DataSet report = ES.Services.Packages
                             .GetOverusageSummaryReport(
                PanelSecurity.SelectedUserId
                , PanelSecurity.PackageId
                , startDateCalendar.SelectedDate
                , endDateCalendar.SelectedDate
                );

            localReport.DataSources.Clear();

            TranslateStatusField(report.Tables["HostingSpace"]);

            // If you open reports DataSet file in XML and file <DataSets> node
            // you will see the same names as applied to ReportDataSource(name, value) instances below
            LoadDiskspaceOverusageData(report.Tables["HostingSpace"], report.Tables["DiskspaceOverusage"]);
            LoadBandwidthOverusageData(report.Tables["HostingSpace"], report.Tables["BandwidthOverusage"]);
            //
            BindDataTableToReport(localReport, "OverusageReport_HostingSpace", report.Tables["HostingSpace"]);
            BindDataTableToReport(localReport, "OverusageReport_DiskspaceOverusage", report.Tables["DiskspaceOverusage"]);
            BindDataTableToReport(localReport, "OverusageReport_BandwidthOverusage", report.Tables["BandwidthOverusage"]);
            BindDataTableToReport(localReport, "OverusageReport_OverusageDetails", report.Tables["OverusageDetails"]);

            localReport.Refresh();
        }
Esempio n. 3
0
        protected void BindHostingSpaceBandwidthOverusageDetailsReport(string reportName, LocalReport localReport)
        {
            // 1. Localize report
            localReport.DisplayName = reportName;
            localReport.LoadReportDefinition(
                ReportingServicesUtils.LoadReportFromFile(
                    GetReportFullPath(reportName)
                    , reportName
                    , this
                    )
                );

            // 2. Update parameters
            //    Note: here we are always in Drill-through mode.
            localReport.SetParameters(localReport.OriginalParametersToDrillthrough);
            string hostingSpaceId = localReport.GetParameters()["HostingSpaceId"].Values[0];

            List <ReportParameter> parameters = new List <ReportParameter>();

            parameters.Add(
                new ReportParameter(
                    ParameterBandwidthStartDate
                    , startDateCalendar.SelectedDate.ToString()
                    )
                );
            parameters.Add(
                new ReportParameter(
                    ParameterBandwidthEndDate
                    , endDateCalendar.SelectedDate.ToString()
                    )
                );

            localReport.SetParameters(parameters);

            //3. Update data
            DataSet ds = ES.Services.Packages
                         .GetBandwidthOverusageDetailsReport(
                PanelSecurity.SelectedUserId
                , int.Parse(hostingSpaceId)
                , startDateCalendar.SelectedDate
                , endDateCalendar.SelectedDate
                );

            localReport.DataSources.Clear();

            TranslateStatusField(ds.Tables["HostingSpace"]);

            BindDataTableToReport(localReport, "OverusageReport_HostingSpace", ds.Tables["HostingSpace"]);
            BindDataTableToReport(localReport, "OverusageReport_BandwidthOverusage", ds.Tables["BandwidthOverusage"]);
            BindDataTableToReport(localReport, "OverusageReport_OverusageDetails", ds.Tables["OverusageDetails"]);

            localReport.Refresh();
        }
Esempio n. 4
0
        /// <summary>
        /// Assigns export URLs for buttons
        /// </summary>
        protected void BindExportButtons(LocalReport report)
        {
            exportToExcel.NavigateUrl = ReportingServicesUtils
                                        .GetReportExportUrl(
                report
                , rvContent
                , rvContent.ExportContentDisposition
                ) + ExcelExportTypeName;

            exportToPdf.NavigateUrl = ReportingServicesUtils
                                      .GetReportExportUrl(
                report
                , rvContent
                , rvContent.ExportContentDisposition
                ) + PDFExportTypeName;
        }