Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
9
Erster Beitrag:
vor 7 Jahren, 12 Monaten
Letzter Beitrag:
vor 9 Monaten, 3 Wochen
Beteiligte Autoren:
Jimbo, ICI, Randall, Mauricio, "Marcel Berman".pcs.crosspost

Simple? Row numbers in Browsing Table

Startbeitrag von Jimbo am 23.11.2009 07:06


Hi, has anybody found a simple method to have a sequential row number (always correct, even after row / record delete + add) in a Browsing Table with filtered records (let's say 2000+)? The hard way needs an extra cycle through all of the records, counting + setting the line number. Which is a bit time consuming.

Kind regards,
Guenter

Antworten:

I investigate also for that and I don't understand why many software can not produce this, even WinDev, "Default" like Excel or similar. It can be just "RowCounter"

But, all you can do for now is to make shorter time for writing row.

Before writing I remember actual row number and than with FOR

nRbr is int = Table.COL_RowNumber
FOR i=nRbr TO TableCount(Table)
.................TableSelectPlus(Table,i)
.................Table.COL_RowNumber = i
END

OR similar

von ICI - am 23.11.2009 07:41

Hi, I'm sorry, but exactly this it is what makes the problem. It simply takes too long to traverse the record set of ~2000, just to show the 10 or 15 correct row numbers in the Table. The user doesn't understand that a Browsing Table is only a small window showing a small part of the record set. Ok, I think, I'll have to give it up. I'll have to find another way ..

Thank you!
Guenter

von Jimbo - am 23.11.2009 07:59
Hi Jimbo,
I don't know what kind of database are you using. In the case of SQL you can use the row_number() function to get what you want.
Example:

SELECT ROW_NUMBER() OVER(ORDER BY IDArchivo DESC), NOMBRE FROM ARCHIVOS
WHERE NOMBRE LIKE 'M%'

I don't know if you can do something like that if you're using HF.
Regards,

Mauricio


von Mauricio - am 23.11.2009 09:34
Quote
Mauricio
Hi Jimbo,
I don't know what kind of database are you using. In the case of SQL you can use the row_number() function to get what you want.
Example:

SELECT ROW_NUMBER() OVER(ORDER BY IDArchivo DESC), NOMBRE FROM ARCHIVOS
WHERE NOMBRE LIKE 'M%'

I don't know if you can do something like that if you're using HF.
Regards,

Mauricio


Hi Mauricio, it's been HFSQL C/S with HFilter(..) applied but I decided some minutes ago to re-do the Table as a Memory Table and to feed it by TableAddLine(..) because some additional problems appeared. Thank you!
Kind regards, Guenter

von Jimbo - am 23.11.2009 10:10
Hi,

On 23-Nov-2009, Jimbo wrote:

> Hi, has anybody found a simple method to have a sequential row number
> (always correct, even after row / record delete + add) in a Browsing Table
> with filtered records (let's say 2000+)? The hard way needs an extra cycle
> through all of the records, counting + setting the line number. Which is a
> bit time consuming.
> Kind regards,
> Guenter

You should use a calculated column and use CurrentSubscript() in the code
"Display a line" to set the current line # in the calculated column.

Hope this help

--
Marcel Berman
Président de Be-Dev.be
l'association francophone belge des utilisateurs de
WinDev, WebDev et Windev Mobile
Message forwarded from pcsoft.us.windev

von "Marcel Berman".pcs.crosspost - am 23.11.2009 10:33

Hi Marcel,

thank you very much! This is it!
Simple & elegant ! No recalc !

Kind regards,
Guenter

von Jimbo - am 23.11.2009 10:39
It sounds like Marcel came up with a simple and elegant solution for numbering records in a browsing table with filtered records...

"You should use a calculated column and use CurrentSubscript() in the code
'Display a line' to set the current line # in the calculated column."

Could someone elaborate a little on it so I can understand it better?

von Randall - am 26.01.2017 19:14
Randall
Point is to have a column with name RowNo and always displayed
1->N even your delete,sort,modify rows.

You can create first table column "COL_Rbr", numeric and right click on table and choose code, then write this.


Then you will get this:


von ICI - am 29.01.2017 07:53
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.