Advertisement
moabcavsa

xpietro

Jun 5th, 2021
882
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.89 KB | None | 0 0
  1.  LPDExcelExport conf;
  2.             LPDExcelSheetParameter param;
  3.             LPDExcelSheet sheet;
  4.             List<RWSSchemaDevice> firstPreset = new List<RWSSchemaDevice>();
  5.             List<RWSSchemaDevice> secondPreset = new List<RWSSchemaDevice>();
  6.  
  7.             List<LPDExcelExport> confList;
  8.             try
  9.             {
  10.                 confList = new List<LPDExcelExport>();
  11.  
  12.                 conf = new LPDExcelExport("xd.xlsx");
  13.                 param = new LPDExcelSheetParameter("SCHEMA", this.Items.ToList());
  14.                 sheet = new LPDExcelSheet("RWSSchemaDeviceComparer");
  15.                 sheet.Parameters.Add(param);
  16.                 conf.AddSheet(sheet);
  17.                 confList.Add(conf);
  18.                 foreach(var item in Items)
  19.                 {
  20.                     firstPreset.Add(item);
  21.                     secondPreset.Add(item.SecondPreset);
  22.                 }
  23.  
  24. //                conf = new LPDExcelExport("compareSchema.xlsx");
  25. //                param = new LPDExcelSheetParameter("Dress1", firstPreset);
  26. //                sheet = new LPDExcelSheet("Dress1");
  27. //                sheet.Parameters.Add(param);
  28. //                conf.AddSheet(sheet);
  29. //                confList.Add(conf);
  30.  
  31.                 conf = new LPDExcelExport("xd.xlsx");
  32.                 param = new LPDExcelSheetParameter("firstSchema", secondPreset.ToList());
  33.                 sheet = new LPDExcelSheet("firstSchema");
  34.                 sheet.Parameters.Add(param);
  35.                 conf.AddSheet(sheet);
  36.                 confList.Add(conf);
  37.  
  38.                 LPDHlpExcelTemplatePrintHelper.PrintToExcel(confList);
  39.  
  40.                 Helper.Dialog.ShowInfoMessage(RWSResourceKeys.RWSPrintSuccesful);
  41.             }
  42.             catch (Exception ex)
  43.             {
  44.                 this.HandleError(ex);
  45.                 Helper.Dialog.ShowErrorMessage(RWSResourceKeys.RWSPrintFailed, ex.Message);
  46.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement