NetTalk Central

Author Topic: Report with Parameters  (Read 4386 times)

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Report with Parameters
« on: April 19, 2011, 03:30:54 AM »
Hi,

For the life of me, I cannot seem to get this figured out.

What would be the prototype of the following parameters, if they are indeed correct?

(<NetWebServerWorker p_web>, <string l:dispose>, long l:clientno=0)

I tried (<NetWebServerWorker p_web>, <string>, long) and a few other combinations, but I cannot figure it out from the book or the examples.

The compiler just hangs when I get there.  Clarion 6.3 9054 NT 5.22, Report to PDF with the NetTalk extension.  When wil 5.23 come out?

Thanks
Charl


spot1701

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: Report with Parameters
« Reply #1 on: April 19, 2011, 05:46:05 AM »
I don't think you can amend the prototype, so to "pass" parameters, you either do it via the URL:

http://www.capesoft.com/docs/NetTalk5/NetTalkWebFAQ.htm#W26

or you set a SessionValue before you call the report, and Get it when you open the report.
Thanks

Bryan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Report with Parameters
« Reply #2 on: April 19, 2011, 05:56:43 AM »
Hi Charl,

For some years now the optimal is to set the Clarion Parameters, and Prototype exactly the same.
ie
parameters =
(<NetWebServerWorker p_web>, <string l:dispose>, long l:clientno=0)
prototype =
(<NetWebServerWorker p_web>, <string l:dispose>, long l:clientno=0)

You can add additional parameters to a report, as long as they are optional parameters, which will only be used in "windows" mode. In Web mode you add parameters using p_web.SetValue (see the Reports example for more.)

cheers
Bruce


charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Report with Parameters
« Reply #3 on: April 29, 2011, 05:51:34 AM »
My app seriously stops compiling with that convention and the Report to PDF with the NetTalk extension (I don't know why).

So here is the candy, if you want to use a report with parameters, here is how, if you use the PDF Reporting Tool (the setting to be set as per attachment), that is...

(Before First, obviously define the l: variables in the Data Section of the proc)

First define prototype, something like (long,long,string)

Then parameters, something like (autoprint,autoclientno,autoprintname)

In embed point ABC Objects, Window Manager, Init, just after Restore from ini file, something like:

  if autoPrint
    progresswindow{prop:hide} = true         !Obviously check your window name
    l:autoPrint = 1
    l:NotAutoPrint = 0
    l:pdftoolsname = clip(path())&'\PDF\'&format(autoPrintName,@s8)&'.pdf'
  else
    l:autoPrint = 0
    l:NotAutoPrint = 1
  .

  if autoclientno <> 0
    cli:clientno = autoclientno
  .

(yes it looks silly, but you cannot use 'not l:autoprint' as a condition as per attachment.)

So you can use your normal Windows app that normally pause so the user can select stuff and override it by the above method.  Something funny in this text field as I cannot see what I am typing...

Maybe Bruce knows a better method, and he can ellaborate, but this works fine for us.  I have one procedure called ServeDocument (which I call with a parameter if you can call it that, eg ServeDocument?Report=4) and from there I call all the normal Windows stuff llike this, not messy at all.,

If p_web.Getvalue('Report')=4
  PrintTheDamnThing(x,y,z)
.

(x,y,z being parameters passed as part of the ?method or as session values).  Sorry, I cannot say more now as I really cannot see what I am typing.  I think there is some fault when the message gets too long which was never a problem before.


Cheers
Charl




[attachment deleted by admin]