NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Keith 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
-
Hi\Have you checked Declare Globally on the report procedure?
-
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
-
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.
-
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
-
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?
-
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
-
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
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
-
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.
-
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