Syntax error (not finding variables) only when printing

Hi

I am running into unexpected syntax errors while integrating some of our older reports (that are still in use by one of our other software products that use an older version of Combit - 14 if memory serves - that I believe predates data binding) with our newer software system that uses the .NET Combit API (presently version 27).

The context: In our older reporting environment, which I believe uses event-based data supply, the header variables appear in the designer directly under the Variables folder in the Variables/Fields sidebar. Thus all references to them in the report itself are just their names, e.g. for a variable named “Bin_ID”: Atrim$(Bin_ID).

In our new software’s reporting environment, using data binding, I am able to reproduce this by setting the data provider’s RootTableName to an empty string. This causes everything to still display correctly with no errors in the designer. The report also displays correctly in the designer’s Preview.

However, this does not work when trying to print the report. I get an LL_Expression_Exception stating that one of the expressions used has an error. Tracing the error using Debwin4 reveals that when printing, for some reason, it cannot find the variables now: ERR: error parsing formula 'Atrim$(Bin_ID)': Syntax error: cannot interpret term 'Bin_ID'.

The odd thing is that if I don’t blank out the RootTableName (causing the variables to now show under a folder with that name under Variables in the designer) and then modify the report to reference the variables with this parent name, e.g. Atrim$(Header.Bin_ID), the report now works in both the designer and when printing.

While this method does work (and is probably the more modern approach), it is undesirable for this particular project because it does not allow us to use the existing report files in both software environments (both will be running in parallel in production environments).

How would I go about further investigating how to get top-level variables working in both the designer and printing modes?

Hello Roux,

You might want to try handling the AutoDefineVariable event and manually registering the variables without a table name prefix. This can help make top-level variable references like Atrim$(Bin_ID) work correctly at runtime, not just in the designer.

Here’s the event in the documentation:
:link: AutoDefineVariable Event

Might be worth a try to keep the reports compatible across both environments.

Best regards
Martin LItkin

Hi

Unfortunately, this seems to have the same problem; while can see both with my own debugging and in the designer that the names are registered correctly by the AutoDefineVariable event, when printing, that event never fires. Is there additional configuration needed for the event to fire in printing mode, or alternatively at least a way to see why it isn’t firing?

Hey Roux,

There shouldn’t be any reason why this wouldn’t work unless you are simply forgetting to attach to the event.

If you’re unable to identify the cause, we’ll definitely need a log file and a sample to reproduce the issue.

In that case, please go ahead and open a support case via our Support Center.

Best regards
Martin LItkin