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.
/* Copyright 2017 Alfa Financial Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.alfasoftware.morf.excel;
import java.io.IOException;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.Optional;
import org.alfasoftware.morf.dataset.DataSetConsumer;
import org.alfasoftware.morf.dataset.Record;
import org.alfasoftware.morf.metadata.Table;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import jxl.Workbook;
import jxl.format.Alignment;
import jxl.format.Colour;
import jxl.format.UnderlineStyle;
import jxl.write.Label;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableHyperlink;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
/**
* Consumes data sets and outputs spreadsheets.
*
* @author Copyright (c) Alfa Financial Software 2010
*/
public class SpreadsheetDataSetConsumer implements DataSetConsumer {
private static final Log log = LogFactory.getLog(SpreadsheetDataSetConsumer.class);
/**
*
* The number of rows in the title.
*/
private static final int NUMBER_OF_ROWS_IN_TITLE = 2;
/**
* The number of rows to include in the sample section if not specified.
*/
private static final int DEFAULT_SAMPLE_ROWS = 5;
/**
* Stream to which the spreadsheet will be output.
*/
private final OutputStream documentOutputStream;
/**
* The workbook currently under construction.
*/
private WritableWorkbook workbook;
/**
* Number of rows to output for each table.
*/
private final Optional