How to disable the console output for XSSFWorkbook

Sep 24, 2013 at 1:37 AM
Hi,
I'm using the XSSFWorkbook object in my console application, and when I run my application, I see text (as below) is written in the console during the Excel object composing.

NPOI.XSSF.Model.SharedStringsTable
NPOI.XSSF.Model.StylesTable
NPOI.XSSF.UserModel.XSSFSheet

How to disable the displaying of this text to the console..?

Thanks
Hisham
Sep 24, 2013 at 1:44 AM
I found a solution.
Before the declaration of XSSFWorkbook object configure the console output to be:

var consoleOut = new StringWriter();
Console.SetOut(consoleOut);

When you finish with the Excel object, revert the console output again to be:

var stdOut = Console.Out;
Console.SetOut(stdOut);



Cheers,
Hisham
Coordinator
Oct 8, 2013 at 5:20 PM
This is a debugging code in XSSFWorkbook. It will be removed in the final version.
Marked as answer by tonyqus on 11/16/2013 at 11:07 PM