Exemplo n.º 1
0
        public string TestV2_Step1(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);
                r = excelApp.WorksheetName.ToString();
            }

            return(r);
        }
Exemplo n.º 2
0
        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("方法运行结束");
        }