PDF Tools report template

Hi,

Out of the blue, my PDF creation in my report procedure stopped working.
It looks as if the chunk of PDF code after the open(report) does not get generated.
See the code below.

Same solution , a different app, the report procedure working fine, and the PDF code is generated.

   OPEN(Report)
   ! Start of "After Opening Report"
   ! [Priority 2500]
   
   !*** PDF-Tools v4.1 Start (Legacy 3)
   ! Start of "PDFX-Tools Before Init"
   ! [Priority 5000]
   
   ! End of "PDFX-Tools Before Init"
   PDFXTR2.Init(Report, loc:pdf_filename,,PDFA_OFF) !  Added by PDF-Tools Templates v4.1
   PDFXTR2.SetPaper(CHOOSE(SYSTEM{PROP:Autopaper}=True,Report{PROPPRINT:Paper},PAPER:USER), CHOOSE(Report{PROP:Thous}=True,PROP:Thous,CHOOSE(Report{PROP:MM}=True,PROP:MM,CHOOSE(Report{PROP:Points}=True,PROP:Points,0))), Report{PROPPRINT:PaperWidth}, Report{PROPPRINT:PaperHeight}, Report{PROP:Landscape}) !  Added by PDF-Tools Templates v4.1
   PDFXTR2.SetCompression(TRUE,TRUE,FALSE,COMPRTYPE_C_AUTO,75,COMPRTYPE_I_AUTO,COMPRTYPE_M_AUTO) !  Added by PDF-Tools Templates v4.1
   PDFXTR2.SetAuthor('The Vineyard Connection') !  Added by PDF-Tools Templates v4.1

In the template this line seems to decide whether to include or not

#AT(%AfterOpeningReport),WHERE(~%PDFXT4ClarioNETEnabled AND (%PDFXT4ABCTemplate=%False AND (UPPER(%ProcedureTemplate)='REPORT') OR UPPER(%ProcedureTemplate)='RUNTIMEREPORT'))
!*** PDF-Tools v4.1 Start (Legacy 3)
#INSERT(%SetupReportValues)

Think this is the %PDFXT4ClarioNETEnabled switch, but not sure where to check

Currently working through it but my template language skills not that great :slight_smile:

thanks for any ideas of where to look

Johan

Template Code from line 2006 to 2024

  #DECLARE(%PDFXT4ABCTemplate)
  #SET(%PDFXT4ABCTemplate,%False)
  #EQUATE(%PDFXT4ABCTemplateLvl,0)
  #IF(VAREXISTS(%ABCVersion))
    #SET(%PDFXT4ABCTemplateLvl,1)
    #IF((0+%ABCVersion)>=6000)
      #SET(%PDFXT4ABCTemplateLvl,2)
      #IF(VAREXISTS(%AppTemplateFamily))
        #SET(%PDFXT4ABCTemplateLvl,3)
        #SET(%PDFXT4ABCTemplate,CHOOSE(%AppTemplateFamily='ABC',%True,%False))
      #ENDIF
    #ELSE
      #SET(%PDFXT4ABCTemplateLvl,4)
      #SET(%PDFXT4ABCTemplate,%True)
    #ENDIF
  #ELSE
    #SET(%PDFXT4ABCTemplateLvl,5)
  #ENDIF
  #EQUATE(%PDFXT4ABCTemplateStr,CHOOSE(~%PDFXT4ABCTemplate,'False','True'))

Hi Marius

Thank you for this, solves the one half of my problem.

Would like to figure out what caused it and why the different version numbers produced by different apps.
The solution I used for now was to move the procedure to the other app which does not have the problem.

thanks

Johan

The Template Version (%ABCVersion) is a little confusing and template vendors should not be relying on the version number set in the template variable from my little experiment results.

I did a test where I created an application in clarion 6, and then upgraded that application to clarion 11.1. As you can see in the screenshot the upgraded application, %ABCVersion still shows as 6300.

I’m not sure this happens in all applications that were originally created in C6 though as I have apps I know were created in C6 but they show the correct version.

You could edit ABChain.tpl and find this block of code

#BOXED,AT(0,0,0,0),WHERE(%False)
    #PROMPT('Template Family',@S10),%AppTemplateFamily,DEFAULT('ABC'),PROP(PROP:READONLY,1)
    #PROMPT('Template Version',@S10),%CWTemplateVersion,DEFAULT('v11.1'),PROP(PROP:READONLY,1)
    #PROMPT('ABC Version--',@S10),%ABCVersion,DEFAULT('11000'),PROP(PROP:READONLY,1)
#ENDBOXED

Comment out the #BOXED, #ENDBOXED and ,PROP(PROP:READONLY,1) and then when you got to application actions, clarion version tab, you could change from 6300 to 10000 or whatever is needed. NOTE I don’t think this is ideal, just a suggestion.

I hope that helps a little.
Mark

Hi Mark

Thanks for the detailed reply!

Yes, I have also seen mixed results with these version nrs when I exported some of my apps to TXA , after the webinar last night
Some apps have come a long way in clarion from very early versions and some more recent.
So your finding on when the app is created and in what version certainly makes sense to affect this numbering.

Seems my initial concern of the app being corrupted or stuck with a setting somewhere does not seem to be the case.
In the mean time I am moving my PDF reports to an app that does not have the issue and generates the code correctly according o existing templates.
When I have more time will give this a bit more investigation, and possibly apply the template changes o address this version nr/ABC template checking

thanks

Johan