private void ShowReport()
        {
            if (IsPostBack)
            {
                return;
            }

            try
            {
                var parser     = new ReportViewerParametersParser();
                var parameters = Request.Form.Count > 0 ? parser.Parse(Request.Form) : parser.Parse(Request.QueryString);

                var hasHeightChangedScript = string.Format(
                    IsHeightChangedJS,
                    parameters.ControlSettings.Height == null ? "false" : "true");
                ClientScript.RegisterStartupScript(GetType(), "IsHeightChangedJS", hasHeightChangedScript);

                ReportViewer.ReportError += OnReportError;
                ReportViewer.Initialize(parameters);

                RegisterJavaScriptApi();
            }
            catch (Exception e)
            {
                var result = RedirectToErrorPage(e);
                if (!result)
                {
                    throw;
                }
            }
        }
        private void ShowReport()
        {
            if (IsPostBack)
            {
                return;
            }

            try
            {
                var parser = new ReportViewerParametersParser();
                var parameters = Request.Form.Count > 0 ? parser.Parse(Request.Form) : parser.Parse(Request.QueryString);

                var hasHeightChangedScript = string.Format(
                    IsHeightChangedJs,
                    parameters.ControlSettings.Height == null ? "false" : "true");
                ClientScript.RegisterStartupScript(GetType(), "IsHeightChangedJS", hasHeightChangedScript);

                ReportViewer.ReportError += OnReportError;
                ReportViewer.Initialize(parameters);

                RegisterJavaScriptApi();
            }
            catch(Exception e)
            {
                var result = RedirectToErrorPage(e);
                if (!result)
                {
                    throw;
                }
            }
        }
        private void ShopReport()
        {
            if (IsPostBack)
            {
                return;
            }

            var parser = new ReportViewerParametersParser();
            var parameters = Request.Form.Count > 0 ? parser.Parse(Request.Form) : parser.Parse(Request.QueryString);
            ReportViewer.Initialize(parameters);
        }
        private void ShopReport()
        {
            if (IsPostBack)
            {
                return;
            }

            var parser = new ReportViewerParametersParser();
            var parameters = Request.Form.Count > 0 ? parser.Parse(Request.Form) : parser.Parse(Request.QueryString);
            ReportViewer.Initialize(parameters);
        }
Ejemplo n.º 5
0
        private void ShowReport()
        {
            try
            {
                if (!IsPostBack)
                {
                    var parser     = new ReportViewerParametersParser();
                    var parameters = Request.Form.Count > 0 ? parser.Parse(Request.Form) : parser.Parse(Request.QueryString);

                    var hasHeightChangedScript = string.Format(
                        IsHeightChangedJs,
                        parameters.ControlSettings.Height == null ? "false" : "true");
                    ClientScript.RegisterStartupScript(GetType(), "IsHeightChangedJS", hasHeightChangedScript);

                    var showPrintButtonScript = string.Format(ShowPrintButtonJs,
                                                              parameters.ControlSettings.ShowPrintButton == false ? "false" : "true");
                    ClientScript.RegisterStartupScript(GetType(), "ShowPrintButtonJs", showPrintButtonScript);

                    ReportViewer.ReportError += OnReportError;
                    ReportViewer.Initialize(parameters);

                    RegisterJavaScriptApi(parameters);

                    // Save Drillthrough information for future use
                    if (!string.IsNullOrEmpty(parameters.EventsHandlerType))
                    {
                        ViewState[EventHandlers] = parameters.EventsHandlerType;
                    }
                }
                else
                {
                    // Drillthrough event has to be configured no matter what.
                    var eventHandlers = ViewState[EventHandlers] as string;
                    if (!string.IsNullOrEmpty(eventHandlers))
                    {
                        ReportViewer.SetupDrillthrough(eventHandlers);
                    }
                }
            }
            catch (Exception e)
            {
                var result = RedirectToErrorPage(e);
                if (!result)
                {
                    throw;
                }
            }
        }
        private void ShowReport()
        {
            try
            {
                if (!IsPostBack)
                {
                    var parser = new ReportViewerParametersParser();
                    var parameters = Request.Form.Count > 0 ? parser.Parse(Request.Form) : parser.Parse(Request.QueryString);

                    var hasHeightChangedScript = string.Format(
                        IsHeightChangedJs,
                        parameters.ControlSettings.Height == null ? "false" : "true");
                    ClientScript.RegisterStartupScript(GetType(), "IsHeightChangedJS", hasHeightChangedScript);

                    var showPrintButtonScript = string.Format(ShowPrintButtonJs,
                        parameters.ControlSettings.ShowPrintButton == false ? "false" : "true");
                    ClientScript.RegisterStartupScript(GetType(), "ShowPrintButtonJs", showPrintButtonScript);

                    ReportViewer.ReportError += OnReportError;
                    ReportViewer.Initialize(parameters);

                    RegisterJavaScriptApi();

                    // Save Drillthrough information for future use
                    if (!string.IsNullOrEmpty(parameters.EventsHandlerType))
                    {
                        ViewState[EventHandlers] = parameters.EventsHandlerType;
                    }
                }
                else
                {
                    // Drillthrough event has to be configured no matter what.
                    var eventHandlers = ViewState[EventHandlers] as string;
                    if (!string.IsNullOrEmpty(eventHandlers))
                    {
                        ReportViewer.SetupDrillthrough(eventHandlers);
                    }
                }
            }
            catch (Exception e)
            {
                var result = RedirectToErrorPage(e);
                if (!result)
                {
                    throw;
                }
            }
        }