使用C#.Net打印Excel工作表 [英] print the Excel Sheet using C#.Net
问题描述
尊敬的朋友
我可以使用C#.Net创建一个新的Excel文件并在其中写入数据,现在我想使用C#.Net打印Excel工作表.请替换?".在下面的代码中,并更改其工作方式.并且请让我知道如何使用C#.net完全关闭excel应用程序.
Dear Friends
Using C#.Net, I could create a New Excel File and write data in it, now I want to print the Excel Sheet using C#.Net. Pls Replace the "?" in the below code and change in the way that it could work. and also pls let me know how a excel application can be completely closed using C#.net.
Excel.Application xlApp;
Excel._Workbook xlBook;
Excel._Worksheet xlsheet;
xlApp =新的Excel.Application(); br/> xlBook =(Excel._Workbook)(xlApp.Workbooks.Add(1));
xlsheet =(Excel._Worksheet)xlBook.ActiveSheet;
Excel.Application xlApp;
Excel._Workbook xlBook;
Excel._Worksheet xlsheet;
xlApp = new Excel.Application();
xlApp.Visible = true;
xlBook = (Excel._Workbook)(xlApp.Workbooks.Add(1));
xlsheet = (Excel._Worksheet)xlBook.ActiveSheet;
xlsheet.Cells [RowIndex,ColoumnIndex] =清除我的疑问";
xlsheet.Cells[RowIndex, ColoumnIndex] = "Clear My Doubts";
xlsheet.PrintOut(1、1、1、1,"EXPORTS上的Auto Samsung ML-1610系列",?,?,?);
xlsheet.PrintOut(1, 1, 1, 1, "Auto Samsung ML-1610 Series on EXPORTS", ?, ?, ?);
推荐答案
您好,
您可以通过下面的链接打印工作表.
您可以尝试使用xlApp.Quit关闭,我不确定...
这篇关于使用C#.Net打印Excel工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!