We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Print titles issue in XLSX

Hi,

We would like to support XLSX in our application. I downloaded the latest JAR, however there are a couple of issues:
1. In charts the plot area which we used to position for XLS, is placed more to the top, interfering with the chart title. I can try to set different values for different versions, the more important issue is next.

2. Print titles make XLSX corrupt, while they work perfectly in XLS. Please run the following code and open the results:

public class PrintTitlesTest
{
public static void main(String[] args) throws Exception
{
Workbook wb = new Workbook();
Worksheet sheet = wb.getWorksheets().getSheet(0);
for(int i=0; i<100; ++i)
for(int j=0; j<20; ++j)
{
Object val = (i==0) ? “row0col”+j : (j==0) ? “row”+i+“col0” : i*j;
sheet.getCells().getCell(i, j).setValue(val);
}
PageSetup pageSetup = sheet.getPageSetup();
pageSetup.setPrintTitleColumns("$A:$A");
pageSetup.setPrintTitleRows("$1:$1");
wb.save(“ver_1997.xls”, FileFormatType.EXCEL97TO2003);
wb.save(“ver_2007.xlsx”, FileFormatType.EXCEL2007);
}
}


regards,
Laszlo Borsos
MSCI

Hi,

1) Could you provide me the sample files and sample code to reproduce the issue.

2) I have used your code with the attached latest version/fix, it works fine. The generated XLSX file opens fine into MS Excel 2007, I have attached the xlsx file here. Moreover, I have attached the latest version/fix of Aspose.Cells for Java here for your to try.

Thank you.

Hello,

Thanks for your response.

1) I will send you personal mail with some attachments.

2) The attached jar was really working, while I had tried to use the public download 2.3.1.

thanks,
Laszlo

Hi,

Thanks for providing us the sample files and code segment.

I have logged your issue into our issue tracking system with an id: CELLSJAVA-19083. We will look into it and get back to you soon.

Thank you.


Hello,

May I ask if this is scheduled for a specific version?

We would still like to support XLSX, but charts must look the same as in XLS.

thanks,

Laszlo

Hi,

Well, your issue is under process. I am afraid, we need some time to figure out the position and data size of objects, such as plot area,
legend, title to be calculated in the same way as MS Excel. Your issue cannot be supported so soon. We will check if we can provide you an eta for it.

Thank you.

Hi,


We are working on such kind of issues for Charts. But since these are complicated features and we need more time to sort out the things. Hope we can solve it in about a month's time. Before that, I think as a workaround you can just let the PlotArea use default size and position without setting custom data for them. That is, removing the code like following in your program:

/*plot.setX(126);
plot.setWidth(3800);
plot.setY(130);
plot.setHeight(3700);*/

Or, please provide a proper value for the Y-position of plotarea so there should be enough space for displaying chart title:

plot.setX(126);
plot.setWidth(3800);
plot.setY(400);
plot.setHeight(3700);

Thank you.

Hi,

Thank you for your reply.

The reason I use this positioning is that I need to exactly implement the charts designed by others in Excel. If I read those Excel files with Aspose and use get...() methods for the position values, and then try to use those values, the output will not be the same, which is kind of confusing.

Through trial and error I have experimented similar values for XLSX, and use conditionals based on the output format.

The issue I cannot work around currently is with the horizontal axis. Sometimes I cannot set its font:

chart.getValueAxis().setFont(myTahoma6ptFont);

This always works for XLS, but for XLSX it is sometimes considered, sometimes not. Please see the samples I sent earlier. The smaller charts have this problem, the bigger one does not.

thanks,

Laszlo

The axis issue is triggered in XLSX when you apply the same font instance to the value axis and the chart area.

Laszlo

<!–[if gte mso 10]> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}

<![endif]–>

Please try our latest version:

http://www.aspose.com/community/files/72/java-components/aspose.cells-for-java/entry259789.aspx

We have fixed the font issue for creating Excel2007 file.