public string TestV2_Step3(string fileName) { string r = string.Empty; string path = System.IO.Path.Combine(this.Server.MapPath("~/ConcurrentTest/"), $"{fileName}.xlsx"); using (var excelApp = new Util.Excel.ExcelApp_V2()) { excelApp.Open(path); excelApp.Save(); excelApp.Print(isLandscape: true); r = excelApp.WorksheetName.ToString(); } return(r); }
private void BtnPrint_Click(object sender, RoutedEventArgs e) { try { var filePath = System.IO.Path.Combine(Environment.CurrentDirectory, "广汽确认单打印.xlsx"); using (var excelApp = new Util.Excel.ExcelApp_V2()) { excelApp.Open(filePath); string workSheetName = excelApp.WorksheetName; System.Diagnostics.Debug.WriteLine(workSheetName); excelApp.Print(isLandscape: true); } } catch (Exception ex) { MessageBox.Show(ex.GetFullInfo()); } System.Diagnostics.Debug.WriteLine("方法运行结束"); }