net.sf.jasperreports.engine.export.ooxml.DocxTableHelper Maven / Gradle / Ivy
/*
* JasperReports - Free Java Reporting Library.
* Copyright (C) 2001 - 2009 Jaspersoft Corporation. All rights reserved.
* http://www.jaspersoft.com
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program is part of JasperReports.
*
* JasperReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* JasperReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with JasperReports. If not, see .
*/
package net.sf.jasperreports.engine.export.ooxml;
import java.io.Writer;
import net.sf.jasperreports.engine.export.CutsInfo;
import net.sf.jasperreports.engine.export.JRExporterGridCell;
/**
* @author Teodor Danciu ([email protected])
* @version $Id: DocxTableHelper.java 3439 2010-02-18 14:57:42Z teodord $
*/
public class DocxTableHelper extends BaseHelper
{
/**
*
*/
private CutsInfo xCuts = null;
private DocxCellHelper cellHelper = null;
private DocxParagraphHelper paragraphHelper = null;
/**
*
*/
protected DocxTableHelper(
Writer writer,
CutsInfo xCuts,
boolean pageBreak
)
{
super(writer);
this.xCuts = xCuts;
this.cellHelper = new DocxCellHelper(writer);
this.paragraphHelper = new DocxParagraphHelper(writer, pageBreak);
}
/**
*
*/
public DocxCellHelper getCellHelper()
{
return cellHelper;
}
/**
*
*/
public DocxParagraphHelper getParagraphHelper()
{
return paragraphHelper;
}
/**
*
*/
public void exportHeader()
{
write(" \n");
write(" \n");
write(" \n");
write(" \n");
write(" \n");
for(int col = 1; col < xCuts.size(); col++)
{
write(" \n");
}
write(" \n");
}
public void exportFooter(boolean lastPage, int pageWidth, int pageHeight)
{
write(" \n");
if (lastPage)
{
write(" \n");
write(" \n");
write(" \n");
write(" \n");
write(" \n");
write(" \n");
write(" \n");
write(" \n");
write(" \n");
}
}
public void exportRowHeader(int rowHeight, boolean allowRowResize)
{
write(" \n");
write(" \n");
write(" \n");
write(" \n");
}
public void exportRowFooter()
{
write(" \n");
}
public void exportEmptyCell(JRExporterGridCell gridCell, int emptyCellColSpan)
{
write(" \n");
write(" \n");
if (emptyCellColSpan > 1)
{
write(" \n");
}
if (gridCell != null)
{
cellHelper.exportProps(gridCell);
}
write(" \n");
paragraphHelper.exportEmptyParagraph();
write(" \n");
}
public void exportOccupiedCells(JRExporterGridCell gridCell)
{
write(" \n");
write(" \n");
if (gridCell.getColSpan() > 1)
{
write(" \n");
}
write(" \n");
cellHelper.exportProps(gridCell.getElement(), gridCell);
write(" \n");
paragraphHelper.exportEmptyParagraph();
cellHelper.exportFooter();
}
}