Hi,
Please treat this as extremely urgent request as we need to go into production tomorrow. The pivot table and pivot chart is not getting copied completely when we perform workbook.combine()
Please find attached:
Sample input file: Test.xls
Sample output file: outputWithAspose.xls
The issue is the copied workbook does not have properties like chart data range, it does not have the pivot table properties.
Sample code:
/*
* File : $Source: $
* Version : $Revision: $
* Date : $Date: $
* Modified by : $Author: $
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import com.aspose.cells.FileFormatType;
import com.aspose.cells.License;
import com.aspose.cells.Workbook;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class TestAspose
{
static String wd = "C:\\Developer\\TEMP\\frame\\";
@SuppressWarnings("unchecked")
public static void main(String[] args) throws Exception
{
File file = new File("C:\\Developer\\TEMP\\frame\\");
File[] inputFiles = file.listFiles();
License license = new License();
license.setLicense(new FileInputStream("C:\\Developer\\work\\workspace\\TestAspose\\lib\\Aspose.Cells.lic"));
Workbook outputWorkbook = new Workbook();
for (File inputFile : inputFiles)
{
if (!inputFile.getAbsolutePath().equalsIgnoreCase("C:\\Developer\\TEMP\\frame\\master_blank.xls"))
{
Workbook book = new Workbook();
book.open(inputFile.getAbsolutePath());
outputWorkbook.combine(book);
}
}
String fileName = wd + "outputWithAspose.xls";
outputWorkbook.save(fileName, FileFormatType.EXCEL97TO2003);
}
}
Please let me know if you require any further details.
Your help is much appreciated.
Thanks
DJ