Hello,
They try the newest version.
But after uploading the license code they click the “print preview”, it still crashed. It works fine if they remove the license code.
Here is the related code.
Uploaded license code:
public void loadExcelLicense() {
synchronized (sync) {
if (excelLic == null ) {
InputStream is = null ;
try {
excelLic = new com.aspose.cells.License();
is = LicenseManager.class .getResourceAsStream(“config/Aspose.Cells.lic”);
excelLic.setLicense(is);
} catch (Exception e) {
throw new RuntimeException(“load Cells license failed!”, e);
} finally {
EdocTool.getInstance().releaseStream(is);
}
}
}
}
QR code:
private void xxx(Worksheet sheet, byte [] picData, int position) {
if (picData != null ) {
PageSetup pageSetup = sheet.getPageSetup();
String footerStr = pageSetup.getFooter(position);
if (footerStr == null ) {
footerStr = “&G”;
} else {
footerStr = “&G\n” + footerStr;
}
pageSetup.setFooter(position, footerStr);// “&G”
pageSetup.setFooterPicture(position, picData);
}
}
Watermark Code:
private void yyy(Worksheet sheet, byte [] vPicData, byte [] hPicData, int position) {
if (vPicData != null || hPicData != null ) {
PageSetup pageSetup = sheet.getPageSetup();
int orientation=pageSetup.getOrientation();
String footerStr = pageSetup.getFooter(position);
if (footerStr == null || “&G”.equals(footerStr)) {
footerStr = “&G”;
} else if (!footerStr.contains(“&G”)) {
footerStr = “&G\n” + footerStr;
}
pageSetup.setFooter(position, footerStr);// “&G”
if (orientation == 1) {
pageSetup.setFooterPicture(position, vPicData);
} else {
pageSetup.setFooterPicture(position, hPicData);
}
}
}
Locked Document content:
private void zzz(final String pwd, Worksheet sheet) {
sheet.protect(ProtectionType.ALL, pwd, pwd);
sheet.protect(ProtectionType.NONE, pwd, pwd);
sheet.protect(ProtectionType.CONTENTS, pwd, pwd);
sheet.protect(ProtectionType.OBJECTS, pwd, pwd);
sheet.protect(ProtectionType.SCENARIOS, pwd, pwd);
sheet.protect(ProtectionType.STRUCTURE, pwd, pwd);
sheet.protect(ProtectionType.WINDOWS, pwd, pwd);
Protection protection = sheet.getProtection();
protection.setAllowDeletingColumn(false );
protection.setAllowDeletingRow(false );
protection.setAllowEditingContent(false );
protection.setAllowEditingObject(false );
protection.setAllowEditingScenario(false );
protection.setAllowFormattingCell(false );
protection.setAllowFormattingRow(false );
protection.setAllowInsertingColumn(false );
protection.setAllowInsertingHyperlink(false );
protection.setAllowInsertingRow(false );
protection.setAllowSelectingLockedCell(true );
protection.setAllowSelectingUnlockedCell(true );
protection.setAllowSorting(true );
protection.setAllowUsingPivotTable(false );
// protection.setAllowSelectingUnlockedCell(false);
// protection.setAllowSelectingLockedCell(false);
protection.setPassword(pwd);
}
Here was your previous response.
Hi,
Thank you for contacting Aspose support.
We have checked your provided spreadsheet “(Add_wartermark)test.xlsx” that caused the MS Excel 2007 to crash upon viewing in Preview mode. However, we could investigate the matter further because you haven’t yet shared the source code to create such spreadsheet. We would request you to please provide the source code as well as the images to be inserted in the resultant spreadsheet to replicate the problem. Upon reviewing the requested information, we will be in a better position to assist you with this problem.
Before you provide us the above requested information, please give a try to the latest version of Aspose.Cells for Java 8.1.2.5 on your end.
You were sent this email because you opted to receive email
notifications when someone responded to this thread.
To unsubscribe,
either:
- Visit the above URL and deselect ‘Email me when someone
replies…’ - Visit your user profile page and uncheck ‘Enable email
tracking’
Thanks,
Aspose.com team