PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Re: Swapping columns in windev 22 reports
Re: Swapping columns in windev 22 reports
Iniciado por guest, 02,abr. 2018 14:59 - 5 respuestas
Publicado el 02,abril 2018 - 14:59
Hello,

Using Windev 22, Postgresql 10

I created a report from a table. Everything is OK.

In this report I need to swap two columns based on a global setting. Swapping columns in table is easier, by providing 'column move' option while designing, that client could move those columns.

Now I want the same effect in the report also.

Say Table contains,

Col1, Col2, Col3, Col4

Of these Col3 and Col4 could be either Col3, Col4 or Col4, Col3. [Columns swapped]

Now I want the same thing in the report. How to do it ? Any script to inter-change those columns or change the value of X of a col3 or col4 at runtime ?

Tried with some values, that the column disappears.... seems I'm doing something wrong.

Any ways to do it ?

Happiness Always
BKR Sivaprakash
Publicado el 02,abril 2018 - 15:32
Hi,

maybe the easiest way is using a trick. Add (in your example) a 5th column as a copy of the 3rd one. And in your code hide either col3 or col5.
Col1,col2,col3,col4,col5 at designtime
results in
Col1,col2,col3,col4 after setting col5..visible=true
or
Col1,col2,col4,col5 after setting col3..visible=true
Publicado el 02,abril 2018 - 19:56
Hi BKR,

In the table, do not swap columns, swap the DATA in the columns ...

Regards
Steven Sitas

www.alpha360.biz
Publicado el 03,abril 2018 - 07:37
Thanks Arie,

Let me try that option.

Stevan Sitas,

Swapping columns in Table not that big issue. As you say, either way (swapping columns or swapping data) will do the trick.

Showing the same in the report is the issue here.

Happiness Always
BKR Sivaprakash
Publicado el 03,abril 2018 - 09:16
Hi BKR,

I am not talking about swapping the columns but swapping the DATA.
So in the beginning, you have your original data in Col_1 and Col_2 - printing it will show the same.
After that swap the data, between Col_1 and Col_2 - you now actually have the ORIGINAL data, in the following series: Col_2 and Col_1 and print it ...
The only thing you may need to do is change the headers on your tables (on the window and on the report).


Regards
Steven Sitas
Publicado el 03,abril 2018 - 12:51
Stevan Sitas,

So a column in report could be linked with the position of the column in table ? I used to link with the COL_name only. Let me try.

Happiness Always
BKR Sivaprakash

Update: I got the idea. Let me try and get back to you Stevan Sitas.