Counting rows in a report
Hi,
I have a report page based on a SQL query. I then have a button on that page and when the user clicks it, I want to be able to loop through each of the records in the report to do some processing. I was thinking of using a for loop but not sure how I determine the end number ie: for ii in 1 .. (Number of Rows in Report)? Any ideas?
Thanks,
Ben.
Hi
Check this out. It is part of the apex javascript library:
* Check or uncheck (pCheck) all check boxs contained within a DOM node (pThis). If an array of checkboxs DOM nodes (pArray) is provided, use that array for affected check boxs.
* @function
* @param {DOM node | string ID} pThis
* @param {true | false} pCheck
* @param {DOM node Array} pArray
function $f_CheckAll(pThis,pCheck,pArray){
var l_Inputs;
if(pArray){l_Inputs = pArray;}
else{l_Inputs = $x_FormItems(pThis,'CHECKBOX');}
for (var i=0,l=l_Inputs.length;i<l;i++){l_Inputs.checked = pCheck;}
return;
Edit - just spotted that are are tons of similar queries on this, just search for CheckAll in the forum.
Let me know if you need further help.
Cheers
Ben
Edited by: Munky on Apr 27, 2009 9:57 AM
Similar Messages
-
Adding new row to the reports list page
How can I add a new report row in the reports list of the reports tab.
Ex: a new row to the report "users by Date of Join report" is to be added
How can we add Please help me out in thisI am facing the same problem!
camickr wrote:
Try adding an empty row containing a null value for the String instead of the empty String.camickr, it will not help, the DefaultRowSorter in the "*+compare(int model1, int model2)+*" method return -1 if the first value is null and 1 if the sacond value is null. and incase of DESCENDING it mult by -1.
// Treat nulls as < then non-null
if (v1 == null) {
if (v2 == null) {
result = 0;
} else {
result = -1;
} else if (v2 == null) {
result = 1;
} else {
result = sortComparators[counter].compare(v1, v2);
if (sortOrder == SortOrder.DESCENDING) {
result *= -1;
}And this is the real problem!
The empty line is sorted as the smallest value and incase of DESCENDING it will be the first line (because of the mult by -1).
We could have overide it and incase of the empty row(usualy the last row) do not mult by -1 in DESCENDING mode.
But the problem is that the "+*compare*+" method and it's caller "*+Row+*" inner class are private :-(
It is not wise to do it but we can do like kmp83 wrote:
kmp83 wrote:
copy/duplicate "private" code from DefaultRowSorter into my extended class.Anyone have another suggestion? -
Display the total number of rows for the report in OBIEE 11g
Hi, In obiee 11g, the pagination will be 1-25. Is there any possiblity in obiee to show the total rows count next to pagination. Ex: if the result contains 120 rows. it should display after the pagination
Records 1-25. Total of Records : 120
Is there any way we can display the total number of rows for the report.
Kindly help me.. Its very urgent requirement.
MAny Thank in advacneCheck this http://obiee100.blogspot.com/2011/07/display-total-number-of-records-in.html
and
http://docs.oracle.com/cd/E28280_01/bi.1111/e10544/appsql.htm#CHDCDIDA
You have to go something like as suggested in previous link.
Mark as correct/helpful -
Which is the pratical limit on how many rows compose a report ?
Hi guys,
I've a report which could contain a very big number of rows (probably 500k).
When I work with "normal" number (10 - 20000) it works correctly (of course it's not very fast in the last case :-) but when the number of rows goes more up (200k/500k) the report never compair!
Which components are "stressed" during this operation?
Can I tune something?
So, I know that there's not a limit theorically but which is the pratical limit (if there's it)?
King regards
MauroMauro,
All the rows of a report will be fetched, up to the maximum number you specify.
In my opinion, there is no logical reason to provide pagination controls for 200K rows, or even 10K rows. The typical end user is never going to want to flip through that many results - they'll refine their query.
I say - use common sense and give an upper bound as low as possible. You should not use the pagination controls to determine the total row count - that is extraordinarily inefficient.
Joel -
Deleting multiple rows in a report ?
db11gxe , apex 4.0 , firefox 24 ,
how to delete multiple rows in a report at one time ?
thanksHi newbi_egy,
Here is a small demo with few steps that can be used in your scenario-
1) Below is the query of a report on emp table which has empno column with unique values-
SELECT APEX_ITEM.CHECKBOX(1,empno) " ", ename, job FROM emp ORDER by 1
2) A Delete button is created that submits the page.
3) An on-submit process is created with Process point On Submit - After Computation and Validations with condition that the below process runs when Delete button clicked.
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count
LOOP
delete from emp where empno=APEX_APPLICATION.G_F01(i);
END LOOP;
END;
I hope this might help you.
Regards,
Das123 -
Want to update multiple rows of the report but getting a bug.
hi,
I am trying to update multiple rows of a report.For that I have created a teport with dynamic checkbox generated using ---HTMLDB_ITEM.CHECKBOX(1,utt.trouble_ticket_id) " "----.Checkboxes are rendered perfectly on the report.
but when I tried to update the selected rows of the report as given in the documentation
begin
:P16_priority:=htmldb_application.G_F01.count;
for i in 1..htmldb_application.G_F01.count
loop
update umanage_trouble_ticket set severity =:P16_priority where
trouble_ticket_id = htmldb_application.G_F01(i);
end loop;
end;
I found that all the rows are updated.not only selected rows.
and the count it gives =no of rows returned + no of rows selected.
Please help me regarding this.
thanx.
BHARATHi Bernhard,
I think that u didnt get y problem.
When I take the value from "htmldb_application.g_f01(i)" then it should return id's of rows that are checked but when I do that it returns id's of all the rows.So I am not able to update only checked rows.
from id's of rows i mean value provided when generating checkboxes through query.
htmldb_item.checkbox(1,trouble_ticket_id) " "
I am approching to the solution as specified in the documentation. "Adding check boxes to each row in a report".
but still cant find any solution.
thanx that u showed some intrest in my problem.
If u can get the solution reply soon.
Regards
BHARAT -
Hi experts...
I want single row in alv report.
I have use loop for fatch data into internal table using loop when i am passing data in alv report then the data comes according loop. i want onlu one data in alv row.
how can i do such, plz help me.decleare two internal table.
read table itab into wa index 1.
append wa to itab2.
pass itab2 only one record display. -
I have a status of completed and a date field in the dataset. The date field is either empty or contains a date. All 2015 dates are holding dates.
So how can I limit the report to only pull completed status with an empty date or a holding date?
I have not been able to set an OR option on a date field filter and if I add two filters on the date column one for empty one for > 12/31/2014 then it treats it as an "and" and pulls nothing from the list I have in sharepoint.
any help will be appreciated.Hi MB,
In Reporting Services, the relationship of filters is “And”, and there is no option to change the relationship from “And” to “Or”. While we can use “or” operator within the expression to create one filter to integrated all filters to work around this
issue.
We can add a filter as follows in the dataset to limit the rows in your report:
Expression: =Fields!date.Value is nothing or Fields!date.Value>"12/31/2014" Type: Boolean
Operator: =
Value: true
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
Deleting rows in alv report.
Hi Experts,
I want to delete a row in alv report output, It is duplicating records in the report and 'GRAND TOTAL' also be displayed . In under the report . <<removed_by_moderator>>
Thanks,
Dinesh.B
Edited by: Vijay Babu Dudla on May 11, 2009 9:15 AMHi,
use the following code for deleting duplicate and adjacent records from itab
delete ADJACENT DUPLICATES FROM itab.
or
sort itab by pernr.
delete ADJACENT DUPLICATE FROM itab COMPARING pernr.
Also, for grand total you can use fieldcat-do_sum = 'X' with the field catalog. It will give you total for the required column.
Hope this solves your problem.
Regards,
Ibrar Munsif. -
Deleting a single row in a report using checkbox
Hi,
Can anyone please help me on how to perform a deletion of a single row/multiple rows in a report when one clicks on a checkbox ..
I went throught the HOWTO's guide .. But when i select a checkbox and say delete i get the following error:
ORA-20001: Error in multi row delete operation: row= 12, ORA-01403: no data found,
Waiting for your replies soon
Thanks in advance
Rakeshjabalsad wrote:
Hi,
I am fairly new to JSF so please bear with me if the answer is obvious :D. I'm using a dataTable component to display data from a database and would like to add a commandLink component to every row in the table that deletes that row from the database. What is the most effective way of doing this?
I'm thinking of using a ListDataModel with some function that removes the correct row (though I'm not sure how it will tie in with a commandLink and exactly where the database will be updated). I'll appreciate any pointers or perhaps even an online example of something similar.
Alternatively I suppose you could pass an "id" parameter on with the commandLink that somehow gets read in the request and the appropriate row is removed accordingly. This solution seems cumbersome however.Yes, your instincts are correct there. Binding the data model to a backing bean to get the UIData instance for the table. Then use UIData.getRowData() to get the object corresponding to the row containing the link/button. Then execute your business logic to delete the row from the database. Then you need to ensure the data model is updated to reflect the new state of the database. -
Bold a single row in a Report based on SQL Query
Should be easy? So, how do I bold a single row in a report based on SQL query without creating a new template or writing Java for the page? What is the Tabular Form Element "Element Attributes" field for? Or what am I supposed to put in there to make it do anything?
One way to do this is to add a hidden column to your report which contains the formatting value, for example:
select empno
, ename
, sal
, decode(empno,1,'font-weight:bold','font-weight:normal') style
from emp
Hide the STYLE column.
Then you can use this column for each column in Column Formatting > HTML expression in this way:
<span style="#STYLE#">#SAL#</span>
Unfortunately you have to do this for each colum you want to appear bold.
good luck,
Dirk Dral -
Coloring of a (specific) row in ALV report-How?
Hi Experts,
Am looking to assign a color for a (specific)row in ALV report.......so, pls. let me know How to get it done?
thanqTABLES:LFA1.
SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR.
DATA:BEGIN OF ITAB OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
LAND1 LIKE LFA1-LAND1,
ORT01 LIKE LFA1-ORT01,
REGIO LIKE LFA1-REGIO,
SORTL LIKE LFA1-SORTL,
CFIELD(4) TYPE C,
END OF ITAB.
data:col(4).
data:num value '1'.
SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE LIFNR
IN LIFNR.
LOOP AT ITAB.
concatenate 'C' num '10' into col .
ITAB-CFIELD = col.
num = num + 1.
if num = '8'.
num = '1'.
endif.
MODIFY ITAB.
ENDLOOP.
TYPE-POOLS:SLIS.
DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
DATA:EVE TYPE SLIS_T_EVENT WITH HEADER LINE.
LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
LAYOUT-WINDOW_TITLEBAR = 'VENDORS DETAILS SCREEN'.
LAYOUT-EDIT = 'X'.
LAYOUT-info_fieldname = 'CFIELD'.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'ITAB'
I_INCLNAME = SY-REPID
CHANGING
CT_FIELDCAT = FCAT.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FCAT
TABLES
T_OUTTAB = ITAB.
this is for coloring cols
REPORT ZBHCOLOR_COLS.
TABLES:LFA1.
SELECT-OPTIONS:C_LIFNR FOR LFA1-LIFNR. " FOR GRID ONLY
PARAMETERS:LIST RADIOBUTTON GROUP ALV DEFAULT 'X',
GRID RADIOBUTTON GROUP ALV.
DATA:BEGIN OF ITAB OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
LAND1 LIKE LFA1-LAND1,
ORT01 LIKE LFA1-ORT01,
SORTL LIKE LFA1-SORTL,
REGIO LIKE LFA1-REGIO,
COL TYPE LVC_T_SCOL,
END OF ITAB.
DATA:COLR TYPE LVC_S_SCOL.
SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB.
LOOP AT ITAB.
IF ITAB-LIFNR IN C_LIFNR.
COLR-FNAME = 'NAME1'.
COLR-COLOR-COL = '5'.
COLR-COLOR-INT = '1'.
COLR-COLOR-INV = '0'.
COLR-NOKEYCOL = 'X'.
APPEND COLR TO ITAB-COL.
COLR-FNAME = 'LIFNR'.
APPEND COLR TO ITAB-COL.
MODIFY ITAB.
ENDIF.
ENDLOOP.
TYPE-POOLS:SLIS.
DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
LAYOUT-ZEBRA = 'X'.
layout-coltab_fieldname = 'COL'.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'ITAB'
I_INCLNAME = SY-REPID
CHANGING
CT_FIELDCAT = FCAT.
IF LIST = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FCAT
TABLES
T_OUTTAB = ITAB.
ELSEIF GRID = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FCAT
TABLES
T_OUTTAB = ITAB.
ENDIF.
Reward points if useful. -
How to select multiple row in ALV report
Hi friends,
1. How to select multiple row in ALV report
( How to set tab in ALV report and want to select multiple line.)
Thanking you.
SubashHi Sahoo,
If you are using the class CL_GUI_ALV_GRID. In methods SET_TABLE_FOR_FIRST_DISPLAY.
in layout structure you will find field SEL_MODE
pass :
LS_LAYOUT-SEL_MODE = 'A'.
In PAI.
CALL METHOD GRID->GET_SELECTED_ROWS
IMPORTING
ET_INDEX_ROWS = T_ROWS
ET_ROW_NO = T_ROWID.
Hope these will solve your problem.
Regards,
Kumar M. -
Prompting user for input for each row in the report
Is it possible to have a user entered field for each row in a report ?
ie. have a report with empolyee number, employee name, title, salary, and comment. Select of of these columns from the SQL query except for the comment, and then when the report is generated have the user be prompted for what the want the comment to be for every employee in the report?That is, have the user generating the report enter in a different comment for EACH employee. (ie Joe Smith's comment is "good worker and John Smith's comment is "come to work late on Tuesdays and Thursdays", Sally Jones' comment is "Expert in C++" etc.) as the reports is being built for each row returned from the query.
-
Previous record values displaying in the Group Footer row in the report.
Hi Friends,
I have 3 tables
TableA:(PERNR BEGDA ENDDA are key fields)
PERNR BEGDA ENDDA WERKS
10001 1/1/2010 12/31/9999 1001
TableB:(PERNR BEGDA ENDDA SUBTY are key fields)
PERNR BEGDA ENDDA SUBTY TYPES
10001 1/1/2010 12/31/9999 01 COMS1
10001 1/1/2010 12/31/9999 02 COMS2
TableC:(PERNR BEGDA ENDDA are key fields)
PERNR BEGDA ENDDA AMNT
10001 2/2/1997 4/3/2010 1000
10001 4/4/2010 12/31/9999 2000
I have joined these table by the key 'PERNR'( like A->B and A->C)
Groped by the same key 'PERNR'
My result rows in the report:
PERNR BEGDA ENDDA WERKS SUBTY TYPES BEGDA ENDDA AMNT
10001 1/1/2010 12/31/9999 1001 01 COMS1 2/2/1997 4/3/2010 1000
10001 1/1/2010 12/31/9999 1001 02 COMS2 2/2/1997 4/3/2010 1000
10001 1/1/2010 12/31/9999 1001 01 COMS1 4/4/2010 12/31/9999 2000
10001 1/1/2010 12/31/9999 1001 02 COMS2 4/4/2010 12/31/9999 2000
But in the report format is like this in the Group Footer row:
PERNR: 10001 WERKS:1001
SUBTY: 02 AMNT :2000 (Current date)
AMNT :1000 (Previous record)
I created the format with "Previous" function
but in the report it is giving the '2000' instead of '1000' in the AMT field
Please help me, can i use the for loop in the report? or any sugessions?
Thanks in advance.
Regards,
VenkataA group footer will dis[lay contents of the last record. You need to sort records to ensure that the last record contains link to your dynamic image.
Ian
Maybe you are looking for
-
Hello folks First of all, I want to say sorry for my English. Well, I have one jsp file and I want to pass one value from web.xml file to it but I don't know how I also did the same thing with servlet and it's OK, I used function getInitParameter in
-
Unable to start Xorg server. Nouveau freezes screen on boot.
I have spent many hours searching the forums, reading the wiki, and googling. I am dual-booting on an early 2008 Macbook Pro. No optimus graphics card, just a Nvidia GeForce 8600M GT. It seems that no devices are being detected and KMS is not enabled
-
Huge Acrobat temp files - is this right?
Hi When using the reduce file size function, I have noticed that acrobat produces massive temp files. I was running some files over night, and acrobat crashed, presumably because it ran out of HD space. Upon looking for what was using all the space
-
CoreservicesUIagent Crashing, Games.
I'm trying to run two different video games. The first is Empire: Total War and the second Europa Universalis 3. I have a similar error report when I try to run either. The console logs are included below. I've repaired the disk permissions. I've tri
-
FInding differences is successive rows in a table
Hi , I have a few Audit tables which store all the changes in Entities in my application.. so I have tables like aud_table1, aud_table2 ...etc ... which have variable structure depending on actual entity audited. Above table store the complete entity