protected override void PageLoad()
        {
            Page.RegisterBodyScripts(PathProvider.GetFileStaticRelativePath, "reports.js");

            var tmplId = Request["tmplId"];

            if (!string.IsNullOrEmpty(tmplId))
            {
                _content.Controls.Add(LoadControl(PathProvider.GetFileStaticRelativePath("Reports/ReportTemplateView.ascx")));
            }
            else
            {
                if (!string.IsNullOrEmpty(Request["reportType"]))
                {
                    _content.Controls.Add(LoadControl(PathProvider.GetFileStaticRelativePath("Reports/ReportView.ascx")));
                }
                else
                {
                    Response.Redirect("reports.aspx?reportType=0");
                }
            }

            ListTemplates = EngineFactory.ReportEngine.GetTemplates(Participant.ID);
            SetReportList();
        }
示例#2
0
        protected override void PageLoad()
        {
            if (Participant.IsVisitor)
            {
                Response.Redirect(PathProvider.BaseVirtualPath, true);
            }

            Page.RegisterBodyScripts(PathProvider.GetFileStaticRelativePath("reports.js"));

            var tmplId = Request["tmplId"];

            if (!string.IsNullOrEmpty(tmplId))
            {
                var reportTemplateControl = (Controls.Reports.ReportTemplateView)LoadControl(PathProvider.GetControlVirtualPath("ReportTemplateView.ascx"));
                reportTemplateControl.TemplateId = int.Parse(tmplId);
                _content.Controls.Add(reportTemplateControl);
            }
            else
            {
                if (!string.IsNullOrEmpty(Request["reportType"]))
                {
                    var report = (Controls.Reports.ReportView)LoadControl(PathProvider.GetControlVirtualPath("ReportView.ascx"));
                    _content.Controls.Add(report);
                }
                else
                {
                    Response.Redirect("reports.aspx?reportType=0");
                }
            }

            ListTemplates = Global.EngineFactory.GetReportEngine().GetTemplates(Participant.ID);
            SetReportList();
        }
        protected override void PageLoad()
        {
            Page.RegisterBodyScripts(ResolveUrl("~/js/third-party/sorttable.js"));
            Page.RegisterBodyScripts(PathProvider.GetFileStaticRelativePath("reports.js"));

            exportReportPopup.Options.IsPopup = true;
            HasData                              = true;
            TemplateNotFound                     = false;
            Master.DisabledSidePanel             = true;
            Master.Master.DisabledTopStudioPanel = true;

            int.TryParse(UrlParameters.ReportType, out GenerateReportType);
            var repType = (ReportType)GenerateReportType;

            var filter = TaskFilter.FromUri(HttpContext.Current.Request.GetUrlRewriter());
            int templateID;
            var reportName = "";

            if (int.TryParse(UrlParameters.EntityID, out templateID))
            {
                var template = Global.EngineFactory.GetReportEngine().GetTemplate(templateID);
                if (template != null)
                {
                    filter             = template.Filter;
                    repType            = template.ReportType;
                    GenerateReportType = (int)template.ReportType;

                    Title      = HeaderStringHelper.GetPageTitle(string.Format(ReportResource.ReportPageTitle, HttpUtility.HtmlDecode(template.Name)));
                    reportName = string.Format(ReportResource.ReportPageTitle, template.Name);
                }
                else
                {
                    RedirectNotFound("reports.aspx");
                }
            }

            var report = Report.CreateNewReport(repType, filter);

            if (templateID == 0)
            {
                Title      = HeaderStringHelper.GetPageTitle(string.Format(ReportResource.ReportPageTitle, report.ReportInfo.Title));
                reportName = string.Format(ReportResource.ReportPageTitle, report.ReportInfo.Title);
            }

            var filters = (ReportFilters)LoadControl(PathProvider.GetFileStaticRelativePath("Reports/ReportFilters.ascx"));

            filters.Report = report;
            _filter.Controls.Add(filters);

            var outputFormat = GetOutputFormat();
            var result       = report.BuildReport(outputFormat, templateID);

            OutputData(report, result, reportName, outputFormat);
        }
示例#4
0
        protected override void PageLoad()
        {
            if (Participant.IsVisitor)
            {
                Response.Redirect(PathProvider.BaseVirtualPath, true);
            }

            Page.RegisterBodyScripts(ResolveUrl("~/js/third-party/sorttable.js"));
            Page.RegisterBodyScripts(PathProvider.GetFileStaticRelativePath("reports.js"));

            exportReportPopup.Options.IsPopup = true;
            HasData                              = true;
            TemplateNotFound                     = false;
            Master.DisabledSidePanel             = true;
            Master.Master.DisabledTopStudioPanel = true;

            int.TryParse(UrlParameters.ReportType, out GenerateReportType);
            var repType = (ReportType)GenerateReportType;

            var    filter = new TaskFilter();
            int    templateID;
            var    reportName = "";
            Report report;

            if (int.TryParse(UrlParameters.EntityID, out templateID))
            {
                var template = Global.EngineFactory.GetReportEngine().GetTemplate(templateID);
                if (template != null)
                {
                    filter             = template.Filter;
                    repType            = template.ReportType;
                    GenerateReportType = (int)template.ReportType;
                    Title      = HeaderStringHelper.GetPageTitle(string.Format(ReportResource.ReportPageTitle, HttpUtility.HtmlDecode(template.Name)));
                    reportName = string.Format(ReportResource.ReportPageTitle, template.Name);
                }
                else
                {
                    TemplateNotFound = true;
                    HasData          = false;
                    emptyScreenControlPh.Controls.Add(new ElementNotFoundControl
                    {
                        Header        = ReportResource.TemplateNotFound_Header,
                        Body          = ReportResource.TemplateNotFound_Body,
                        RedirectURL   = "reports.aspx?reportType=0",
                        RedirectTitle = ReportResource.TemplateNotFound_RedirectTitle
                    });
                    Master.DisabledSidePanel = false;
                }
            }
            else
            {
                filter = TaskFilter.FromUri(HttpContext.Current.Request.GetUrlRewriter());

                report = Report.CreateNewReport(repType, filter);

                Title      = HeaderStringHelper.GetPageTitle(string.Format(ReportResource.ReportPageTitle, report.ReportInfo.Title));
                reportName = string.Format(ReportResource.ReportPageTitle, report.ReportInfo.Title);
            }

            report = Report.CreateNewReport(repType, filter);

            var filters = (ReportFilters)LoadControl(PathProvider.GetControlVirtualPath("ReportFilters.ascx"));

            filters.Report = report;
            _filter.Controls.Add(filters);

            var outputFormat = GetOutputFormat();
            var result       = ReportHelper.BuildReport(repType, filter, outputFormat, templateID);

            OutputData(result, reportName, report, outputFormat);
        }