copy from Application/IStation.Application.DataFile/Report/PdfCreate/ReportPdf4Default.cs
copy to Application/IStation.Application.DataFile/Report/PdfCreate/Eta_Month_ReportPdf.cs
Îļþ´Ó Application/IStation.Application.DataFile/Report/PdfCreate/ReportPdf4Default.cs ¸´ÖÆ |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class ReportPdf4Default |
| | | public class Eta_Month_ReportPdf |
| | | { |
| | | #region 屿§ |
| | | Document _document; |
| | |
| | | /// <param name="list">æºæ³µä¿¡æ¯å表</param> |
| | | /// <param name="path">è·¯å¾</param> |
| | | /// <returns></returns> |
| | | public bool Create4Stream(Station station, List<Model.PipeLine> pipeList, List<EtaSumSingleDayRecord> list, DateTime datatime, string path) |
| | | public bool Create4Stream(Station station, List<Model.PipeLine> pipeList, List<Model.EtaSumSingleMonthRecord> list,string path) |
| | | { |
| | | InitialFont(); |
| | | //åå§åæ é¢ä¸çLOGOå¾ç |
| | |
| | | _document.SetMargins(-40, -40, 40, 40); |
| | | _writer = PdfWriter.GetInstance(_document, new FileStream(path, FileMode.Create)); |
| | | _writer.PageEvent = new CreatHeaderAndFoot(); |
| | | CreatestationInfoPage(station, pipeList, list, datatime);//产åä¿¡æ¯ |
| | | CreatestationInfoPage(station, pipeList, list);//产åä¿¡æ¯ |
| | | _document.Close(); |
| | | return true; |
| | | } |
| | |
| | | /// <param name="sum"></param> |
| | | /// <param name="pipeList"></param> |
| | | /// <param name="list"></param> |
| | | public void CreatestationInfoPage(Station station, List<Model.PipeLine> pipeList, List<EtaSumSingleDayRecord> list, DateTime dateTime) |
| | | public void CreatestationInfoPage(Station station, List<Model.PipeLine> pipeList, List<Model.EtaSumSingleMonthRecord> list) |
| | | { |
| | | _document.Open(); |
| | | _document.NewPage(); |
| | |
| | | Dt = Math.Round((double)dt, 2).ToString(); |
| | | if (dt > 1000) |
| | | Dt = Math.Round((double)dt, 1).ToString(); |
| | | CreatestationTable(station, runcout, dateTime, Qt, Dt); |
| | | CreatestationTable(station, runcout, Qt, Dt); |
| | | CreatestationInfoTable(pipeList, list, station.ID); |
| | | PdfPTable table1 = new PdfPTable(3); |
| | | float[] widths = { 80, 140, 300 }; |
| | |
| | | /// 设å¤ä¿¡æ¯ |
| | | /// </summary> |
| | | // |
| | | public void CreatestationTable(Station station, int cout, DateTime datatime, string qt, string dt) |
| | | public void CreatestationTable(Station station, int cout, string qt, string dt) |
| | | { |
| | | PdfPTable table = new PdfPTable(4); |
| | | PdfPCell cell = new PdfPCell(); |
| | |
| | | table.AddCell(cell); |
| | | cell = CreateCell2("æ¥åæ¥æ", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2(datatime.ToShortDateString(), _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | cell = CreateCell2("", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2("使ç¨ç¶æ", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | |
| | | /// çææºæ³µå表 |
| | | /// </summary> |
| | | /// <param name="list">æºæ³µå表</param> |
| | | public void CreatestationInfoTable(List<Model.PipeLine> pipeList, List<EtaSumSingleDayRecord> list, long stationID) |
| | | public void CreatestationInfoTable(List<Model.PipeLine> pipeList, List<Model.EtaSumSingleMonthRecord> list, long stationID) |
| | | { |
| | | |
| | | PdfPTable table = new PdfPTable(5); |
| | |
| | | var ProductList = new Service.Product().GetByCorpID(list.FirstOrDefault().CorpID); |
| | | cell = CreateCell2("è½æä¿¡æ¯", _fontSize11, 5, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | var seviceEnginePump = new Service.Product(); |
| | | foreach (var item in list) |
| | | { |
| | | var EnginePumpLine = pipeList?.Find(x => x.ID == item.ObjectID); |
| | | var EnginePump = ProductList.Find(x => x.BelongID == stationID && x.Name == EnginePumpLine.Name); |
| | | var Pump = new Service.Product().GetChildPumpByEnginePumpID(EnginePump.CorpID, EnginePump.ID); |
| | | var Motor = new Service.Product().GetChildMotorByEnginePumpID(EnginePump.CorpID, EnginePump.ID); |
| | | var Pump = seviceEnginePump.GetChildPumpByEnginePumpID(EnginePump.CorpID, EnginePump.ID); |
| | | var Motor = seviceEnginePump.GetChildMotorByEnginePumpID(EnginePump.CorpID, EnginePump.ID); |
| | | |
| | | cell = CreateCell2(EnginePump?.Name, _fontSize11, 1, 4, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |