This discussion is archived
1 Reply Latest reply: Nov 5, 2012 3:51 AM by Nicolas.Gasparotto RSS

Problem with deleting PDF report in "Vew Log / Trace" Section

972464 Newbie
Currently Being Moderated
Hello everyone I just hired as a peoplesoft programmer :)
I have a question when I try to code a report generating program

I need to delete the PDF file (report) in "View Log/Trace"Section after the AE program executed.
(Actually I just want to hide it at "View Log/Trace" Section, so that user will not be able to see it).

The following program is my code


&xmlStr = &inXMLDoc.GenXmlString();
&strFilePath = %FilePath | "PAYSLIP_" | ZH_GPR068_AET.CAL_RUN_ID | "__" | ZH_GPR068_AET.PROCESS_INSTANCE | ".xml";
&FileCS = GetFile(%FilePath | "PAYSLIP_" | ZH_GPR068_AET.CAL_RUN_ID | "__" | ZH_GPR068_AET.PROCESS_INSTANCE | ".xml", "W", "UTF8", %FilePath_Absolute);
sRptDefn = "GPR0688_B";
&oRptDefn = create PSXP_RPTDEFNMANAGER:ReportDefn(&sRptDefn);
&oRptDefn.Get();
&oRptDefn.UseBurstValueAsOutputFileName = True;

&oRptDefn.SetRuntimeDataXMLFile(&strFilePath);
&ftp = GetURL(URL.ZH_GPR068_PAYSLIP);
&oRptDefn.ProcessReport("", &sLangCd, &AsOfDate, &sFileExt);
&oRptDefn.ZHPrintOutput(%FilePath);
&Return_Value = PutAttachment(GetURL(URL.ZH_GPR068_PAYSLIP), &sss | ".pdf", %FilePath | &sss | ".pdf");
&conFileLog.WriteLine("PutAttachment Return Value:" | &Return_Value);

If &Return_Value = 0 Then
Local Record &ZH_PSLP_EE;
&ZH_PSLP_EE = CreateRecord(Record.ZH_PSLP_EE_DATA);
&ZH_PSLP_EE.EMPLID.Value = ZH_GPR068_AET.EMPLID;
&ZH_PSLP_EE.CAL_RUN_ID.Value = ZH_GPR068_AET.CAL_RUN_ID;
&ZH_PSLP_EE.ATTACHSYSFILENAME.Value = &ATTACHSYSFILENAME;
&ZH_PSLP_EE.ATTACHUSERFILE.Value = &ATTACHUSERFILE;
&ZH_PSLP_EE.Insert();
End-If;

/*Delete(hide) the report file*/
Local JavaObject &javaFile;
&javaFile = CreateJavaObject("java.io.File", %FilePath);
&javaFile.delete();

&tmpfile1 = GetFile(%FilePath | &ATTACHSYSFILENAME, "W", "UTF8", %FilePath_Absolute);
&tmpfile1.Delete();*
/*Delete(hide) the report file*/


After the program executed, the pdf report still exist and not being removed in "View Log/Trace" Section
&ATTACHSYSFILENAME already contain the PDF extension.



I am hoping someone can help me to find out what's wrong with my program results in cannot delete the PDF file in the "Vew Log / Trace" Section
Thank you so much

Edited by: 969461 on Nov 5, 2012 1:41 AM
  • 1. Re: Problem with deleting PDF report in "Vew Log / Trace" Section
    Nicolas.Gasparotto Oracle ACE
    Currently Being Moderated
    Maybe there's something I don't get very well, but that's quite strange to make a user able to run a process without making him able to see the report, or at least the log.
    Anyway, I think it should be better to solve it through the config rather than changing code.
    Have a look to the red-paper below, page 57 :
    http://download.oracle.com/peopletools/documents/Securing_PSFT_App_Environment_May2010%20v4.pdf
    I may be wrong, but I'd tend to have a look first on the process definition, "Process Security", or on permission list (process monitor)...

    Nicolas.

    Edited by: N Gasparotto on Nov 5, 2012 12:51 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points