PrintPreview Window in C#

Posted by M.Thillai on Stack Overflow See other posts from Stack Overflow or by M.Thillai
Published on 2010-01-11T10:44:18Z Indexed on 2010/03/26 0:03 UTC
Read the original article Hit count: 696

Filed under:
|

Hello Techies,

In my windows application in .net, i need to have Print Preview option for an excel file. The followings are my codings.

//Excel.Application excelApp = new Excel.Application();

        Excel.Workbook wb = excelApp.Workbooks.Open(@"C:\\Documents and Settings \\Admin \\Desktop \\DoCoMo\\ news5.xls",
                       Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                        Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                        Type.Missing, Type.Missing, Type.Missing, Type.Missing);
        Excel.Worksheet ws = (Excel.Worksheet)wb.Worksheets[1];
        ws.PrintPreview(Type.Missing);

The compilation is successful. but i didn't get the print preview window. Is there any requirement of additional parameters or any other. I don't know how to achieve it . Please Guide me.I will be so great full to Our "Techies" for this Timely help. From, M.Thillai

© Stack Overflow or respective owner

Related posts about .NET

Related posts about c#