Beispiel #1
0
        public override object calculate()
        {
            SubReportList subRptList = base.cs.Env.SubRptList;

            if (subRptList == null)
            {
                throw new ReportError("当前报表没有引入子报表,不能进行子报表运算");
            }
            if ((base.paramList.Count < 3) || (base.paramList.Count > 4))
            {
                throw new ReportError("子报表运算函数的参数格式应为subreport(rpt, List1, List2) 或者 subreport(rpt, List1, List2,importOrEmbed)");
            }
            ExpParse parse4 = (ExpParse)base.paramList[0];

            if (parse4 == null)
            {
                throw new ReportError("子报表运算函数出现无效参数");
            }
            object obj2 = ConvertTool.getValue(parse4.calculate());
            int    num  = 0;

            if (base.paramList.Count == 4)
            {
                ExpParse parse3 = (ExpParse)base.paramList[3];
                if (parse3 == null)
                {
                    throw new ReportError("子报表运算函数出现无效参数");
                }
                object obj6 = ConvertTool.getValue(parse3.calculate());
                try
                {
                    num = (int)obj6;
                }
                catch (Exception)
                {
                    num = 0;
                }
            }
            if (!(obj2 is string))
            {
                throw new ReportError("子报表运算函数第一个参数应为引入的子报表名");
            }
            string       str    = subRptList.getAddress((string)obj2);
            string       str2   = subRptList.getType((string)obj2);
            ReportDefine define = this.method_0(str, str2);
            ExpParse     parse  = (ExpParse)base.paramList[1];
            ExpParse     parse2 = (ExpParse)base.paramList[2];

            if ((parse != null) && (parse2 != null))
            {
                object obj5 = ConvertTool.getValue(parse.calculate());
                object obj4 = ConvertTool.getValue(parse2.calculate());
                if ((obj5 is ArrayList) && (obj4 is ArrayList))
                {
                    return(this.method_1(define, (ArrayList)obj5, (ArrayList)obj4, num));
                }
                return(this.method_1(define, null, null, num));
            }
            return(this.method_1(define, null, null, num));
        }
Beispiel #2
0
 public Report(string sContent, int iTag)
 {
     pages         = 1;
     IsHavePic     = false;
     Cells         = new CSReader().read(sContent, iTag);
     DataSetHelper = createHelper();
     Args          = createArgs();
     SubReports    = createSubReportList();
 }
Beispiel #3
0
 public Report(int rowCount, int colCount)
 {
     pages         = 1;
     IsHavePic     = false;
     Cells         = new CellSet(rowCount, colCount);
     DataSetHelper = createHelper();
     Args          = createArgs();
     SubReports    = createSubReportList();
 }
Beispiel #4
0
 public Report(string raqFileName)
 {
     pages         = 1;
     IsHavePic     = false;
     Cells         = new CSReader().read(raqFileName);
     DataSetHelper = createHelper();
     Args          = createArgs();
     SubReports    = createSubReportList();
 }
Beispiel #5
0
 public Report(Stream raqStream)
 {
     pages         = 1;
     IsHavePic     = false;
     Cells         = new CSReader(raqStream).read();
     DataSetHelper = createHelper();
     Args          = createArgs();
     SubReports    = createSubReportList();
 }
Beispiel #6
0
 public Report(CellSet cs)
 {
     pages         = 1;
     IsHavePic     = false;
     Cells         = cs;
     DataSetHelper = createHelper();
     Args          = createArgs();
     SubReports    = createSubReportList();
 }
Beispiel #7
0
 protected void LocalReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e)
 {
     try
     {
         RDLReportDocument subReport = SubReportList.Find(item => item.Name == e.ReportPath);
         if (subReport.IsNotNull())
         {
             subReport.LoadSubReportSourceDataSet(e.Parameters);
             ReportDataSource rdSource = null;
             foreach (DataTable dtTable in subReport.dsSource.Tables)
             {
                 rdSource       = new ReportDataSource();
                 rdSource.Name  = dtTable.TableName;
                 rdSource.Value = dtTable.DefaultView;
                 e.DataSources.Add(rdSource);
             }
         }
     }
     catch (Exception ex)
     {
         this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex));
     }
 }