This discussion is archived
6 Replies Latest reply: Nov 29, 2012 5:39 AM by tony.g RSS

Forms calling Reports output issue RTF/PDF - strange issue

tony.g Journeyer
Currently Being Moderated
Dear All,

I'm looking for a bit of help with a strange situation calling reports from Forms.

This problem I'm getting in both 11.1.1 and 11.1.2 of Forms/Reports. Client is WinXP/7 (issue appears on both), Weblogic server is Linux (SLES11 and Red Hat - issue on both)

So the issue is

1. calling a report with output as RTF (this works fine and we use OLE2 to open the report in Word)
2. Wihile in that form call the same report though change the output to be created as PDF in the cache and the report then opens in IE (this too works fine)
3. Now if we try and do number 1 again (still in the same form) and run the same report again and choose to generate as RTF and open in word, it erroneously generates the report in PDF format but with an .RTF extension on the file.

Of course most of the time people would not want to do this, but the client has identified this issue and classified it as a bug, so we need to fix it (and it doesn't happen in the Forms6i version it is migrated from).

I have tried to ensure that the parameter list is correctly deleted and re-created, which appears to be the case. I also tried to generate a new unique parameter list for every run, which made no difference to the problem.
If I choose to run a completely different report, the problem has reset itself. So the problem exists only when I've chosen the PDF output and then run the same report thereafter as RTF output to a file.


Code to prepare for the RTF option is:
Add_Parameter(pl_id,'destype',TEXT_PARAMETER,'FILE');
Add_Parameter(pl_id,'desname',TEXT_PARAMETER,l_temp_env||'/'|| p_report || '.rtf');
l_report_desname := l_temp_env||'/'|| p_report || '.rtf';
Add_Parameter(pl_id,'DESFORMAT',TEXT_PARAMETER,'RTF');
Add_Parameter(pl_id,'REPORT_DESFORMAT',TEXT_PARAMETER,'RTF');
Add_Parameter(pl_id,'mode',TEXT_PARAMETER,'BITMAP');
l_report := p_report;

Code used to prepare for PDF option is:
Add_Parameter(pl_id,'destype',TEXT_PARAMETER,'CACHE');
Add_Parameter(pl_id,'desname',TEXT_PARAMETER,'');
Add_Parameter(pl_id,'desformat',TEXT_PARAMETER,'PDF');
l_report := p_report;


Any ideas gratefully received.

cheers
Tony
  • 2. Re: Forms calling Reports output issue RTF/PDF - strange issue
    Mrucha Newbie
    Currently Being Moderated
    Hi Tony,

    Make sure to clear your parameter list every time.

    Use :- Destroy_parameter_list('Parameter list name')

    Also 2nd thing l_report_desname set properly in both the case.
  • 3. Re: Forms calling Reports output issue RTF/PDF - strange issue
    tony.g Journeyer
    Currently Being Moderated
    Hi (apologies again for posting this in both the forms and the reports forums, but the issue seems more forms orientated now)

    Thanks for your response.

    I have worked on this for a little time and have not resolved the problem.

    I think that the parameter list is not getting destroyed.

    I have this code:

    --------------------------------------------------------------------------------
    pl_id := Get_Parameter_List('MYREPORT');
    IF NOT Id_Null(pl_id)
    THEN

    Destroy_Parameter_List('MYREPORT');
    Destroy_Parameter_List(pl_id);
    lib_soft_message('I',FALSE, 'Deleting parameter list');
    IF NOT Id_Null(pl_id)
    THEN
    lib_soft_message('I',FALSE, 'It still exists');
    else
    lib_soft_message('I',FALSE, 'definately gone');
    end if;
    END IF;
    pl_id := Create_Parameter_List('MYREPORT');
    --------------------------------------------------------------------------------

    I see the following messages (the second time through):
    1. Deleteing parameter list
    2. It still exists

    So this seems to be the problem.

    regards
    Tony
  • 4. Re: Forms calling Reports output issue RTF/PDF - strange issue
    tony.g Journeyer
    Currently Being Moderated
    Hi

    Please ignore the last post, I was under the impression that the parameter list wasn't being destroyed, but on further checking it seems that it is.

    So the issue is that if I generate a PDF report from a form using run_report_object, then while keeping that same form open try to generate the same report to RTF format, it is incorrectly generated as a PDF but in a file with the .rtf suffix.

    If I go into the form and straightaway generate the RTF report, this generates in the selected format correctly. So it is only a problem if I generate a PDF format report first.

    I destroy the parameter list between reports, and if I exit from the form between report generation, then the problem is not seen.

    So it seems as if while you are in the same specific form session, if I generate to PDF, then for subsequent report runs the Reports Server doesn't change from this format, even though I send a desformat=RTF.

    This is on 11.1.2 Forms/Reports.

    rgds
    Tony
  • 5. Re: Forms calling Reports output issue RTF/PDF - strange issue
    Mrucha Newbie
    Currently Being Moderated
    Yes things is correct.
    PC_PARAM_LIST := Get_Parameter_List(PC_NAME_LIST);
    IF NOT Id_Null(PC_PARAM_LIST) THEN Destroy_Parameter_List(PC_PARAM_LIST); END IF;
    PC_PARAM_LIST := Create_Parameter_List(PC_NAME_LIST);

    Also 2) point
    l_report_desname := set properly in both the case.
  • 6. Re: Forms calling Reports output issue RTF/PDF - strange issue
    tony.g Journeyer
    Currently Being Moderated
    So I delete the paramlist correctly, then the code is:

    IF (p_display_method = 'W')
    THEN
    --WORD Format
         --delete file on client
         Delete_File('c:\temp'||'\'|| p_report || '.rtf');
         --delete file on app server
         host('rm '||l_temp_env||'/'|| p_report || '.rtf');
         --
         Add_Parameter(pl_id,'REPORT_DESTYPE',TEXT_PARAMETER,'FILE');
         Add_Parameter(pl_id,'DESTYPE',TEXT_PARAMETER,'FILE');
         Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER,l_temp_env||'/'|| p_report || '.rtf');
         l_report_desname := l_temp_env||'/'|| p_report || '.rtf';
         Add_Parameter(pl_id,'DESFORMAT',TEXT_PARAMETER,'RTF');
         Add_Parameter(pl_id,'REPORT_DESFORMAT',TEXT_PARAMETER,'RTF');     
         Add_Parameter(pl_id,'MODE',TEXT_PARAMETER,'BITMAP');
         Add_Parameter(pl_id,'printjob',TEXT_PARAMETER,'no');
         l_report := p_report;
    ELSIF (p_display_method = 'E')
    THEN
    --EXCEL format
         --delete file on client
         Delete_File('c:\temp'||'\'|| p_report || '.csv');
         Delete_File('c:\temp'||'\'|| p_report || '.xls');
         --delete file on app server
         host('rm '||l_temp_env||'/'|| p_report || '.csv');
         --
         Delete_File(l_temp_env||'\'|| p_report || '.cvs');
         Delete_File(l_temp_env||'\'|| p_report || '.xls');
         Add_Parameter(pl_id,'destype',TEXT_PARAMETER,'FILE');
         Add_Parameter(pl_id,'desname',TEXT_PARAMETER,l_temp_env||'/'|| p_report || '.csv');
         Add_Parameter(pl_id,'desformat',TEXT_PARAMETER,'csv.prt');
         Add_Parameter(pl_id,'REPORT_DESFORMAT',TEXT_PARAMETER,'csv.prt');
         Add_Parameter(pl_id,'MODE',TEXT_PARAMETER,'character');
         Add_Parameter(pl_id,'printjob',TEXT_PARAMETER,'no');
         l_report := p_report || '_d';
    ELSIF (p_display_method = 'P')
    THEN
    -- PDF Format
         Add_Parameter(pl_id,'destype',TEXT_PARAMETER,'CACHE');
         Add_Parameter(pl_id,'desname',TEXT_PARAMETER,l_temp_env||'/'|| p_report || '.pdf');
         Add_Parameter(pl_id,'DESFORMAT',TEXT_PARAMETER,'PDF');
         Add_Parameter(pl_id,'REPORT_DESFORMAT',TEXT_PARAMETER,'PDF');     
         l_report := p_report;
    END IF;


    So all of the above works fine when generating a report the first time you enter a form, but if you run a PDF output report then immediately in the same form generate the report again to a non-PDF format, it comes out in incorrectly in PDF format.


    rgds
    Tony

    Edited by: tony.g on Nov 29, 2012 1:37 PM

Legend

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