Hi,
Hi Babur,
I am facing a different issue when I try to change the sheet name of the copied sheet. It is losing all pivot chart property
The pivot table is copied now but the other issue reported was as follows:
When the user right clicks on the chart in the sample input file I attached and selects "Select Data"
The property "Chart data range" has the value : [Test.xls]Test!Pivot16
This property is not set in the new workbook.
Thanks
DJ
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.*;
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());
Worksheets sheets = book.getWorksheets();
Worksheet sheet = sheets.getSheet(0);
sheet.setName("Test");
outputWorkbook.combine(book);
}
}
String fileName = wd + "outputWithAspose.xls";
outputWorkbook.save(fileName, FileFormatType.EXCEL97TO2003);
}
}
Hi,
Thanks for your feedback. We will look into this asap and get back to you. I have also saved your comment in our database.
Hi,<br><br>It is not the issue of
Workbook.combine() function. Currently we do not support to parse and
update the pivot source of chart when update sheet/pivottable’s name.
Even only open the source file that contains pivot chart and then change
the sheet name or pivot table’s name, the source of pivot chart will be
lost. We will look into it soon to check whether we can improve it.
The issues you have found earlier (filed as 28029) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.