NetTalk Central

Author Topic: PDF Tools for Reports  (Read 7135 times)

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
PDF Tools for Reports
« on: December 20, 2014, 04:39:59 PM »
Hi

I have just installed the demo version of PDF Tools (Tracker Software)  - looking to purchase. 

Install etc was ok and I generated a test report (Report1  ;D) with the Global Extension and the two local extensions per the NetTalk Book.  But ... I get a compile error viz:

'Unknown procedure label' and the line is -
Report1(self) ! Report procedure should have prototype of (<NetWebServerWorker p_web>)

Am using C9 and the prototype and Parameters seem to be correctly set.

What haven't I done?

Thanks

Keith

Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: PDF Tools for Reports
« Reply #1 on: December 20, 2014, 11:29:06 PM »
Hi\Have you checked Declare Globally on the report procedure?
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: PDF Tools for Reports
« Reply #2 on: December 21, 2014, 12:34:41 AM »
Terry

Thanks, that was the problem.

I ran it and got all excited at seeing my first report and indeed it was displayed (as a print preview) but I couldn't print it and discovered that the message was 'The Print procedure failed to create the PDF file []' and this was in a separate browser tab.

So, progress, but still something to find out.

Cheers

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: PDF Tools for Reports
« Reply #3 on: December 21, 2014, 04:28:06 AM »
Hi Keith
What I like to do is have a button on the webserver windows screen and get the report printing from there. Pretty easy then to use it in the website when everything works as expected.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: PDF Tools for Reports
« Reply #4 on: December 31, 2014, 01:09:18 PM »
The NT example for PDF Tools (Web14.app) gives the same error as my test report.

Looking at the code it seems that the variable loc:PDFname is not being set because the code that is generating the error message is:

  If Not p_Web &= NULL
    if not p_web.replyCompleted
      If Loc:NoRecords
          p_web.Script('alert('''&p_web.translate('No Records')&''');top.close();',net:send)
      ElsIf not exists(loc:PDFName)
        Loc:html = 'The Print procedure failed to create the PDF file ['&clip(loc:PdfName)&']'

The 'Elsif not exists' is satisfied and it generates the message with the PDFName display but it is blank.

I can't see in the documentation where anything has to be done to set the variable (loc:PDFname), the only comment being that the filename has to be set to !loc:PDFName - which it is in both programs.

I asked Tracker Software whether it was because I had just downloaded the demo version but they said 'no, demo adds a watermark to the report and the problem seems to be that loc:PDFName is not being set'

What am I missing?

Thanks

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: PDF Tools for Reports
« Reply #5 on: January 11, 2015, 09:26:13 PM »
Hi Keith
How did you get the web14 example to work with PDF tools? As far as I can see it is a duplicate of the Web13 example since it has no PDF tools global or local extensions?
I have  brought this up before (check for the thread in this forum)
Having said that example 14 compiles and all the reports run (using EE not pdf tools) so maybe you could reinstall your Nettalk version and try again if you are getting the error in web14?
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: PDF Tools for Reports
« Reply #6 on: January 12, 2015, 01:52:57 AM »
Hi Terry

Well, I just took Example 14 at face value and added the PDFTools extensions per the documentation in Bruce's 'Developing Web Applications' book.  I got exactly the same error as with my own application (described previously) and it appears that the PDFName is not being set up (see my previous post).

I presume that PDFName is set by NT to some throwaway value since there is no mention in the documentation about having to set it up.

Keith

Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: PDF Tools for Reports
« Reply #7 on: January 12, 2015, 04:20:33 AM »

Hi Keith
The loc:PDFName seems to be created automatically in this section and consists of the   web folder name and a random generated name in the reports folder. Is it possible that you don't have a reports folder?


If Not p_Web &= NULL
      SELF.SetReportTarget(PDFReporter.IReportGenerator)
    self.SkipPreview = True
    ProgressWindow{prop:hide} = 1
    loc:ProgressName = p_web.GetValue('_ProgressName_')
    p_web.SetProgress(loc:ProgressName,1,'') ! report has started
    loc:URL = '\reports\$$$' & format(random(1,99999),@n05) &'.pdf'
    loc:PDFName = clip(p_web.site.WebFolderPath) & loc:URL
    ! Start of "Prime Report Options when run in Web mode"
    ! [Priority 5000]
    p_web.trace('loc:ProgressName = ' & loc:ProgressName)
    ! End of "Prime Report Options when run in Web mode"
  End
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: PDF Tools for Reports
« Reply #8 on: January 12, 2015, 10:37:26 PM »
Terry

Ok, I see that and the path (in my case, testing locally) ought to be:

c:\PetMotel\web\reports\

and I do have a 'reports' folder'.

Where did you see the code you quoted that sets the field loc:PDFName?

Keith

Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: PDF Tools for Reports
« Reply #9 on: January 12, 2015, 11:20:22 PM »
Hi Keith
I found the code just before ThisWindow.Init PROCEDURE. in the MailboxesReport procedure in web14.
If you do a search in source for loc:url you should find it.
There is an embed point called "Prime report options when in web mode" where you can put some trace info, the p_web._trace line in my snippet is in that embed point.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: PDF Tools for Reports
« Reply #10 on: January 13, 2015, 12:30:48 AM »
Hi Terry

This is now solved.

After your last reply I was suspicious that I had added the Extensions correctly because I had already looked for the code to set loc:PDFName and could not find it in my source.

What I had done was to add to the Report the Extension:

NetTalk Extension to FRB report procedure with PDF-XChange Generator 41

instead of:

NetTalk Extension to report procedure with PDF-XChange Generator 41

(The documentation actually says 'Add the NetTalk, NetWebReportxc extension to the procedure')

Anyway, now that the other extension is loaded, the code is there and everything works perfectly.

Thanks again for your perseverance.

Cheers

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27