This discussion is archived
5 Replies Latest reply: Dec 17, 2012 8:52 AM by VC RSS

Generating PDF from DA and continue to execute

aracila Newbie
Currently Being Moderated
Hi All, need your help...
I have a DA with couple of steps:
somewhere in the middle i have to generate PDF report and after that refresh one of the regions on the page

well the problem is that after i generate the report using
window.location.href = 'f?p=&APP_ID.:0:&SESSION.:PRINT_REPORT=MyReport'; 
the refresh of the region is not working

same issue if i have to generate PDF and after that redirect to another page: the redirection is working but PDF is not generating.

Looks like i don't understaffed well how to manage window.location.href

Please help me wit any ideas
Thanks
Andrei
  • 1. Re: Generating PDF from DA and continue to execute
    VC Guru
    Currently Being Moderated
    aracila wrote:
    Hi All, need your help...
    I have a DA with couple of steps:
    somewhere in the middle i have to generate PDF report and after that refresh one of the regions on the page
    This is not how the dynamic actions work. See Understanding Dynamic Actions

    What you are trying to do is out of scope for dynamic action/JavaScript, because you are redirecting the page.
    well the problem is that after i generate the report using
    window.location.href = 'f?p=&APP_ID.:0:&SESSION.:PRINT_REPORT=MyReport'; 
    the refresh of the region is not working
    But why do you want to refresh the report after the PDF generation?
    >
    same issue if i have to generate PDF and after that redirect to another page: the redirection is working but PDF is not generating.

    Looks like i don't understaffed well how to manage window.location.href
    Yes, because window.location.href is nothing but a redirect and you can only do one redirected at any given time
  • 2. Re: Generating PDF from DA and continue to execute
    aracila Newbie
    Currently Being Moderated
    Hi, Thanks for answering.

    I have to make some changes in the database according to the user preferences, print a report of this changes and refresh the chart(or redirect to a new page).
    I do realize that i just can let the user to click a new tab, or put a button to generate a PDF, but ideally you need to follow the business flow and provide the possibility to operate with the app in as less as possible clicks.

    The process is:
    a) user confirm to move some staff from one warehouse to another
    b) he wants me to generate a PDF with details ( to print it for his records )
    c) he is requesting me to redirect him to a main page automatically (no need to stay in the move section anymore)

    I am just tiring to follow the user requirements :)

    Is there maybe another way to generate a PDF without using window.location.href? or any other solution to my problem?

    Thanks a lot in advance,
    Andrei
  • 3. Re: Generating PDF from DA and continue to execute
    VC Guru
    Currently Being Moderated
    aracila wrote:
    Hi, Thanks for answering.

    I have to make some changes in the database according to the user preferences, print a report of this changes and refresh the chart(or redirect to a new page).
    I do realize that i just can let the user to click a new tab, or put a button to generate a PDF, but ideally you need to follow the business flow and provide the possibility to operate with the app in as less as possible clicks.

    The process is:
    a) user confirm to move some staff from one warehouse to another
    Populate the required session information into apex_collections
    b) he wants me to generate a PDF with details ( to print it for his records )
    Skip the PDF generation here.
    c) he is requesting me to redirect him to a main page automatically (no need to stay in the move section anymore)
    Redirect to main page > in this main page define a dynamic action on Page Load

    *1.* which runs only when a record exists in apex_collections that was stored previously

    *2.* Add a true action as Execute PLSQL code
    Code: Delete the collection.

    *3.* Add a true action as Execute JavaScript code with
    window.location.href = 'f?p=&APP_ID.:0:&SESSION.:PRINT_REPORT=MyReport';
    So the idea is as soon as the user is redirected back to main page he will be prompted with the PDF file.

    Hope this will work :)
  • 4. Re: Generating PDF from DA and continue to execute
    aracila Newbie
    Currently Being Moderated
    Thank you, It is working some how. I did actually something like this.

    It is just not elegant and wrong :(
  • 5. Re: Generating PDF from DA and continue to execute
    VC Guru
    Currently Being Moderated
    aracila wrote:
    Thank you, It is working some how. I did actually something like this.

    It is just not elegant and wrong :(
    Why ?? what's the problem?

    Alternatively try this solution if this works for you! {thread:id=2179422}

    Thanks,
    Vikram

Legend

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