示例#1
0
文件: Program.cs 项目: mwilian/demos
        private static string ExexPDF(string[] args)
        {
            string dtb = args[1];

            string qdid  = "";
            int    index = 0;
            string value = "";

            if (args.Length >= 6)
            {
                qdid = args[5];
            }
            if (args.Length >= 7)
            {
                index = Convert.ToInt32(args[6]);
            }
            if (args.Length >= 8)
            {
                value = args[7];
            }

            BUS.LIST_QDControl qdCtr  = new LIST_QDControl();
            DTO.LIST_QDInfo    qdInfo = qdCtr.Get_LIST_QD(dtb, qdid, ref sErr);
            if (qdInfo.QD_ID != "")
            {
                _sqlText = qdInfo.SQL_TEXT;
                try
                {
                    //  ;General Timeout=100
                    LoadQD(qdInfo);
                    if (value != "")
                    {
                        _sqlBuilder.Filters[index].FilterFrom = _sqlBuilder.Filters[index].FilterTo = _sqlBuilder.Filters[index].ValueTo = _sqlBuilder.Filters[index].ValueFrom = value;
                    }
                    BUS.DBAControl dbaCtr = new DBAControl();
                    DTO.DBAInfo    dbaInf = dbaCtr.Get(dtb, ref sErr);
                    __templatePath = dbaInf.REPORT_TEMPLATE_DRIVER;
                    ReportGenerator report = new ReportGenerator(_sqlBuilder, qdInfo.QD_ID, _sqlText, _strConnectDes, __templatePath, __reportPath, __documentDirectory);
                    return(report.ExportPDFToPath(__reportPath));
                }
                catch (Exception ex)
                {
                    sErr = ex.Message;
                    BUS.CommonControl.AddLog("ErroLog", __documentDirectory + "\\Log", String.Format("[QDCommand]\t[{0}]:\t{1}, {2}, {3}", DateTime.Now, ex.Message, ex.Source, ex.StackTrace));
                    return("");
                }
            }
            return("");
        }
示例#2
0
 public DBAInfo(DBAInfo objEntr)
 {
     _DB          = objEntr.DB;
     _DB1         = objEntr.DB1;
     _DB2         = objEntr.DB2;
     _DESCRIPTION = objEntr.DESCRIPTION;
     _DATE_FORMAT = objEntr.DATE_FORMAT;
     _DECIMAL_PLACES_SUNACCOUNT  = objEntr.DECIMAL_PLACES_SUNACCOUNT;
     _DECIMAL_SEPERATOR          = objEntr.DECIMAL_SEPERATOR;
     _THOUSAND_SEPERATOR         = objEntr.THOUSAND_SEPERATOR;
     _PRIMARY_BUDGET             = objEntr.PRIMARY_BUDGET;
     _DATA_ACCESS_GROUP          = objEntr.DATA_ACCESS_GROUP;
     _DECIMAL_PLACES_SUNBUSINESS = objEntr.DECIMAL_PLACES_SUNBUSINESS;
     _REPORT_TEMPLATE_DRIVER     = objEntr.REPORT_TEMPLATE_DRIVER;
     _PARAM_1 = objEntr.PARAM_1;
     _PARAM_2 = objEntr.PARAM_2;
     _PARAM_3 = objEntr.PARAM_3;
     _PARAM_4 = objEntr.PARAM_4;
     _PARAM_5 = objEntr.PARAM_5;
     _PARAM_6 = objEntr.PARAM_6;
 }
示例#3
0
文件: Program.cs 项目: mwilian/demos
        private static string ExexReport(string[] args)
        {
            string dtb   = args[1];
            string qdid  = "";
            int    index = 0;
            string value = "";

            if (args.Length >= 6)
            {
                qdid = args[5];
            }
            if (args.Length >= 7)
            {
                index = args[6] == "ZZZ" ? 0 : Convert.ToInt32(args[6]);
            }
            if (args.Length >= 8)
            {
                value = args[7] == "ZZZ" ? "" : args[7];
            }
            string path = "";

            if (args.Length >= 9)
            {
                path = args[8] == "ZZZ" ? "" : args[8];
            }
            path = path.Replace("%20", " ");
            string filename = "";

            if (args.Length >= 10)
            {
                filename = args[9] == "ZZZ" ? "" : args[9];
            }
            filename = filename.Replace("%20", " ");

            BUS.LIST_QDControl qdCtr  = new LIST_QDControl();
            DTO.LIST_QDInfo    qdInfo = qdCtr.Get_LIST_QD(dtb, qdid, ref sErr);
            if (qdInfo.QD_ID != "")
            {
                _sqlText = qdInfo.SQL_TEXT;
                try
                {
                    LoadQD(qdInfo);
                    if (value != "")
                    {
                        _sqlBuilder.Filters[index].FilterFrom = _sqlBuilder.Filters[index].FilterTo = _sqlBuilder.Filters[index].ValueTo = _sqlBuilder.Filters[index].ValueFrom = value;
                    }
                    BUS.DBAControl dbaCtr = new DBAControl();
                    DTO.DBAInfo    dbaInf = dbaCtr.Get(dtb, ref sErr);
                    __templatePath = dbaInf.REPORT_TEMPLATE_DRIVER;

                    ReportGenerator report = new ReportGenerator(_sqlBuilder, qdInfo.QD_ID, _sqlText, _strConnectDes, __templatePath, __reportPath, __documentDirectory);

                    if (path == "" && filename == "")
                    {
                        return(report.ExportExcelToPath(__reportPath));
                    }
                    else if (path != "" && filename == "")
                    {
                        return(report.ExportExcelToPath(path));
                    }
                    else if (path == "" && filename != "")
                    {
                        return(report.ExportExcelToFile(__reportPath, filename));
                    }
                    else
                    {
                        return(report.ExportExcelToFile(path, filename));
                    }
                }
                catch (Exception ex)
                {
                    sErr = ex.Message;
                    BUS.CommonControl.AddLog("ErroLog", __documentDirectory + "\\Log", "[QDCommand]\t[" + DateTime.Now.ToString() + "]:\t" + ex.Message + ", " + ex.Source + ", " + ex.StackTrace);
                    return("");
                }
            }
            return("");
        }