attributes of specific rows/columns of a subfile

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
hburgue
Posts: 4
Joined: 12 Feb 2025, 03:54

attributes of specific rows/columns of a subfile

Post by hburgue »

I would like to know if in Axes it is possible the change the display attributes of specific rows/columns of a subfile, not all of them, just some based on a defined criteria.

In case is possible, could you please provide a simple example?

Thank you
hburgue
Posts: 4
Joined: 12 Feb 2025, 03:54

Re: attributes of specific rows/columns of a subfile

Post by hburgue »

I was able to resolve this situation, but if anyone finds a better solution and wants to share it, I would appreciate it.

I assigned names to the columns of each row (of the first page of the subfile).
I set the STYLE parameter of the subfile Enhancer to dynamic mode.

***************************
Example:

Dynamic mode script
***************************

const FGB = ["",FIELDS("GB1"), FIELDS("GB2"), FIELDS("GB3"), FIELDS("GB4"), FIELDS("GB5"), FIELDS("GB6"), FIELDS("GB7"), FIELDS("GB8"), FIELDS("GB9")];
const FDE = ["",FIELDS("Des1"), FIELDS("Des2"), FIELDS("Des3"), FIELDS("Des4"), FIELDS("Des5"), FIELDS("Des6"), FIELDS("Des7"), FIELDS("Des8"), FIELDS("Des9")];

var i = 0;
var oStyle = new Object();
oStyle["color"] = "white";
oStyle["background-color"] = "red";


for (let i=1;i<=10; i++)
{
var valor = FGB.getValue();
var filtro = valor.substr(0,4);

// Example of Condition

if (filtro == "*" || filtro == " ÑC" || filtro == " MB")
{
FGB.setProperty("axdv.style",oStyle);
FGB.refresh();
FDE.setProperty("axdv.style",oStyle);
FDE.refresh();

}
}
hburgue
Posts: 4
Joined: 12 Feb 2025, 03:54

Re: attributes of specific rows/columns of a subfile

Post by hburgue »

My apologies, I copied the script wrong.

***************************
Example:

Dynamic mode script
***************************

const FGB = ["",FIELDS("GB1"), FIELDS("GB2"), FIELDS("GB3"), FIELDS("GB4"), FIELDS("GB5"), FIELDS("GB6"), FIELDS("GB7"), FIELDS("GB8"), FIELDS("GB9")];
const FDE = ["",FIELDS("Des1"), FIELDS("Des2"), FIELDS("Des3"), FIELDS("Des4"), FIELDS("Des5"), FIELDS("Des6"), FIELDS("Des7"), FIELDS("Des8"), FIELDS("Des9")];

var i = 0;
var oStyle = new Object();
oStyle["color"] = "white";
oStyle["background-color"] = "red";


for (let i=1;i<=10; i++)
{
var valor = FGB.getValue();
var filtro = valor.substr(0,4);

// Example of Condition

if (filtro == " AB" || filtro == " MB")
{
FGB.setProperty("axdv.style",oStyle);
FGB.refresh();
FDE.setProperty("axdv.style",oStyle);
FDE.refresh();

}
}
hburgue
Posts: 4
Joined: 12 Feb 2025, 03:54

Re: attributes of specific rows/columns of a subfile

Post by hburgue »

On Instruction with FGB and FDE missing index i .
Post Reply