Tag: cws_src680_pentaho1
User: tmorgner
Date: 2008-01-15 13:56:23+0000
Modified:
   
dba/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java

Log:
 Issue number:  71973
 
 Page-Header and -Footer in Spreadsheet export will only be printed, if they
 are enabled to print on the same page as the report-header and report-footer
 (print-with-header and print-with-footer attribute set). This matches the
 behavior of the text-export. But as the spreadsheet export does not generate
 pagebreaks, these flags inhibit the header and footer altogether
 
 

File Changes:

Directory: 
/dba/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/
=================================================================================

File [changed]: SpreadsheetRawReportTarget.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java?r1=1.3.32.1&r2=1.3.32.2
Delta lines:  +30 -2
--------------------
--- SpreadsheetRawReportTarget.java     2008-01-15 13:46:50+0000        1.3.32.1
+++ SpreadsheetRawReportTarget.java     2008-01-15 13:56:20+0000        1.3.32.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: SpreadsheetRawReportTarget.java,v $
  *
- *  $Revision: 1.3.32.1 $
+ *  $Revision: 1.3.32.2 $
  *
- *  last change: $Author: tmorgner $ $Date: 2008/01/15 13:46:50 $
+ *  last change: $Author: tmorgner $ $Date: 2008/01/15 13:56:20 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -52,6 +52,7 @@
 import com.sun.star.report.pentaho.model.OfficeStylesCollection;
 import com.sun.star.report.pentaho.model.OfficeMasterPage;
 import com.sun.star.report.pentaho.model.OfficeMasterStyles;
+import com.sun.star.report.pentaho.model.PageSection;
 import com.sun.star.report.pentaho.output.OfficeDocumentReportTarget;
 import com.sun.star.report.pentaho.output.StyleUtilities;
 import com.sun.star.report.pentaho.output.text.MasterPageFactory;
@@ -211,6 +212,33 @@
     }
   }
 
+  protected void startReportSection(final AttributeMap attrs, final int role) 
throws IOException, DataSourceException, ReportProcessingException
+  {
+    if ((role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER ||
+         role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) &&
+        (PageSection.isPrintWithReportHeader(attrs) == false ||
+         PageSection.isPrintWithReportFooter(attrs) == false))
+    {
+      startBuffering(new OfficeStylesCollection(), true);
+      return;
+    }
+    super.startReportSection(attrs, role);
+  }
+
+  protected void endReportSection(final AttributeMap attrs, final int role) 
throws IOException, DataSourceException, ReportProcessingException
+  {
+    if ((role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER ||
+         role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) &&
+        (PageSection.isPrintWithReportHeader(attrs) == false ||
+         PageSection.isPrintWithReportFooter(attrs) == false))
+    {
+      finishBuffering();
+      return;
+    }
+
+    super.endReportSection(attrs, role);    
+  }
+
   private void processElement(final AttributeMap attrs, final String 
namespace, final String elementType)
       throws IOException, ReportProcessingException
   {




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to