Page 1 of 1

Error during file download

Posted: Thu May 14, 2020 2:39 pm
by kulkabhijeet
Hello

We have set up the PUI Download in this way

Code: Select all

var checkInd = getObj("downloadexcel");
if (checkInd.value == 'true') {
  pui.download({ "id":  "FRAT060RG", "inline": "0" });
  pui.set("downloadexcel", false);
}
And the PUIDNLEXIT program is in PROFOUNDUI library.
The code added to that program is as below

Code: Select all

// Allow FRAT060RG program                                              
When %subst(inputData.fileId:1:9) = 'FRAT060RG';                        
                                                                        
  TmpDir = '/program work space/FRAT060RG';         
  stmfDir = %trim(TmpDir);                                              
  stmfName = 'Package_Setup_' +                                         
             %trim(inputData.userid) +                                  
             '_' + CharToday + '.xlsx';                                 
  attName  = stmfName;                                                  
  allow = 1;                                                            
The folder has the correct file generated
But When we try to download the excel, it gives us a error
"Error occurred calling PUIDNLEXIT program before download"

It blasts us out of the job completely, so we cannot even go and check the job log on hat is happening

Can you please help us in this ?

Re: Error during file download

Posted: Thu May 14, 2020 3:33 pm
by Scott Klement
Hello,

I don't understand what you mean by it "blasts" you out of the job?

In any case, it should've printed a job log to the spool that you can use to troubleshoot the error in your PUIDNLEXIT progam.

Re: Error during file download

Posted: Thu May 14, 2020 3:48 pm
by kulkabhijeet
I am attaching the screen shot of what the screen looks like. From here we cannot go back in any way. We have to relogin.
Also if we want to check the job log on the green screen, the job ends and there is not even a job log

Re: Error during file download

Posted: Thu May 14, 2020 3:57 pm
by Scott Klement
The reason this is taking over your Rich Display session is because you're running it in the same tab. This is controlled by the "inline" parameter. Try switching it to inline: true. This will cause it to run in a separate browser tab.

Code: Select all

pui.download({ "id":  "FRAT060RG", "inline": true });
The download does not run in the same IBM i job as the Rich Display, regardless of whether it is in the same browser window or not. So the job log of your RPG program that drives the display file isn't going to help.

Instead, look at the job log of the download job. It will be printed to the spool. (I said this in the last message, but maybe you missed it -- it is printed to the spool -- you won't find it in WRKACTJOB or similar.)