Dynamic Columns Report Layout

Hello, it´s me again :wink: :smile:

Here i go and make awkward questions.
I have a query (with oracle sql i am using pivot syntax) which will give me a ‘n’ number of columns depending of distinct values populated in a table.
Because i am transforming rows into columns i will have different number of columns (depending of the DB data).
While creating .lst (in designer mode) i will have a ‘data sample’ which may not match some others DB data, but in order to create a table i will define those columns into the table.
If i run that List/Table against other DB i will get an error cause those columns do not exist.

How can i avoid that? Is there a way to have ‘dynamic columns’ defined within the designer for a table?

Regards,

Carlos

P.S. - Hope you understand my question. Feel free to ask all you need.

Hi Carlos, hope you had a great Easter break :slight_smile:.

You can work with dynamic columns using the Exists and GetValue functions. A typical condition would be

If (Exists("DynamicVar"), GetValue("DynamicVar"))

Note however that you might need to switch the CheckUsedIdentifiers property to false for such reports to make sure that the dynamic variables are actually passed at runtime.

1 Like

Hello Jochen Bartlau,

Where do i use that condition? Is in ‘Appearance Condition’ of the table column?
Where is the CheckUsedIdentifiers property to switch off?

Thanks.

Carlos

You can use this condition in the Designer wherever you want to reference the field. The CheckUsedIdentifiers is a property of the ListLabel class:

        [DefaultValue(true), Description("Allows to disable the UsedIdentifiers check."), LlCategory(CategoryConfigurations), Browsable(false)]
        public bool CheckUsedIdentifiers { get; set; }
1 Like