Exemplo n.º 1
0
        private void _helper_DomainObjectToExportRow(object sender, EventArgs e)
        {
            DomainObjectToExportRowEventArgs de = e as DomainObjectToExportRowEventArgs;

            if (de != null)
            {
                de.ExportRow = this.GetArrayFrom(de.DomainObject);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 格式化object的各字段成字符串,用于导出数据,需重载
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        private string[] FormatExportRecord(object obj)
        {
            DomainObjectToExportRowEventArgs args = new DomainObjectToExportRowEventArgs();

            args.DomainObject = obj as DomainObject;
            this.DomainObjectToExportRow(this.excelExporter.Page, args);

            return(args.ExportRow);
        }
        private void WebQueryHelper_DomainObjectToExportRow(object sender, EventArgs e)
        {
            DomainObjectToExportRowEventArgs args = (DomainObjectToExportRowEventArgs)e;

            if (args.DomainObject != null)
            {
                RptAchievingRate obj = (RptAchievingRate)args.DomainObject;

                args.ExportRow = new string[] {
                    FormatHelper.ToDateString(obj.ShiftDay),
                    obj.AchievingQty.ToString("0"),
                    obj.PlanQty.ToString("0"),
                    obj.AchievingRate.ToString("0.00%")
                };
            }
        }