how to save the "MSOGenerateExcelFile" generated file in the dynamic directory instead of "\ServiceExport"

I am using "MSOGenerateExcelFile" for Excel generation, if I don't pass the 'DownloadFile' param, it will generate the file at "\ServiceExport" directory, But my requirement is to save the file in specific directory dynamically(param), can any one help on this please!


Keep up to date on this post and subscribe to comments

August 18, 2019 - 12:26pm

You can try the following change:

Open MSOGenerateExcelFile

In Step 5 java code, you can finde below line:

String xlFileName = tools.getParamValue("FSFileName");
xlFileName = tools.findPage("pxProcess").getString("pxServiceExportPath") + xlFileName;
PRFile xlFile = new PRFile(xlFileName);

Here pxServiceExportPath is the property which is holding the service export path.

You can add a new param to the activity and replace pxServiceExportPath with the new property and it might work as expected.

August 23, 2019 - 2:27am
Response to vetsg

Hi Vetsg,
I tried your approach it's working, but it's placing the files only inside temp (server) folder only, I have a requirement to place the file in shared folder(outside temp directory) in the same system(running the Pega), could you please help on that.

Thanks in advance,
Harsha K