srkndnsn
25th September 2023, 18:14
Hi,
Has someone used predefined variables in Report Extensions? I want to use lattr.language$ in in Report Extension but I got error ;
'lattr.language$' not declared
But I can watch this variable in debug.
Best regards
Serkan
OmeLuuk
25th September 2023, 23:58
Well, as I always learned: do not depend on the debugger (objects) for the availability of (said) (pre)defined variables. Due to the fact that for debugging purposes otherwise declared "local" variables have to be "global" to be able to access them in debugging mode (read: the debugger is an external process against your report object, so variables need to be global to be able to show them in the debuger).
As you can see in the programmers manual the scope of the predefined variables are stated (and their "state" read only or read/write).
I have not done extensions on reports yet, but I assume the extensions (in tx) also run as separate bshell space compared to the report. Normally in the before program you would be able to exchange variables between processes. When you declare a string and assign the value lattr.language$ to it (by assignment or import) you might be able to access its original value... But as said, no experience with this area yet.
srkndnsn
26th September 2023, 09:07
Yes the variables should be defined as global,
I have found a workaround to find report language but it will be good when we can use this predefined variables in 2 sec, we should not need to find another logic
Best regards
Serkan
OmeLuuk
27th September 2023, 11:11
I think they are declared global in the context of the report environment (ttstprepdll)...
In that case you may try to add#pragma used dll "ottstprepdll"
srkndnsn
28th September 2023, 09:13
It is worth to try, I have asked to Infor Xtreme, here is the answer ;
Report extension is meant only forreading or calculating additional data to be printed in the reports.You cannot control the printing itself by manipulating the predefined variables for report scripts.
The lattr.* variables may not reflect the correct values. The moment ofreading the additional data andthe real printing is different. The variable lattr.language$ can be used to check the language in which the report is printed.
To have access to this variable, you can use this line in the Declaration hook: #include <bic_repgen>
Please refer to page no 61 in the 10.8 Extensions Guide.
I have tried it is also applicable for 10.7