Ejemplo n.º 1
0
        //		#region 事件处理相关...
        //		private DrawObjEventHandler _BeforDrawObject;
        //		public event DrawObjEventHandler BeforDrawObject {
        //			add {
        //				_BeforDrawObject += value;
        //			}
        //			remove {
        //				_BeforDrawObject -= value;
        //			}
        //
        //		}
        //		private void FireBeforDrawObject(DrawObjEventArgs e) {
        //			if (mBeforDrawObject != null) {
        //				// 调用相应的委托代理
        //				mBeforDrawObject(this, e);
        //			}
        //		}
        //		#endregion 事件处理相关...

        public DrawReport(object pDs, DIYReport.ReportModel.RptReport pDataReport)
        {
            _RptData = pDs;
            DIYReport.UserDIY.DesignEnviroment.DataSource = pDs;

            _DataReport = pDataReport;
            _Rows       = DIYReport.GroupAndSort.GroupDataProcess.SortData(pDs, pDataReport);

            _RptInfo = new ReportDrawInfo(pDataReport);

            _FooterExpress = DIYReport.Express.ExpressValueList.GetFooterExpress(pDataReport);
            _BottomExpress = DIYReport.Express.ExpressValueList.GetBottomExpress(pDataReport);

            _DocSize = _DataReport.PaperSize;

            _DocMargin = _DataReport.Margins;

            //初始化页页数
            DIYReport.Express.ExSpecial._Page      = 1;
            DIYReport.Express.ExSpecial._PageCount = 1;

            _DrawDetailInfo = new DrawDetailInfo(pDataReport);
            _GroupFoots     = new Stack();
            _GroupHeads     = new Queue();

            float mergeHeight = _DataReport.SectionList.GetExceptDetailHeight();
            int   rHeight     = _DataReport.IsLandscape? _DocSize.Width : _DocSize.Height;

            REAL_DETAIL_HEIGHT = rHeight - Convert.ToInt32(mergeHeight) - _DocMargin.Top - _DocMargin.Bottom;
            int rWidth = _DataReport.IsLandscape? _DocSize.Height : _DocSize.Width;

            REAL_PAGE_WIDTH = rWidth - _DocMargin.Left - _DocMargin.Right;
            DIYReport.Express.ExSpecial._RowOrderNO = 0;
        }
Ejemplo n.º 2
0
        public static RptReport NewReport(string pReportName, System.Guid pRptID)
        {
            RptReport report = new RptReport();

            report.ID = pRptID;
            if (pReportName != null && pReportName != "")
            {
                report.Name = pReportName;
            }
            else
            {
                report.Name = "Bank-Report" + System.DateTime.Now.ToShortDateString() + System.DateTime.Now.Millisecond.ToString();
            }
            //PageSettings ps = DIYReport.Print.RptPageSetting.GetDefaultPageSetting();
            int paperWidth        = report.IsLandscape?report.PaperSize.Height:report.PaperSize.Width;
            int reportDetailWidth = paperWidth - report.Margins.Left - report.Margins.Right;

            DIYReport.ReportModel.RptSection section = new DIYReport.ReportModel.RptSection(DIYReport.SectionType.Detail);
            section.Width  = reportDetailWidth;
            section.Report = report;
            section.Height = 3 * DEFAULT_SELCTION_HEIGHT;
            report.SectionList.Add(section);
            report.Width  = report.PaperSize.Width;
            report.Height = report.PaperSize.Height;
            return(report);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 构造一个新的报表对象。
        /// </summary>
        /// <param name="dataSource">数据需要的数据源。</param>
        /// <param name="userParamList">报表参数列表,可以为空</param>
        /// <param name="reportData">系列化为XML文档的报表数据,为空的话那么将创建只有一个detail section 的空报表。</param>
        public static RptReport CreateReport(DataSet dataSource, DIYReport.ReportModel.RptParamList userParamList, string reportXmlData)
        {
            RptReport report = null;

            if (reportXmlData == null || reportXmlData.Length == 0)
            {
                report = NewReport();
            }
            else
            {
                report = DIYReport.ReportReader.Instance().ReadFromXmlString(reportXmlData);
            }
            report.DataSource    = dataSource;
            report.UserParamList = userParamList;
            if (report.ReportDataWidth == 0)
            {
                report.ReportDataWidth = report.PaperSize.Width - report.Margins.Left - report.Margins.Right;
            }
            return(report);
        }
Ejemplo n.º 4
0
 public XReportIOEventArgs(RptReport dataReport, CommandID commandID)
 {
     _DataReport = dataReport;
     _CommandID  = commandID;
 }