NetTalk Central

Author Topic: Disabling Multiple Starts in Report Template on Webserver  (Read 6304 times)

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Disabling Multiple Starts in Report Template on Webserver
« on: August 14, 2008, 01:57:22 AM »
In my Clarion app, in the Actions Tab on the Pause Button control template using a Report, allow Multiple Starts is checked on.

When running from Webserver I switch an autoprint switch on when calling the DLL in my Clarion app, how do I prevent multiple restarts executing?

What happens now is that the procedure does not close down and the file is not send back to the webserver. It works fine when Multiple Starts is switched off.

Charl

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Disabling Multiple Starts in Report Template on Webserver
« Reply #1 on: August 14, 2008, 01:48:40 PM »
I'm not following why you would want to use multiple starts in a web app in the first place. Isn't multiple starts used to manage Windows app threads? In Webserver, it's session based. Maybe I'm missing something. Can you elaborate?
Mike Grigsby
Credify Systems
Central Oregon, USA

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Disabling Multiple Starts in Report Template on Webserver
« Reply #2 on: August 14, 2008, 11:47:54 PM »
Mike,

I have an application running over a normal network, full "normal" Clarion functionality on SQL Server.

In order not to duplicate the code, we call the DLL's in main app from the webserver app to print documents.  It works fine if you send the autoprint switch as a parameter to the DLL (of course you need to change the Report proc a little bit to bypass the Windows and buttons and default behaviour and we use PDF Tools).

Unfortunately, one of these ##%$#% reports have that stupid "Allow Multiple Starts" button ticked on, so somewhere in my normal app I need to put some code like this:

If autoprint
  Set that Multiple Start thing of
.

The thing is, never mind how many times I looked through the code I cannot figure out how to do it.

I tried to post Event:Accepted(?cancel) but that does not work either.

Hope this help somebody to help me.

Thanks

Charl



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Disabling Multiple Starts in Report Template on Webserver
« Reply #3 on: August 15, 2008, 11:42:43 PM »
Hi Charl,

In the embed point
"Prime Report Options when run in Web mode"
put
self.cancelled = 1

I will add this to the template for the next build.

Cheers
Bruce

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Disabling Multiple Starts in Report Template on Webserver
« Reply #4 on: August 16, 2008, 03:59:29 AM »
Hi Bruce,

Thanks, however, it's a bit more complicated than that, the Clarion app uses loads and loads of Global variables accross about 20 dll's from the days before we broke it into dll's.

Trying to link it into the web app gave serious error messages, etc.

So it was solved by calling a different app, WebIf for WebInterface, where we can set the required globals and then we call the approriate dll in the main app.  It probably don't sound to clever but it works fine :)

The point is, I have to set that thing in the Clarion app and self.cancelled does not work there.

??????

Thanks
Charl

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Disabling Multiple Starts in Report Template on Webserver
« Reply #5 on: August 17, 2008, 12:41:42 PM »
Hi Charl,

By Clarion app do you mean Clarion template app?

I haven't looked into the Legacy statement yet - but I'll have a squiz in the morning.

Cheers
Bruce

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Disabling Multiple Starts in Report Template on Webserver
« Reply #6 on: August 18, 2008, 04:51:52 AM »
Hi Bruce,

The Clarion Class ABC Report - Generic Reporting Procedure.  That's the one where you can put that pause button.

Regards
Charl

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Disabling Multiple Starts in Report Template on Webserver
« Reply #7 on: August 22, 2008, 03:07:23 AM »
OK, I've given up so I figured it out myself...

In Window Events, In the CloseWindow after Generated code, simply (now) bypass the Multiple stops thing.  Add the lines where there is comments  !*********.


    OF EVENT:CloseWindow
      ! Start of "Window Event Handling"
      ! [Priority 6300]

   if autoprint          !******   ADD THESE
   else                   !******   2 LINES

      IF ~SELF.Cancelled
      ! [Priority 7550]

        Progress:Thermometer = 0
        ?Progress:PctText{PROP:Text} = '0% Completed'
        SELF.DeferOpenReport = 1
        TARGET{PROP:Timer} = 0
        ?Pause{PROP:Text} = 'Print'
        SELF.Paused = 1
        SELF.Process.Close
        SELF.Response = RequestCancelled
      ! [Priority 7650]

        DISPLAY
        RETURN Level:Notify
      END
      ! [Priority 8900]

   end           !******* and end the if statement to bypass the code.

      ! End of "Window Event Handling"
    OF EVENT:DoResize



Cheers

Charl

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Disabling Multiple Starts in Report Template on Webserver
« Reply #8 on: August 25, 2008, 09:40:46 PM »
Hi Charl,

well done. This could be simplified to

if not p_web &= NULL
  self.cancelled = 1
end

right before the
    IF ~SELF.Cancelled
line

I'll tweak the template to support this.
Thanks
Bruce