Example #1
0
        private Report method_4(string fileName, HttpRequest request, string args)
        {
            Report report = null;
            string key    = request["cacheid"];

            if ((key != null) && (key.Trim().Length > 0))
            {
                report = (Report)CachedReportPool.get(key);
            }
            if (report == null)
            {
                Env env = null;
                try
                {
                    ReportDefine rd = null;
                    if (request["fromdb"] != "yes")
                    {
                        rd = new ReportDefine(fileName);
                    }
                    else
                    {
                        string content = ToDatabase.Load(request, _operator, request["spath"]);
                        if (content == "")
                        {
                            throw new Exception("从数据库中读出的报表内容为空");
                        }
                        rd = new ReportDefine(content, 1);
                    }
                    env = new Env(rd)
                    {
                        Request = request,
                        Session = _sessionState
                    };
                    prepareEnv(args, env, rd);
                    report = new Engine(env).calc();
                }
                catch (FileNotFoundException exception)
                {
                    throw exception;
                }
                catch (Exception exception2)
                {
                    throw exception2;
                }
                finally
                {
                    method_9(env);
                }
            }
            method_6(request["pageset"], report);
            return(report);
        }
Example #2
0
        public string run(HttpRequest req)
        {
            string message = Tools.demoAction(req);

            if (message != "")
            {
                throw new Exception(message);
            }
            string str12       = PathTool.getRealPath(req, FileAction.basePath + req["spath"]);
            string s           = req["pageno"];
            string str14       = req["e_fixrowcol"];
            bool   isFixRowCol = false;

            if (((str14 == null) && (s == "-1")) || (str14 == "1"))
            {
                isFixRowCol = true;
            }
            Report report = null;
            string str13  = "";
            string str9   = "";
            string str8   = "";
            string key    = "";
            string str6   = "";
            string str3   = "";
            string str5   = "";

            try
            {
                str6 = method_5(req).DocumentElement.ChildNodes.Item(0).InnerText;
                try
                {
                    report = method_4(str12, req, str6);
                }
                catch (Exception exception3)
                {
                    throw exception3;
                }
                string str11 = PathTool.getRealPath(req, FileAction.basePath + req["tempfilepath"]);
                str5 = req["e_runsavefile"];
                if ((str5 != null) && (str5.Length > 0))
                {
                    method_0(report, str11, str5, _float);
                    report.exportToPDF(str11 + str5 + ".pdf");
                    report.exportToExcel(str11 + str5 + ".xls", false);
                    report.exportToExcel(str11 + str5 + ".xlt", true);
                }
                try
                {
                    str3 = report.exportToHTML(null, _float, int.Parse(s), req, isFixRowCol);
                }
                catch (Exception exception)
                {
                    throw exception;
                }
                try
                {
                    str8 = Convert.ToString(report.pages);
                    str9 = req["cacheid"];
                    if ((s != "-1") && ((str9 == null) || (str9.Trim().Length == 0)))
                    {
                        str9 = CachedReportPool.put(report);
                    }
                    if ((str6 != null) && (str6.Trim().Length > 0))
                    {
                        key = req["e_paramid"];
                        if ((key != null) && (key.Trim().Length > 0))
                        {
                            key = CachedParamsPool.put(key, str6);
                        }
                        else
                        {
                            key = CachedParamsPool.put(str6);
                        }
                    }
                }
                catch (Exception exception2)
                {
                    throw exception2;
                }
            }
            catch (Exception exception4)
            {
                str13 = exception4.Message;
            }
            string str2 = str9 + ",,," + str8 + ",,," + str13 + ",,," + key + ",,,";

            if ((str5 == null) || (str5.Length <= 0))
            {
                return(str2 + "html,,," + str3);
            }
            return(str2 + "save,,," + _builder.ToString());
        }