NetTalk Central

Author Topic: Go to new page when when report run  (Read 2612 times)

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Go to new page when when report run
« on: August 17, 2012, 06:19:20 AM »
I have a memory form which collects date range for a report and is set so the actions of the form run the Report procedure in a new tab (when the user clicks "Save" which is renamed as "Go").

This all works fine but I would like the memory form to close and for the HomePage to open when the user clicks Go (as well as opening the report in a new tab). I have tried embedding   p_web.Script(p_web.WindowOpen('HomePage')) but cannot find a place where it will not stop the report being run - effectively I need the report to run and then open the Homepage.

Any suggestions?

MikeR

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
    • Email
Re: Go to new page when when report run
« Reply #1 on: August 18, 2012, 10:08:24 AM »
Just call a standard report procedure (without the nettalk extension) on the server side code when the user presses the save button.

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Re: Go to new page when when report run
« Reply #2 on: August 18, 2012, 01:52:40 PM »
But if I call the report without the Nettalk extension, surely it wont open in the browser?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Go to new page when when report run
« Reply #3 on: August 19, 2012, 10:03:36 PM »
>> This all works fine but I would like the memory form to close and for the HomePage to open when the user clicks Go (as well as opening the report in a new tab).

you can't do 2 things at once, without some understanding of the JavaScript language.

Cheers
Bruce

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Re: Go to new page when when report run
« Reply #4 on: August 19, 2012, 10:15:23 PM »
Thanks Bruce, I understand that the Javascript that is used to call the report needs to open the Homepage. Can you or anyone help me as to what to embed and where that would achieve this?

Many thanks.

MikeR

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
    • Email
Re: Go to new page when when report run
« Reply #5 on: August 20, 2012, 02:52:05 AM »
I don't know if this will work for you, but the following javascript will display a pdf on your main page or any page
so you can save the report as a pdf and then display it with this code.
This code works with a hardcoded pdf name,
maybe someone can improve so we can use a variable.

<script language="javascript">
  if ((navigator.appName).match(/Explorer/i) != null)   {
    document.write('<OBJECT CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" WIDTH="100%" HEIGHT="500">');
    document.write('<PARAM NAME="SRC" VALUE="test.pdf"/>');
    document.write('</OBJECT>');
  } else {
    document.write('<EMBED src="test.pdf" width="100%" height="500" type="application/pdf">');
    document.write('</EMBED>');
  }
</script>