NetTalk Central

Author Topic: Run Report from Form before returning back to Browse  (Read 3519 times)

Alan Cochran

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Run Report from Form before returning back to Browse
« on: July 05, 2007, 08:07:48 PM »
Hi All,

I have a form that when I click the Save button, I want to run a report with the "_blank" target before returning back to the Browse procedure.   In the URL on Save, I have the browse that called the form with the "_self" target.

I have the following in the "Routines|ValidateAll|Start" embed but it doesn't work:

loc:formname = 'GenFinalBill_frm'
loc:formaction = 'RptFinalBill'
loc:formactiontarget= '_blank'
packet = clip(packet) & '<form input type="submit" name="'&clip(loc:formname)&'" action="'&clip(loc:formaction)&'" method="post" target="'&clip(loc:formactiontarget)&'" onsubmit="{{document.'&clip(loc:formname)&'.action='''&clip(loc:formaction)&''';}"><13,10>'
do SendPacket
packet = clip(packet) & '</form><13,10>'
do SendPacket

I probably have entered incorrect syntax but hopefully what I want to do can be done.

Any help is appreciated.

Thanks...
Alan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11181
    • View Profile
Re: Run Report from Form before returning back to Browse
« Reply #1 on: July 06, 2007, 03:23:19 AM »
Hi Alan,

Remember the mantra - the Browser _asks_ the server _gives_.
The server cannot determine (when asked) what to do.

Also, alas, the browser can't ask to do 2 things with one click. ie There's no URL that can "open window, and get report, and refresh this window at the same time".

I say no URL, because it is possible to do this sort of thing in JavaScript, but it is complicated, and not something I'd recommend for you at this time. Later on, maybe, this is something we can look at adding some JavaScript support for.

So in short, you'll need to change it a bit. One of the following would be my guess;

a) return to the browse as normal. Add a "Print" button to the browse. Let the user print the report for the new record (or indeed any record?) if they wish.

b) From the save go to a window that has a "print" button, and a "back to browse" button. The user clicks Print (or not) then clicks "Back to browse"

As I say, it is possible to do your original request using javascript - perhaps someone here can hep with that.

Cheers
Bruce