Is there any method to store the table file as session specific?
My requirement is as follows:
I have a report. This report has many calculations and many hold files. Finally the report is generated using a final hold file. It will take some time to generate the report.
The output has both EXCEL and PDF option. First the report will be generated in the HTML page and then the report can be generated in PDF or EXCEL with two links in the HTML page.
When the PDF/EXCEL link is clicked, again the same .fex file is called with all the selection criteria and the procedure is run from first line to the last. Again it will take the same amount of time to generate.
Is there anyway to take the data from the final hold file generated during the HTML output. This should be session specific since many users will be executing the report at the same time.
I do not know what platform you are running on, but here is some code that I got from a customer that us using UNIX. The create Temporary hold files in a directory and using the UNIX process ID as part of the hold name and pass that to a drill down focexec. This code could be midified to meet your needs. Once Pass the Process ID as the parameter to the focexec. Check to see if it exists if not run the complete focexec if it does exist then you could filedef the correct file using the process ID. Hope this helps
-*** Add check file Process ID Variable.
-IF &PID.EXISTS GOTO FILEDEFS;
FILEDEF PID DISK pid.dat
-* Call UNIX and get the processid and send it to the pid.dat file
!echo $$ > pid.dat
-* Read the PID.DAT file
-READ PID &PID
-* Call Unix and Create a directory for the temp Files
-* Call Unix and tell it to delete the files after 15 minutes
!echo "rm -fr /WebFOCUS/ibi/apps/work/work_&PID" | at now + 15 minutes
-* Put the Code that you want to run once here
-* Use APP commands to tell WebFOCUS Where to hold the temp files
APP HOLDMETA work/work_&PID
APP HOLDDATA work/work_&PID
-* Put the Code that you want to run every time here
Another option you can use is the APP MAP command to create a personal workspace for each user. This requires that you be able to identify individual users. Here is a brief summary of how it works:
In the EDASPROF, add the following lines:
APP MAP WFTEMP C:\IBI\USERSPACE\&&USERID
The individual user directories do need to exist ahead of time.
In each of your reports, you can now do an APP HOLD or APP FI to point to the WFTEMP application directory but each user will have their own area to temporary files and such.
If you're in Windows server and Self-serve, and your launch pages are method=get, the user can merely right click on the html table, and pick Export to Excel. That takes care of one of your output choices.
If you're in MRE, won't work.
Kyle's suggestion i agree with ; its a return to the way we did everything on mainframes. If you're in MRE, grabbing the userid is easy, to filedef your interim output. You could use a CMD STATE command to see if the dir exists and if not then CMD MKDIR to create it.
Have you considered making a special database, just for this report, one that performs all the number crunching overnight or in the wee-smalls, and then stores a resultant db, easier to hit live, and then do your pdf and excel choices as you originally wanted to.
|Powered by Social Strata|