/* * 填充报表头 * * Param pageIndex 页号 * Param orderHead 订单头对象 * Param orderDetails 订单明细对象 */ private void FillHead(PrintStockTakeMaster printStockTakeMaster, IList<StockTakeLocation> printStockTakeLocation) { printStockTakeLocation = printStockTakeLocation.Take(6).ToList(); this.sheet.DisplayGridlines = false; this.sheet.IsPrintGridlines = false; this.barCodeFontName = this.GetBarcodeFontName(0, 5); int pageIndex = 1; string barCode = Utility.BarcodeHelper.GetBarcodeStr(printStockTakeMaster.StNo, this.barCodeFontName); //条形码 this.SetRowCell(0, 5, barCode); //StNo this.SetRowCell(2, 5, printStockTakeMaster.StNo); //区域 this.SetRowCell(3, 1, printStockTakeMaster.Region); //类型 this.SetRowCell(4, 1, printStockTakeMaster.Type == 0 ? "抽盘" : "全盘"); //生效日期 this.SetRowCell(3, 5, printStockTakeMaster.EffectiveDate.HasValue ? printStockTakeMaster.EffectiveDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty); //是否扫条码 this.SetRowCell(4, 5, printStockTakeMaster.IsScanHu ? "条码盘点" : "数量盘点"); //创建日期 this.SetRowCell(5, 5, printStockTakeMaster.CreateDate.ToString("yyyy-MM-dd HH:mm:ss")); //创建人 this.SetRowCell(5, 1, printStockTakeMaster.CreateUserName); int l = 1; int rowadd = 1; foreach (StockTakeLocation StockTakeLocation in printStockTakeLocation) { if (l % 2 == 1) { this.SetRowCell(5 + rowadd, 1, StockTakeLocation.Location + (string.IsNullOrWhiteSpace(StockTakeLocation.LocationName) ? "" : "[" + StockTakeLocation.LocationName + "]")); } else { this.SetRowCell(5 + rowadd, 4, StockTakeLocation.Location + (string.IsNullOrWhiteSpace(StockTakeLocation.LocationName) ? "" : "[" + StockTakeLocation.LocationName + "]")); rowadd++; } l++; } }
/* * 填充报表头 * * Param pageIndex 页号 * Param orderHead 订单头对象 * Param orderDetails 订单明细对象 */ private void FillHead(PrintStockTakeMaster stockTakeMaster) { //盘点单号: string seqCode = Utility.BarcodeHelper.GetBarcodeStr(stockTakeMaster.StNo, this.barCodeFontName); this.SetRowCell(2, 6, seqCode); //盘点单号 No.: this.SetRowCell(4, 6, stockTakeMaster.StNo); //区域 this.SetRowCell(6, 2, stockTakeMaster.Region); //创建用户 this.SetRowCell(6, 6, stockTakeMaster.CreateUserName); //创建时间 this.SetRowCell(8, 6, stockTakeMaster.CreateDate.ToString("yyyy-MM-dd HH:mm:ss")); }