net.sf.jasperreports.engine.export.ooxml.PptxTableHelper Maven / Gradle / Ivy
The newest version!
/*
* JasperReports - Free Java Reporting Library.
* Copyright (C) 2001 - 2023 Cloud Software Group, Inc. 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])
*/
public class PptxTableHelper extends BaseHelper
{
/**
*
*/
private CutsInfo xCuts;
private PptxCellHelper cellHelper;
private PptxParagraphHelper paragraphHelper;
/**
*
*/
protected PptxTableHelper(
JasperReportsContext jasperReportsContext,
Writer writer,
CutsInfo xCuts
)
{
super(jasperReportsContext, writer);
this.xCuts = xCuts;
this.cellHelper = new PptxCellHelper(jasperReportsContext, writer);
this.paragraphHelper = new PptxParagraphHelper(jasperReportsContext, writer);
}
/**
*
*/
public PptxCellHelper getCellHelper()
{
return cellHelper;
}
/**
*
*/
public PptxParagraphHelper getParagraphHelper()
{
return paragraphHelper;
}
/**
*
*/
public void exportHeader()
{
write(" \n");
write(" \n");
write(" {2D5ABB26-0587-4C30-8999-92F81FD0307C} \n");
write(" \n");
write(" \n");
for(int col = 1; col < xCuts.size(); col++)
{
write(" \n");
}
write(" \n");
}
public void exportFooter()
{
write(" \n");
}
public void exportRowHeader(int rowHeight)
{
write(" \n");
}
public void exportRowFooter()
{
write(" \n");
}
public void exportEmptyCell(
JRExporterGridCell gridCell,
JRExporterGridCell topGridCell,
JRExporterGridCell leftGridCell,
JRExporterGridCell rightGridCell,
JRExporterGridCell bottomGridCell
)
{
cellHelper.exportHeader(gridCell);
paragraphHelper.exportEmptyParagraph();
write(" \n");
cellHelper.getBorderHelper().exportBorder(gridCell, topGridCell, leftGridCell, rightGridCell, bottomGridCell);
cellHelper.exportBackcolor(gridCell);
write(" \n");
cellHelper.exportFooter();
}
public void exportOccupiedCells(
JRExporterGridCell gridCell,
JRExporterGridCell topGridCell,
JRExporterGridCell leftGridCell,
JRExporterGridCell rightGridCell,
JRExporterGridCell bottomGridCell
)
{
write(" \n");
// write(" 1 ? (" gridSpan=\"" + gridCell.getColSpan() +"\"") : "") + " vMerge=\"1\">\n");
paragraphHelper.exportEmptyParagraph();
write(" \n");
cellHelper.getBorderHelper().exportBorder(gridCell, topGridCell, leftGridCell, rightGridCell, bottomGridCell);
cellHelper.exportBackcolor(gridCell);
write(" \n");
cellHelper.exportFooter();
}
}