Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* JasperReports - Free Java Reporting Library.
* Copyright (C) 2001 - 2011 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.JasperReportsContext;
import net.sf.jasperreports.engine.export.CutsInfo;
import net.sf.jasperreports.engine.export.JRExporterGridCell;
import net.sf.jasperreports.engine.export.LengthUtil;
/**
* @author Teodor Danciu ([email protected])
* @version $Id: DocxTableHelper.java 5524 2012-08-01 10:04:09Z shertage $
*/
public class DocxTableHelper extends BaseHelper
{
/**
*
*/
private CutsInfo xCuts;
private DocxCellHelper cellHelper;
private DocxParagraphHelper paragraphHelper;
/**
*
*/
protected DocxTableHelper(
JasperReportsContext jasperReportsContext,
Writer writer,
CutsInfo xCuts,
boolean pageBreak
)
{
super(jasperReportsContext, writer);
this.xCuts = xCuts;
this.cellHelper = new DocxCellHelper(jasperReportsContext, writer);
this.paragraphHelper = new DocxParagraphHelper(jasperReportsContext, 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");
exportSection(lastPage, pageWidth, pageHeight);
}
public void exportSection(boolean lastPage, int pageWidth, int pageHeight)
{
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)
{
exportEmptyCell(gridCell, emptyCellColSpan, false, 0l, null);
}
public void exportEmptyCell(JRExporterGridCell gridCell, int emptyCellColSpan, boolean startPage, long bookmarkIndex, String pageAnchor)
{
write(" \n");
write(" \n");
if (emptyCellColSpan > 1)
{
write(" \n");
}
if (gridCell != null)
{
cellHelper.exportProps(gridCell);
}
write(" \n");
paragraphHelper.exportEmptyParagraph(startPage, bookmarkIndex, pageAnchor);
write(" \n");
}
public void exportOccupiedCells(JRExporterGridCell gridCell)
{
exportOccupiedCells(gridCell, false, 0l, null);
}
public void exportOccupiedCells(JRExporterGridCell gridCell, boolean startPage, long bookmarkIndex, String pageAnchor)
{
write(" \n");
write(" \n");
if (gridCell.getColSpan() > 1)
{
write(" \n");
}
write(" \n");
cellHelper.exportProps(gridCell.getElement(), gridCell);
write(" \n");
paragraphHelper.exportEmptyParagraph(startPage, bookmarkIndex, pageAnchor);
cellHelper.exportFooter();
}
}