Question

1
Replies
534
Views
Sireeshak3241 Member since 2014 7 posts
Verizon
Posted: 4 years ago
Last activity: 4 years 4 months ago
Closed

MSOGenerateExcelFile not reading data from Page list Version 6.2

This is my Rule File binary

Calling MSOGenerateExcelFile passing required parametrs

here in the 4 th step I customized Java code not to fire NullPointerException.

String xlFileName = tools.getParamValue("FSFileName");
PRFile xlFile = new PRFile(xlFileName);

java.io.OutputStream xlOS = null;
java.io.InputStream tempIS = null;
byte[] tempBytes = null;
boolean projectSizingPresent = true;
boolean sizingAttachmentPresent=true;
String strWorkObjectRef = "";
ClipboardPage objRefPage = null;
java.util.ArrayList sizingList = new java.util.ArrayList();
try {
ClipboardPage workPage = tools.findPage("pyWorkPage");
tempBytes = new com.pega.pegarules.pub.util.Base64Util().decodeToByteArray(tools.findPage("TemplateFile").getString("pyFileSource"));

tempIS = new java.io.ByteArrayInputStream(tempBytes);
java.util.Map xlZipEntryMap = null;
if(sizingAttachmentPresent){
  xlZipEntryMap  = com.pegarules.generated.pega_appdefinition_excelintegration.DCOXLGenerateZipEntryMap2(tempIS,tools);
}
else{
  xlZipEntryMap = com.pegarules.generated.pega_appdefinition_excelintegration.DCOXLGenerateZipEntryMap(tempIS);
}
xlOS = new PROutputStream(xlFile);
com.pegarules.generated.pega_appdefinition_excelintegration.DCOzipEntryMapToStream(xlZipEntryMap, xlOS);
if (tools.getParamAsBoolean(PropertyInfo.TYPE_TRUEFALSE, "DownloadFile")) {
  pega_rules_default.downloadFile(xlFile.toString(), tools, true);
}
}
catch (Exception e) {
oLog.error("Error in parsing Excel file " + xlFileName, e);
//throw new RuntimeException(e);
tools.getStepPage().addMessage(e.toString());
}
finally {
if (xlOS != null) try { xlOS.close(); } catch (Exception e) { }
if (tempIS != null) try { tempIS.close(); } catch (Exception e) { }
}

Still not getting data from WorkPage.

Please suggest.

Pega Customer Service Low-Code App Development
Moderation Team has archived post
Share this page LinkedIn