Total rows In jtree component
Hi All
how can i know the total numbers in my tree without expand it.
i dont want to use:
for(int TotalRowNumberInTree = 0; TotalRowNumberInTree < tree.getRowCount(); TotalRowNumberInTree++)
tree.expandRow(TotalRowNumberInTree);
Thanks
A loop on the model using isLeaf, and getChildCount?
Similar Messages
-
Quantity fields not getting displayed in the second total row
Hi,
As per the requirement I have to display 2 total rows for an ALV report using CL_GUI_ALV_GRID. I am able to get the first total row properly using method get_subtotal(). However for the next total row only the character fields are getting displayed and the quantity fields are coming blank.
The second total row will have different values based on a formula.
Please help me out in resolving the issue.
Thanks,
AbhishekYou can provide first row as the SUBTOTAL and next row as the TOTAL.
Get one extra column on which you can do the SUBTOTAL.
Regards,
Naimesh Patel -
SAP BW Universe displays only total row
Hi all,
I've created an universe from a SAP BW cube. When I'm using Xcelius I can only see one total Row in the list view item , no detailed Data. The following query I've created:
(Customer) (Material) (Amount)
--> No Filter selected
Thanks for your help!
Regards,
Sebastian
Edited by: soccerfan on Jun 16, 2009 10:42 AMHi,
Can you please explain in detail about your issue.
Thanks,
SK. -
% is not getting correctly for the Grand Total Row in OBI10g
Hi,We have a report in table view with the following structure.
Name Target Act %Ach
ABC 100 50 50
XYZ 200 10 5
Total 300 60 27.5
The value for the %Ach Total row should be 20% but in the report it is showing as 27.5.
any one observed this ,how to correct this??
ThanksHi,
To get grand total correctly..configure instanceconfig.xml and put..
<ReportAggregateEnabled>true</ReportAggregateEnabled> between <serverinstace>..
refer..
http://obiee101.blogspot.com/2009/09/obiee-grand-totals-with-calculated.html
Hope it solves ur problem -
Add a row after Total row in ALV report
Hi Experts,
I have a report is displayed by ALV format(not use function module to display it but use Class cl_gui_custom_container),I want to add a row after the total row. for example,
Customer amount1 amount2 amount3
10000 1,234 1,000 2,000
10001 4,000 2,000 1,000
10002 1,300 1,000 3,000
11000 1,200 4,000 3,000
Total: 7,734 8,000 9,000
Ratio% 31.27 32.34 36.39
the row of 'Total' is calculated by fieldcat-do_sum = 'X' But after the Total row we need a Ratio row to display the ratio. Yes we can calculate the total amout and ratio and then append it into the output itab, but we don't like this solution.We want to keep the total function in the ALV report.Any experts can poit me a direction. Thanks in advance.
JoeDjoe,
First you need to handle the user command,in order to capture the button action. For this you need to implment a class, i am attaching sample codes here
In top include write the following code
CLASS lcl_event_handler DEFINITION .
PUBLIC SECTION .
METHODS:
handle_toolbar FOR EVENT toolbar " To add new functional buttons to the ALV toolbar
OF cl_gui_alv_grid
IMPORTING e_object,
handle_user_command FOR EVENT user_command " To implement user commands
OF cl_gui_alv_grid
IMPORTING e_ucomm .
PRIVATE SECTION.
ENDCLASS. " Lcl_event_handler DEFINITION
Now <b>Class implementation</b>
CLASS lcl_event_handler IMPLEMENTATION .
METHOD handle_toolbar. " Handle Toolbar
PERFORM f9500_handle_toolbar USING e_object.
ENDMETHOD . " Handle_toolbar
METHOD handle_user_command . " Handle User Command
PERFORM f9600_handle_user_command USING e_ucomm .
ENDMETHOD.
ENDCLASS . " lcl_event_handler IMPLEMENTATION
FORM f9600_handle_user_command USING p_e_ucomm TYPE sy-ucomm.
CONSTANTS:c_newl(4) TYPE c
VALUE 'NEWL', " New line
c_copy(4) TYPE c
VALUE 'COPY', " Copy
c_corr(4) TYPE c
VALUE 'CORR'. " Correction
CASE p_e_ucomm .
WHEN c_newl.
Create a new line
PERFORM f9610_insert_new_line.
ENDFORM. " f9600_handle_user_command
FORM f9610_insert_new_line .
*Data Declarations
DATA: lt_rows TYPE lvc_t_row, " Itab for row property
ls_rows TYPE lvc_s_row, " Work area for row
lv_cntid TYPE i. " Counter
DATA: gv_index TYPE sy-index.
CLEAR gs_last.
CALL METHOD gr_alvgrid->get_selected_rows
IMPORTING
et_index_rows = lt_rows.
READ TABLE lt_rows INTO ls_rows INDEX 1.
IF sy-subrc EQ 0.
gv_index = ls_rows-index + 1.
ELSE.
gv_index = 1.
ENDIF.
DESCRIBE TABLE gt_last LINES lv_cntid.
lv_cntid = lv_cntid + 1.
gs_last-cntid = lv_cntid.
INSERT gs_last INTO gt_last INDEX gv_index.
LOOP AT gt_last INTO gs_last FROM gv_index TO gv_index.
Make the new line editable
PERFORM f9611_style.
ENDLOOP.
CALL METHOD gr_alvgrid->refresh_table_display
EXCEPTIONS
finished = 1
OTHERS = 2.
ENDFORM. " f9610_insert_new_line
You can ask questions doubts if any!
regards
Antony Thomas -
ALV totals row ,should not download in EXCEL
Hello ,
I have developed a ALV report with subtotals.
In the output, it will display an extra row with the Grand total, but when we try to downalod into Local PC excel file,
it is downlaoding the totals row also. But the requirement is not to download that.
Any option is there to not to downlad that row ?
Let me know if anything needed.
Thanks,
AVHi,
I will suggest one thing.
<li>Define layout structure
DATA: wa_layout type SLIS_LAYOUT_ALV.
<li>One checkbox on selection-screen for with or without total line.
PARAMETERS: p_check AS CHECKBOX.
<li>Now set the below on based on checkbox value
IF p_check = 'X'. "Lets say without total line.
wa_layout-no_totalline = 'X'.
ENDIF.
<li>Now pass wa_layout through REUSE* function module.
Thanks
Venkat.O -
ExceltoCI to insert a new effdt row in JOB_DATA component
Hi All,
We are trying to use ExceltoCI to insert a new effdt row in JOB_DATA component. But it is not working when the BU is changing. I believe it is caused by we need to assign BU prior to other SETID enabled field like Department, locations, jobcodes, etc. But unfortunately, in the JOB record/table the Business Unit is after DEPTID, LOCATION, JOBCODE field which causes the assignment of BU value is happened after assignment of DEPTID and LOCATION ect. So I am getting invalid departments, locations, jobcodes error. Since I am not aware of a way to change the load sequence by using ExceltoCI.
Any idea about how I can accomplish this for using ExceltoCIs or it is impossible? Thank you very much in advance.
P.S. I know it is quite simple to use AE+CI to do this.This seems to be a known issue, see this doc
E-CI: PT8.4x - ExcelToCI Fails if Properties are not Submitted in Correct Order [ID 649358.1]
I am a bit surprised by the workaround provided in this doc for this issue ... -
Count total rows in database?
Hello all,
Is there a way to query the database for the total number of rows.... without using ANALYZE STATISTICS? (That would cause the db to sometimes use COST instead of RULE based optimization, slowing it down significantly.)
I know I could could brute force a total row count with something like:
spool get_total_rows.sql
SELECT 'SELECT COUNT(*) FROM '||owner||'.'||table_name||';'
FROM ALL_TABLES;
spool off
...then run get_total_rows and manually add all the counts.
But it just seems like there must be a cleaner way to do it.
Thanks much,
Natashaok. here you have that information:
ALL_TABLES
ALL_TABLES describes all relational tables accessible to the current user. To gather statistics for this view, use the SQL ANALYZE statement.
Related Views
DBA_TABLES describes all relational tables in the database.
USER_TABLES describes all relational tables owned by the current user. This view does not display the OWNER column.
Note:
Columns marked with an asterisk are populated only if you collect statistics on the table with the ANALYZE statement or the DBMS_STATS package.
Column Datatype NULL Description
OWNER
VARCHAR2(30)
Owner of the table
TABLE_NAME
VARCHAR2(30)
Name of the table
TABLESPACE_NAME
VARCHAR2(30)
Name of the tablespace containing the table; NULL for partitioned, temporary and index-organized tables
CLUSTER_NAME
VARCHAR2(30)
Name of the cluster, if any, to which the table belongs
IOT_NAME
VARCHAR2(30)
Name of the index-organized table, if any, to which the overflow entry belongs. If IOT_TYPE column is not null, this column contains the base table name.
PCT_FREE
NUMBER
Minimum percentage of free space in a block; NULL for partitioned tables
PCT_USED
NUMBER
Minimum percentage of used space in a block; NULL for partitioned tables
INI_TRANS
NUMBER
Initial number of transactions; NULL for partitioned tables
MAX_TRANS
NUMBER
Maximum number of transactions; NULL for partitioned tables
INITIAL_EXTENT
NUMBER
Size of the initial extent in bytes; NULL for partitioned tables
NEXT_EXTENT
NUMBER
Size of the secondary extension bytes; NULL for partitioned tables
MIN_EXTENTS
NUMBER
Minimum number of extents allowed in the segment; NULL for partitioned tables
MAX_EXTENTS
NUMBER
Maximum number of extents allowed in the segment; NULL for partitioned tables
PCT_INCREASE
NUMBER
Percentage increase in extent size; NULL for partitioned tables
FREELISTS
NUMBER
Number of process freelists allocated to this segment; NULL for partitioned tables
FREELIST_GROUPS
NUMBER
Number of freelist groups allocated to this segment; NULL for partitioned tables
LOGGING
VARCHAR2(3)
Logging attribute; NULL for partitioned tables
BACKED_UP
VARCHAR2(1)
Has table been backed up since last change
NUM_ROWS*
NUMBER
Number of rows in the table
BLOCKS*
NUMBER
Number of used data blocks in the table
EMPTY_BLOCKS*
NUMBER
Number of empty (never used) data blocks in the table
AVG_SPACE*
NUMBER
Average amount of free space, in bytes, in a data block allocated to the table
CHAIN_CNT*
NUMBER
Number of rows in the table that are chained from one data block to another, or which have migrated to a new block, requiring a link to preserve the old ROWID
AVG_ROW_LEN*
NUMBER
Average length of a row in the table in bytes
AVG_SPACE_FREELIST
_BLOCKS
NUMBER
The average freespace of all blocks on a freelist
NUM_FREELIST_BLOCKS
NUMBER
The number of blocks on the freelist
DEGREE
VARCHAR2(10)
The number of threads per instance for scanning the table
INSTANCES
VARCHAR2(10)
The number of instances across which the table is to be scanned
CACHE
VARCHAR2(5)
Whether the cluster is to be cached in the buffer cache (CACHE | NOCACHE)
TABLE_LOCK
VARCHAR2(8)
Whether table locking is enabled or disabled
SAMPLE_SIZE
NUMBER
Sample size used in analyzing this table
LAST_ANALYZED
DATE
Date on which this table was most recently analyzed
PARTITIONED
VARCHAR2(3)
Indicates whether this table is partitioned. Set to YES if it is partitioned.
IOT_TYPE
VARCHAR2(12)
If this is an index-organized table, then IOT_TYPE is IOT, IOT_OVERFLOW, or IOT_MAPPING. If this is not an index-organized table, then IOT_TYPE is NULL.
TEMPORARY
VARCHAR2(1)
Can the current session only see data that it place in this object itself?
SECONDARY
VARCHAR2(1)
Whether the trigger is a secondary object created by the ODCIIndexCreate method of the Oracle9i Data Cartridge (Y |N)
NESTED
VARCHAR2(3)
Is the table a nested table?
BUFFER_POOL
VARCHAR2(7)
The default buffer pool for the object. NULL for partitioned tables
ROW_MOVEMENT
VARCHAR2(8)
Whether partitioned row movement is enabled or disabled
GLOBAL_STATS
VARCHAR2(3)
For partitioned tables, indicates whether statistics were collected for the table as a whole (YES) or were estimated from statistics on underlying partitions and subpartitions (NO)
USER_STATS
VARCHAR2(3)
Were the statistics entered directly by the user?
DURATION
VARCHAR2(15)
Indicates the duration of a temporary table:
SYS$SESSION: the rows are preserved for the duration of the session
SYS$TRANSACTION: the rows are deleted after COMMIT
Null for a permanent table
SKIP_CORRUPT
VARCHAR2(8)
Whether Oracle ignores blocks marked corrupt during table and index scans (ENABLED) or raises an error (DISABLED). To enable this feature, run the DBMS_REPAIR.SKIP_CORRUPT_BLOCKS procedure.
MONITORING
VARCHAR2(3)
Whether the table has the MONITORING attribute set
Try with ALL_TABLES and post if the results were zero too
Joel P�rez -
ALV: how to display only subtotals and total rows in the output
ALV: how to display only subtotals and total rows in the output
i am getting output
i am getting subtotals for respective fields
but i want to display only subtotals and totals rows in the output
i have tried the
totals_only parameter in slis_layout_alv
but it is not working.hi,
For TOTAL
For the amount field / quantity field in the field catalog give DO_SUM = 'X' for WHOLE total
For SUBTOTAL
For subtotal you will have to create an internal table sort..Let's say you want to do subtotal for each customer..
DATA: lt_sort type SLIS_T_SORTINFO_ALV,
ls_sort type slis_sortinfo_alv.
CLEAR ls_sort.
ls_sort-spos = 1.
ls_sort-fieldname = 'Give the field name that you do the sum'.
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
APPEND ls_sort TO lt_sort.
fieldcatalog-do_dum = 'X'.
for subtotals
WA_SORT-FIELDNAME = 'ERSDA'.
WA_SORT-SPOS = '2'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOTAL = 'X'.
APPEND WA_SORT TO IT_SORT.
Refer
http://help.sap.com/saphelp_erp2004/helpdata/en/ee/c8e056d52611d2b468006094192fe3/content.htm
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/doesnt-function-event-subtotal_text-in-alv-713787
regards,
Prabhu
reward if it is helpful -
Formatting the total row column for a OATableBean
Hi,
I have an OATableBean with total row column.
I need to format one column and it's total value as 28,861.972528.
I used both codes below:
1-
Formatter formatter = new OADecimalValidater("###,###,##0.00000;-###,###,##0.00000", "###,###,##0.00000;-###,###,##0.00000");
OAMessageStyledTextBean unitBean = (OAMessageStyledTextBean)webBean.findChildRecursive("UnitLandedCost");
if(unitBean != null)
unitBean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);
2-
DictionaryData unitBeanFormat = (oracle.cabo.ui.data.DictionaryData)tableColumnFormats.getItem(pageContext.findChildIndex(tableBean, "UnitLandedCost"));
f(unitBeanFormat != null)
unitBeanFormat.put(ON_SUBMIT_VALIDATER_ATTR, formatter);
Both codes worked for the values, but the total value was not formatted in both cases. I tried to use the code below to get the column Footer, but the tableFooterBean is null:
OATableFooterBean tableFooterBean = (OATableFooterBean)tableBean.getColumnFooter();
Is there anything else that should be done to format the total value?
Thanks and Regards,
AndreaAs Tapash mentioned getTotalValues method will work. Another option can be to calculate the total value based on the rows of VO but that won't be required unless you are looking for Grand Total functionality.
--Shiv -
How to get last Record ior Total rows in For Loop Cursor ?
Hi Friends
I would like to know , the last record in for loop cursor, i have the code in following format
cursor c1 is
select * from emp;
begin
for r1 in c1 loop
v_total_rec := ? ( i would like to know total rows in the cursor , say for example if cursor has 10 rows, i want10 into this variable )
v_count := v_count +1;
dbms_output.put_line(r1.emp_name);
end loop;
end;
Hope i am clear
Any suggestions?
Thanks
RaviEven though cursor loops are generally a Bad Idea ^tm^ as Dan says, here's an example of how you can get the information you wanted within the query itself...
SQL> ed
Wrote file afiedt.buf
1 declare
2 cursor c1 is
3 select emp.*
4 ,count(*) over (order by empno) as cnt
5 ,count(*) over () as total_cnt
6 from emp
7 order by empno;
8 begin
9 for r1 in c1 loop
10 dbms_output.put_line(r1.ename||' - row: '||r1.cnt||' of '||r1.total_cnt);
11 end loop;
12* end;
SQL> /
SMITH - row: 1 of 14
ALLEN - row: 2 of 14
WARD - row: 3 of 14
JONES - row: 4 of 14
MARTIN - row: 5 of 14
BLAKE - row: 6 of 14
CLARK - row: 7 of 14
SCOTT - row: 8 of 14
KING - row: 9 of 14
TURNER - row: 10 of 14
ADAMS - row: 11 of 14
JAMES - row: 12 of 14
FORD - row: 13 of 14
MILLER - row: 14 of 14
PL/SQL procedure successfully completed.
SQL> -
Hide column result in pivot grand total row
Hello
Do you know if it is possible to hide the result of a particular column in a pivot grand total row?
I have several columns to which makes sense use a grand total row (as in a sum) but for others (such as average) it does not make sense in the light of the client business rules.
Any help on this matter is highly appreciated :)
Thanks in advance,
J MarquesI have a measure that represents the average time according to the dimensions it uses - and that works properly.
However, the grand total for that column shows me the average of the average times above. This is not correct that is why I want to hide it.As said by kishore, In pivot go to that time average time column -> Aggregation rule -> None, This won't affect the column avg value.
The grant total value will not come.
By setting this, are you getting wrong values?
Thanks,
Vino -
Add total row with a webservice
Hi there,
Im trying to update a list view to add the totals to a column subtotal. Im following the instructions given on
Webservice Page
When check the response of the webservice I'm not seeing the aggregation response and the total row is not being added. When I add or remove columns through this webservice it does work. Has anyone experiencing the same issue or knows how
to solve this ?
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<UpdateView xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>User1</listName>
<viewName>{LIST VIEW GUID}</viewName>
<viewProperties/>
<query/>
<viewFields/>
<Aggregations Value="On">
<FieldRef Name="subtotal" Type="Sum"/>
</Aggregations>
<formats/>
<rowLimit/>
</UpdateView>
</soap:Body>
</soap:Envelope>Hi,
Is this “subtotal” a valid field name and the type of this column is “Number”?
Also, please add this column into the <viewFields/> and do the test again.
Feel free to reply with the test result if the issue still exists.
Thanks
Patrick Liang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Patrick Liang
TechNet Community Support -
Using threads (SwingWorker) to update JTree component
Hi,
Im having a problem trying to update a JTree component (adding child nodes to an existing node) using threads. Im using the SwingWorker3 class (http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html) for threading.
When the user selects a node for expansion, the logic for fetching the children of the selected node is executed under the construct() method of SwingWorker.
Once this data is obtained, the job of adding the children to the selected node is done in the finished() method which runs on the event-dispatch thread as per documentation of SwingWorker3.
The problem Im facing is that even though the data for the children is obtained and the finished() method executes and adds the children to the selected node, they are not visible in the UI.
If anybody knows how this can be resolved, please let me know. Any help/pointers would be greatly appreciated.
Rgds
SridharI added the tree.updateUI() method call in the finished() method. This renders the children (Yipee!).
But now I have a new problem. If I collapse and again expand a node, I get a NPE. (I see all the child nodes but a exception is still thrown) The exception happens after my treeWillExpand() and treeExpanded() method implementations. So no probs in my code.
If you know of a solution, pleeease let me know.
TIA
Sridhar
Exception occurred during event dispatching:
java.lang.NullPointerException
at javax.swing.plaf.basic.BasicTreeUI.updateSize(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI$MouseHandler.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source) -
How to determine total rows updated in a day
I want to get the count for total rows updated in a table in a day. There is only two coulmns in the table. One is for EMP_ID & other for EMP_NAME. ( I want to do it without altering table or creating another column for storing updated date).
Is there any solution ?
Is there any file which can use for this stuff?
Any help in this scenario is appreciated.The problem is that the constraint that you cannot add an appropriate column to track updates is diametrically opposed to the requirement that they want a daily row count. Realistically, one of these two have to give-- either you need permission to add a column or your requirement is not feasible.
Theoretically, assuming the system is in ARCHIVELOG mode, you could use LogMiner, but that would be a bear to code and maintain, in addition to being a huge drain on performance. You could also enable auditing for the table, but that creates a variety of issues itself.
Justin
Maybe you are looking for
-
How to export all the projects at one time
I got about 20 projects and content about 7000 pics. I don't want to just export project each time, and I would like to just export all of them at one time, is it possible? I don't know where and how to change the name of the master files, and how to
-
How to unlock logical Partition in recovery mode?
I have problems with my iMac (2007) after installing 10.7.2. It's not starting any more. Now, in recovery mode in Disk Utility I've clicked on Turn Off Ecryption..., because my disk is encrypted with FileVaul2. The probelm is, it's showing now as Loc
-
hi all, i am newbie in toplink. i want to define a named query in toplink mapping workbench (for example test). how can i call this named query and execute it. need help
-
Duration for transition wont change from 00:00:00;22
I am trying to add a Dissolve transition between 2 clips in the timeline but the duration won't change from 00:00:00;22. I set the time in the transition editor and and drag it to the timeline but it still changes to 22 frames. I have tried dragging
-
How to decrypt md5 in pl/sql
Hello ! Can somebody tell that how to decrypt password of md5 type encryption. Is there any way of decrypt md5 . Regards