Hi there
I encounter a programming problem about Aspose.Cell. At this test, I want to insert a image created by Aspose Cell into a word file. Everything is all right except the the code in red.
Is there any way to set the charset for the cell, or solve the problem?
Thanks for help.
There are part of my codes:
Chart chart = null;
Workbook workbook = new Workbook();
workbook.getWorkbookSettings().setLanguage(CountryCode.CHINA);
Worksheet sheet = workbook.getWorksheets().getSheet(0);
sheet.setName(“Data”);
chart = sheet.getCharts().addChart(ChartType.COLUMN_CLUSTERED, 1, 1, 20, 10);
Cells cells = sheet.getCells();
int[][] array = {
{2011, 555, 869},
{2012, 286, 565}
};
cells.importArray(array, 0, 0);
cells.getCell(2, 1).setValue(" 北京 ");
cells.getCell(2, 2).setValue(" 郑州 ");
System.out.println(cells.getCell(2,1).getValue()); // it will display " 北京 "
chart.getNSeries().add(“Data!B1:C2”, true);
chart.getNSeries().setCategoryData(“Data!A1:A2”);
for (int i = 0; i < chart.getNSeries().size(); i++){
chart.getNSeries().get(i).setName(cells.getCell(2, i + 1).getValue().toString());
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
chart.toImage(out, new ImageOptions());
byte[] data = out.toByteArray();
BufferedImage image = ImageIO.read(new ByteArrayInputStream(data));
builder.moveToBookmark(“COLUMN”);
builder.insertImage(image);
This message was posted using Email2Forum by aske012.