Displaying Row Number in DataGrid
Hi,
Is there an easy way to display a Row Number (in the very first column) in DataGrid or AdvancedDataGrid ?
I am trying to emulate Excel kind of functionality in DataGrid,
so need to Open/Load & Save to file.
I do understand that it is not difficult to do,
but do not want to Load & Save these Row Numbers to file.
Is there any easy standard solution for that ?
Any code samples ?
TIA,
Oleg.
Yes, I am getting column with all "0".
I took labelFunction from the link in one of the previous posts as-is:
// labelFunction for Row Number of the DataGrid
private function lfRowNum(oItem:Object, iCol:int):String {
var iIndex:int = gridData.getItemIndex(oItem) + 1;Alert.show(
"lfRowNum() i="+iCol+", rowNum="+String(iIndex)+", item='"+oItem.toString()+"'");
return String(iIndex);}
grid.dataProvider = null; // reset
var dgc:DataGridColumn;
var aColumnsNew:Array = new Array();
for (var i:int=0; i <= aColumnDef.length; i++) { //loop over the column definition array (& add 0-th column - row num)
dgc = new DataGridColumn(); //instantiate a new DataGridColumn
if (i > 0) {oColumnDef = aColumnDef[i-1];
dgc.dataField = oColumnDef.dataField;
else { // add 0-th column (row num)
dgc.dataField = "";
...dgc.labelFunction = lfRowNum;
aColumnsNew.push(dgc);
Sorry, I could not format that code ptoperly, would not let me remove spaces and blank lines.
Similar Messages
-
How to display row number in form?
Hi guys,
First I fll you in on the story so far..
I have a database data block named :V_PAYUPLOADHEADER_HP, in the property palette I set order by facility and warehouse.
I want to display row number for each fetched record, so I make :V_PAYUPLOADHEADER_HP.NUMB, which will contain the row number.
The following is some methods that I already tried:
- First I tried to make this field a database item=Y , column name = ROWNUM.
The result is the number jump around (3, 1, 2, 5, 4 etc. instead of 1, 2, 3, 4, 5) I think it is because of the order by that I set.
I have to keep this order by setting, so I look for another way to display the rownum.
- Next I tried to set database item = N, column name = null, calculation mode = formula, formula = :system.trigger_record.
When I run it all the value of :V_PAYUPLOADHEADER_HP.NUMB is 1. For all the records fetched is 1, 1, 1, 1 instead of 1, 2, 3, 4.
- I also tried using POST-QUERY trigger attached to the block.
In the trigger I have this code:
:V_PAYUPLOADHEADER_HP.NUMB := :system.cursor_record;
When I run it all the value of :V_PAYUPLOADHEADER_HP.NUMB is 1. For all the records fetched is 1, 1, 1, 1 instead of 1, 2, 3, 4..
Is there something that I missed?
What can I do to display the rownum?Hi
You can achieve this by adding new item named 'ROWNUM'. in the Data Block you are working on.
And it's 'BASE TABLE ITEM' property needs to be set as TRUE'. IN the property ,IN the post-query Trigger use...
SELECT ROWNUM
INTO :ROWNUM
FROM TABLE
WHERE EMP_ID =EMP_ID;Hope this helps...
Regards,
Abdetu... -
Display Row number in ALV List
Hi All,
I have 50 records in Internal table . I am displaying this internal table data in ALV List display. I want to print row number in ALV . Could you please help me how to print.
Thanks,
PRSN.HI,
take one more field in the internal table and fill it up with the number when you are filling it with data .
loop at itab.
it_final-seqno = sy-tabix.
append it_final.
endloop. -
Display Row Number with JTable
Hi everybody,
I try to build a spreadsheet with Java and Swing. I use Jdk1.2.2 and I looking for display the row Number on the left (Excel - like). I can't fiugre out how to implement this.
Anyone can give me some help?
Bye
MirkoHi Sciak!
This is what you are looking for ('Row Header' sample, including source code):
http://www2.gol.com/users/tame/swing/examples/JTableExamples1.html
Home page:
http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
CU,
Jan -
Display Row number - in Advanced Table
Hi All,
How to show the row number (like in SpreadSheet) for a Table?
The user can have search, and sort abilities on table data. I have tried getting ROWNUM in VO Query, but when we use sort or search then the ROWNUM is not coming in order. It showing initial row numbers, not new one.
How to achieve this?
Thanks in Advance.user10164183 wrote:
If we write query like that, when we search for some records, or doing sorting on columns row numbers are changing, but it shouldn't change. it must be constant and other columns data may be changed according to action done by user.What if you put your ROWNUM clause as deep into your query as possible?
SELECT *
FROM ( SELECT f.*
, ROWNUM rn
FROM per_all_people_f
WHERE <conditions>
ORDER BY <columns>If you need a an initial order you could do something like this:
SELECT *
FROM ( SELECT a.*
, ROWNUM rn
FROM ( SELECT f.*
FROM per_all_people_f
ORDER BY 1
WHERE <conditions>
ORDER BY <columns>Hope this helps! -
Displaying Row numbers starting from 1
Hi every one,
I want to display row number as see in the report while printing, as I am using the fallowing formula I am getting row numbers including suppress records which I donu2019t want, right now my row number is starting from 10. Instead of 1u2026
WhilePrintingRecords;
Numbervar x;
x:=x+1;
I want row numbers for only display recordsu2026
Please help me u2026
Thanks,
Krish.Krish,
I am assuming that you are using a conditional formula to suppress the details section. If that is the case then add the conditional suppression logic to your running total formula. For example;
WhilePrintingRecords;
Numbervar x;
If Not (condition for suppression) then x:=x+1 else x; -
Row number in Financial reporting
Is it possible in Financial reporting to display row number any how.
Best bet would be to be in a formula column that increases by 1 by row [a]+1 or something. Then move the headers to display after this row.
Think this would work.
Hope this helps
Andy King
http://www.analitica.co.uk -
How to display the number of row in a grid
Hi,
In a Form I have a grid (populated from a table). The first field is the Code ID_NUMBER, datatype varchar2(4), mask format 9999.
I need that when I click (or insert) on a new row in the datagrid, the field Code must be filled with a new value automatically. For example, if in the previous rows I have "0002", "0004", "0006", the new value in the new rows must be "0008".
How can perform this ?
Thanks in advance and Best Regards.
GaetanoThank You,
I have tried to insert in the DataBlock a trigger WHEN_CREATE_RECORD that call a procedure like this:
PROCEDURE NEW_ROW IS
max$Row NUMBER(4) := 0 ;
BEGIN
SELECT MAX(TO_NUMBER(NVL('M_REP_PARAMS.REP_PAR_ORDER','0'),'9999')) INTO max$Row FROM M_REP_PARAMS ORDER BY REP_PAR_ORDER ;
max$Row := max$Row + 2 ;
:M_REP_PARAMS.REP_PAR_ORDER := LPAD(TO_CHAR(max$Row, '9999'),4,'0') ;
END;
But when I click on the field in the row, no value is displayed.
I means the I mistake something.
Can You help me ?
Bye
Gaetano -
Number of currently displayed rows in report with pagination?
Maybe I'm thinking to complicated, but ...
In my report I use the HTMLDB_ITEM.CHECKBOX function in order to display a checkbox for each row:
HTMLDB_ITEM.CHECKBOX(1,"ID",NULL,:P311_ASSIGNED,':') " "
Some of the checkboxes are selected depending on whether there is an entry for them in a database table.
As the report returns hundreds of rows, I use pagination (e.g. 15 rows per page).
After checking/unchecking the checkboxes and submitting the page by clicking the save button, I want to do the following: For each row CURRENTLY DISPLAYED on the screen (1) check, whether its checkbox is currently checked or not (2a) If it is checked and there is not yet an entry -> add row to the db table (2b) If it is unchecked and there is an entry in the db table -> remove row from db table.
How can I, on the server side, find out which rows (row ids) are currently displayed (using pagination), so that I check each of the currently displayed row ids for their existence in the database table? Is there any item stored on the server side, which tells me the row number of the first row currently displayed? Is there an item I can refer to, which tells me the amount of rows, which are displayed on one page?
Your help would be very much appreciated!
KonradHi Konrad,
I will jump in. :-) Just have a few minutes before a meeting.
I think you don't have to make it that complicated, where you have to know the current pagination.
1) Your HTMLDB_ITEM.CHECKBOX has to contain as checked value #ROWNUM# as the row selector would do it.
2) You have to create a hidden item where you store your customer id
3) create another hidden item where you store if the customer has already the assignment
4) In your process you are now able to loop through your arrays.
DECLARE
vRowNumber BINARY_INTEGER;
vFound BOOLEAN;
BEGIN
-- insert new event assignments
FOR ii IN 1 .. WWV_Flow.g_f01.COUNT -- your checkbox
LOOP
vRowNumber := WWV_Flow.g_f01(ii);
-- no assignment yet?
IF WWV_Flow.g_f03(vRowNumber) IS NULL -- your hidden field where you store if you have an assmnt
THEN
INSERT INTO xxx VALUES (WWV_Flow.g_f02(vRowNumber)); -- your customer id
END IF;
END LOOP;
-- delete old event assignments
FOR ii IN 1 .. WWV_Flow.g_f03.COUNT -- your hidden field where you store if you have an assmnt
LOOP
-- only if the event was already assigned
IF WWV_Flow.g_f03(ii) IS NOT NULL
THEN
vFound := FALSE;
FOR jj IN 1 .. WWV_Flow.g_f01.COUNT -- your checkbox
LOOP
-- is the event still checked?
IF WWV_Flow.g_f01(jj) = ii
THEN
vFound := TRUE;
EXIT;
END IF;
END LOOP;
IF NOT vFound
THEN
DELETE xxx WHERE CUSTOMER_ID = WWV_Flow.g_f02(ii);
END IF;
END IF;
END LOOP;
END LOOP;Haven't tested the code, but I think it should show the idea.
Hope that helps
Patrick
Check out my APEX-blog: http://inside-apex.blogspot.com -
How to display the rows number of times by giving the column values?
Hi All,
I want to display the rows number of times as the value exists in num column in the below query
with t AS
( SELECT 'venkatesh' NAME, 'hyd' LOC, 2 NUM FROM DUAL
UNION ALL
SELECT 'prasad' NAME, 'hyd' LOC, 3 NUM FROM DUAL
UNION ALL
SELECT 'krishna' NAME, 'hyd' LOC, 1 NUM FROM DUAL )
SELECT T.* FROM T
CONNECT BY ROWNUM <= NUM
Expected output:
venkatesh hyd 2
venkatesh hyd 2
prasad hyd 3
prasad hyd 3
prasad hyd 3
krishna hyd 1Edited by: Nag Aswadhati on Nov 1, 2012 12:34 AMNag Aswadhati wrote:
Hi All,
I want to display the rows number of times as the value exists in num column in the below query
Expected output:
venkatesh hyd 2
venkatesh hyd 2
prasad hyd 3
prasad hyd 3
prasad hyd 3
krishna hyd 1Using Connect By:-
with t AS
( SELECT 'venkatesh' NAME, 'hyd' LOC, 2 NUM FROM DUAL
UNION ALL
SELECT 'prasad' NAME, 'hyd' LOC, 3 NUM FROM DUAL
UNION ALL
select 'krishna' name, 'hyd' loc, 1 num from dual )
select t.name, t.loc
from t
connect by level <= num
and name = prior name
and (prior sys_guid() is not null);
NAME LOC
krishna hyd
prasad hyd
prasad hyd
prasad hyd
venkatesh hyd
venkatesh hyd
6 rows selected -
How can I get the row number of display automatically on a table?
I have a table of measurements, and I would like the row number to be displayed on each row. The challenge is that each time I run the program, the total number of rows will be different, so I would like the numbers to update every time I run the program based on the current number of rows.
I have attached a picture to illustrate what I am trying to do.
Solved!
Go to Solution.
Attachments:
picture of table.JPG 70 KBFind the attached example (saved in version 2009), and you can extract what you need for your code...!!
I am not allergic to Kudos, in fact I love Kudos.
Make your LabVIEW experience more CONVENIENT.
Attachments:
Example (Enter Row Header).vi 12 KB -
I have used pagination to display the report data.I have used page break.I want to display 10 records on first page and from second page onwards I want to display 25 records on all remaining pages.
I followed this link to show 25 records for all page. "http://www.sqlchick.com/entries/2010/9/11/displaying-fixed-number-of-rows-per-ssrs-report-page.html". Now suggest me how display 10 records only on first page having 25 from second page onwards.Hi mukesh_harkhani,
According to your description, you want to insert page break for different number of rows, display 10 rows on the first page and 25 rows on the following pages. After testing the issue in my SQL Server Reporting Services 2008 environment, we can use the
method below to achieve your requirement:
In your scenario, right-click the group which contains the expression: =CEILING(RowNumber(Nothing)/25) to open the Group Properties dialog box.
Modify the original expression to the following in the Group on textbox:
=Floor((RowNumber(Nothing)+14)/25)
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
About the row number of the datagrid[Flex 2.0 beta3]
I want to add a column to the datagrid,which will indicates
the row number.Who can tell me how to do it?
And how to keep the number's sequence unchanged when the
header of one of other columns is cliked to sort the
data?If I understand this correctly. Then would it not make more
sense to say in
the LiveDocs --
makeObjectsBindable - After the remote call (RPC, HTTP, SOAP,
etc) returns
its value. Flex tries to automatically convert the result
into an
ArrayCollection (if it looks like an array, even if it was
XML) [Or
others???] format. This automatic conversion controlled by
the
makeObjectBindable property. If false, Flex does not attempt
the conversion
and the result will be in (xml?) format.
"peterent" <[email protected]> wrote in
message
news:eali1i$1q9$[email protected]..
> Results that come back which look like Arrays will be
turned into
> ArrayCollections automatically. Since most people
immediate turn an Array
> into
> an ArrayCollection, we went ahead and did it for you.
Try getting rid of
> your
> new ArrayCollection in the result handler.
> -
Display Line/Row number in Grid
Hi,
How to display the row number (1,2,3...) in a grid?
Should I go only by changing the query?
Or is there any SDK supported way of doing that?
Please help me with this information.
Thanks.
GeethaHi Geetha,
didn't have time to answer your earlier ...
you are looking for something like
SELECT (SELECT COUNT(*)
FROM OCRD T2
WHERE T2.CardCode <= T1.CardCode) as RowIndex, T1.*
FROM OCRD T1
ORDER BY RowIndex
this sample will display a row number of the complete ocrd table -
How to change the number displaying rows in a table
Hi all,
i have a table for resources in Debrief Work order (Standard Screen), we need to change the default displaying rows. inistially it displayed 3 empty rows.
i tried to change the Records Displayed for the table but it did not affect.
also it is possible to change the "Add 3 rows" button in the table to add for example 5 rows instead?
any idea?
Regards,
Mahdi ChararaHi,
Through personalization we can do.On standared page top right u will find personalization link.click on the clink next expand all there find apporiate table .Here u will fine reorder button set as u want display and save. then u can see the change.For add row functionality u need to extend the co.
Maybe you are looking for
-
In the keybourd of my mac 10.8.3 OSX, some battons are not working
n the keybourd of my mac 10.8.3 OSX, some battons are not working
-
i have a powermac g3 B+W and a friend is going to lend me his imac dvds to install it. will this work alright or should i just go buy it for myself? powermac is g3 350mhz 768mb ram 40.0gb and 12.7gb hdd Powerbook G3 Wallstreet + Powermac G3 B+W Mac
-
How to remove recipient from text message
I made a rookie mistake. I'm sending an important group text out. I inserted my number into the recipient box. So my texts appear TWICE! What is the quickest way to fix this with out having to start completely over. Im not talking about the iMessage
-
Verifying permissions freezes.
Booting from the install disk, running disk utility. Verify permissions and repair permissions never complete. Disk repair says, disk ok. What gives?
-
How to Change Layout for Detail iview.
Hi KM Gurus I need to know , where to change the Layout set for Detail Iview. Briefly saying.... 1. In KM under /documents ,i have a Folder by the name "MY_FOLDER" 2. On click of the "Detail" wedge - > we get by default the screen of layout similar t