From d6511655112d7411ffbbacb651b9927305fda99b Mon Sep 17 00:00:00 2001 From: Luc Boudreau Date: Wed, 28 Jul 2010 19:56:14 +0000 Subject: [PATCH] Better usage of the formatter. git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@332 c6a108a4-781c-0410-a6c6-c2d559e19af0 --- src/org/olap4j/sample/PaloConnection.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/org/olap4j/sample/PaloConnection.java b/src/org/olap4j/sample/PaloConnection.java index 650d26c..92922e6 100644 --- a/src/org/olap4j/sample/PaloConnection.java +++ b/src/org/olap4j/sample/PaloConnection.java @@ -18,7 +18,7 @@ import org.olap4j.OlapStatement; import org.olap4j.OlapWrapper; import org.olap4j.driver.xmla.XmlaOlap4jDriver; -import org.olap4j.layout.TraditionalCellSetFormatter; +import org.olap4j.layout.RectangularCellSetFormatter; /** * This class demonstrates how to connect the {@link XmlaOlap4jDriver} @@ -49,10 +49,14 @@ public static void main(String[] args) throws Exception { "SELECT {[store].[USA]} ON COLUMNS , {[Account].[1000]} ON ROWS\n" + "FROM [Budget]"); - TraditionalCellSetFormatter formatter = - new TraditionalCellSetFormatter(); + // We use the utility formatter. + RectangularCellSetFormatter formatter = + new RectangularCellSetFormatter(false); - formatter.format(cellSet, new PrintWriter(System.out)); + // Print out. + PrintWriter writer = new PrintWriter(System.out); + formatter.format(cellSet, writer); + writer.flush(); statement.close(); connection.close();