diff options
Diffstat (limited to 'reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java')
-rw-r--r-- | reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java index 23f959e05943..a30a97a1e7e1 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: PentahoReportJob.java,v $ - * $Revision: 1.8.16.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -29,10 +26,8 @@ ************************************************************************/ package com.sun.star.report.pentaho; -import java.io.IOException; -import java.lang.Integer;import java.util.ArrayList; - import com.sun.star.report.DataSourceFactory; +import com.sun.star.report.ImageService; import com.sun.star.report.InputRepository; import com.sun.star.report.JobDefinitionException; import com.sun.star.report.JobProgressIndicator; @@ -43,7 +38,6 @@ import com.sun.star.report.ReportEngineParameterNames; import com.sun.star.report.ReportExecutionException; import com.sun.star.report.ReportJob; import com.sun.star.report.ReportJobDefinition; -import com.sun.star.report.ImageService; import com.sun.star.report.SDBCReportDataFactory; import com.sun.star.report.pentaho.loader.InputRepositoryLoader; import com.sun.star.report.pentaho.model.OfficeDetailSection; @@ -51,15 +45,19 @@ import com.sun.star.report.pentaho.model.OfficeDocument; import com.sun.star.report.pentaho.model.OfficeGroup; import com.sun.star.report.pentaho.model.OfficeReport; import com.sun.star.report.pentaho.output.chart.ChartRawReportProcessor; -import com.sun.star.report.pentaho.output.text.TextRawReportProcessor; import com.sun.star.report.pentaho.output.spreadsheet.SpreadsheetRawReportProcessor; +import com.sun.star.report.pentaho.output.text.TextRawReportProcessor; + +import java.io.IOException; + +import java.lang.Integer; + +import java.util.ArrayList; import java.util.List; -import org.pentaho.reporting.libraries.formula.lvalues.ContextLookup; -import org.pentaho.reporting.libraries.formula.lvalues.FormulaFunction; -import org.pentaho.reporting.libraries.formula.lvalues.LValue; -import org.pentaho.reporting.libraries.formula.lvalues.Term; -import org.pentaho.reporting.libraries.formula.parser.FormulaParser; -import org.pentaho.reporting.libraries.formula.parser.ParseException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.jfree.report.expressions.Expression; import org.jfree.report.expressions.FormulaExpression; import org.jfree.report.flow.DefaultReportJob; @@ -68,12 +66,18 @@ import org.jfree.report.flow.raw.XmlPrintReportProcessor; import org.jfree.report.structure.Node; import org.jfree.report.structure.Section; import org.jfree.report.util.ReportParameters; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; + +import org.pentaho.reporting.libraries.formula.lvalues.ContextLookup; +import org.pentaho.reporting.libraries.formula.lvalues.FormulaFunction; +import org.pentaho.reporting.libraries.formula.lvalues.LValue; +import org.pentaho.reporting.libraries.formula.lvalues.Term; +import org.pentaho.reporting.libraries.formula.parser.FormulaParser; +import org.pentaho.reporting.libraries.formula.parser.ParseException; import org.pentaho.reporting.libraries.resourceloader.Resource; import org.pentaho.reporting.libraries.resourceloader.ResourceException; import org.pentaho.reporting.libraries.resourceloader.ResourceManager; + /** * ToDo: Allow interrupting of jobs and report the report progress */ @@ -257,6 +261,11 @@ public class PentahoReportJob implements ReportJob if (parameters.length > 0) { String name = parameters[0].toString(); + if (parameters[0] instanceof ContextLookup) + { + final ContextLookup context = (ContextLookup) parameters[0]; + name = context.getName(); + } for (int j = 0; j < reportFunctions.length; j++) { if (reportFunctions[j] instanceof FormulaExpression) @@ -370,7 +379,7 @@ public class PentahoReportJob implements ReportJob catch (final Exception e) { String message = e.getMessage(); - if (message.length() == 0) + if (message == null || message.length() == 0) { message = "Failed to process the report"; } |