Capture Asc/Desc Sort direction in headerRelease
I want to store the user's sort column AND direction so data
updates will
maintain the user's sort preference.
I am using the Datagrid's headerRelease function to capture
the column that
the user sorted on, but I cannot figure out how to capture
whether their
last column sort was ascending or descending.
This may not be the best way but I needed something quick, so
I
compared the column clicked on to the stored column, if it
matched
then I know the sort direction is the opposite of what it
was, and if the
column doesn't match then I know when you click on a new
column
the sort direction is ascending.
Similar Messages
-
Decode in order by - asc/desc
I'm trying to be able to dynamically change the asc/desc in the order by.
Here is some sql that works:
select * from transactions order by decode(somevar,'a',acct_nbr,'c',card_number,acct_nbr) asc
What I wanted was something like this:
select * from transactions order by decode(somevar,'a',acct_nbr,'c',card_number,acct_nbr) decode(anothervar,'a',asc,'d',desc,asc)
but this doesn't appear to work. Am I missing something, or is there another way.
Thanks in advance,There are a bunch of restrictions on ordering when you use union all. It usually either requires the numerical position of the column, so if you want to order by the first column, then you order by 1, or a column alias, which sometimes can be used in only the first select and is sometimes required in all of them. However, even if you order by column position, such as order by 1, it does not seem to allow this in a decode. The simplest method is to use your entire query containing the union all as an inline view in an outer query. Please see the following examples that do this and also demonstrate how to get the order by options, including ascending and descending that you desire, assuming that your columns are of numeric data types.
scott@ORA92> -- sort by acct_nbr asc:
scott@ORA92> ACCEPT somevar PROMPT 'Enter a to sort by acct_nbr or c to sort by card_number: '
Enter a to sort by acct_nbr or c to sort by card_number: a
scott@ORA92> ACCEPT anothervar PROMPT 'Enter 1 to sort ascending or -1 to sort descending: '
Enter 1 to sort ascending or -1 to sort descending: 1
scott@ORA92> SELECT acct_nbr, card_number
2 FROM (SELECT 1 AS acct_nbr,
3 3 AS card_number
4 FROM dual
5 UNION ALL
6 SELECT 2 AS acct_nbr,
7 4 AS card_number
8 FROM dual
9 UNION ALL
10 SELECT 3 AS acct_nbr,
11 2 AS card_number
12 FROM dual
13 UNION ALL
14 SELECT 4 AS acct_nbr,
15 5 AS card_number
16 FROM dual
17 UNION ALL
18 SELECT 5 AS acct_nbr,
19 1 AS card_number
20 FROM dual)
21 ORDER BY DECODE ('&somevar',
22 'a', acct_nbr * NVL (&anothervar, 1),
23 'c', card_number * NVL (&anothervar, 1),
24 acct_nbr * NVL (&anothervar, 1))
25 /
ACCT_NBR CARD_NUMBER
1 3
2 4
3 2
4 5
5 1
scott@ORA92> -- sort by card_number asc:
scott@ORA92> ACCEPT somevar PROMPT 'Enter a to sort by acct_nbr or c to sort by card_number: '
Enter a to sort by acct_nbr or c to sort by card_number: c
scott@ORA92> ACCEPT anothervar PROMPT 'Enter 1 to sort ascending or -1 to sort descending: '
Enter 1 to sort ascending or -1 to sort descending: 1
scott@ORA92> SELECT acct_nbr, card_number
2 FROM (SELECT 1 AS acct_nbr,
3 3 AS card_number
4 FROM dual
5 UNION ALL
6 SELECT 2 AS acct_nbr,
7 4 AS card_number
8 FROM dual
9 UNION ALL
10 SELECT 3 AS acct_nbr,
11 2 AS card_number
12 FROM dual
13 UNION ALL
14 SELECT 4 AS acct_nbr,
15 5 AS card_number
16 FROM dual
17 UNION ALL
18 SELECT 5 AS acct_nbr,
19 1 AS card_number
20 FROM dual)
21 ORDER BY DECODE ('&somevar',
22 'a', acct_nbr * NVL (&anothervar, 1),
23 'c', card_number * NVL (&anothervar, 1),
24 acct_nbr * NVL (&anothervar, 1))
25 /
ACCT_NBR CARD_NUMBER
5 1
3 2
1 3
2 4
4 5
scott@ORA92> -- sort by acct_nbr desc:
scott@ORA92> ACCEPT somevar PROMPT 'Enter a to sort by acct_nbr or c to sort by card_number: '
Enter a to sort by acct_nbr or c to sort by card_number: a
scott@ORA92> ACCEPT anothervar PROMPT 'Enter 1 to sort ascending or -1 to sort descending: '
Enter 1 to sort ascending or -1 to sort descending: -1
scott@ORA92> SELECT acct_nbr, card_number
2 FROM (SELECT 1 AS acct_nbr,
3 3 AS card_number
4 FROM dual
5 UNION ALL
6 SELECT 2 AS acct_nbr,
7 4 AS card_number
8 FROM dual
9 UNION ALL
10 SELECT 3 AS acct_nbr,
11 2 AS card_number
12 FROM dual
13 UNION ALL
14 SELECT 4 AS acct_nbr,
15 5 AS card_number
16 FROM dual
17 UNION ALL
18 SELECT 5 AS acct_nbr,
19 1 AS card_number
20 FROM dual)
21 ORDER BY DECODE ('&somevar',
22 'a', acct_nbr * NVL (&anothervar, 1),
23 'c', card_number * NVL (&anothervar, 1),
24 acct_nbr * NVL (&anothervar, 1))
25 /
ACCT_NBR CARD_NUMBER
5 1
4 5
3 2
2 4
1 3
scott@ORA92> -- sort by card_number desc:
scott@ORA92> ACCEPT somevar PROMPT 'Enter a to sort by acct_nbr or c to sort by card_number: '
Enter a to sort by acct_nbr or c to sort by card_number: c
scott@ORA92> ACCEPT anothervar PROMPT 'Enter 1 to sort ascending or -1 to sort descending: '
Enter 1 to sort ascending or -1 to sort descending: -1
scott@ORA92> SELECT acct_nbr, card_number
2 FROM (SELECT 1 AS acct_nbr,
3 3 AS card_number
4 FROM dual
5 UNION ALL
6 SELECT 2 AS acct_nbr,
7 4 AS card_number
8 FROM dual
9 UNION ALL
10 SELECT 3 AS acct_nbr,
11 2 AS card_number
12 FROM dual
13 UNION ALL
14 SELECT 4 AS acct_nbr,
15 5 AS card_number
16 FROM dual
17 UNION ALL
18 SELECT 5 AS acct_nbr,
19 1 AS card_number
20 FROM dual)
21 ORDER BY DECODE ('&somevar',
22 'a', acct_nbr * NVL (&anothervar, 1),
23 'c', card_number * NVL (&anothervar, 1),
24 acct_nbr * NVL (&anothervar, 1))
25 /
ACCT_NBR CARD_NUMBER
4 5
2 4
1 3
3 2
5 1
[pre] -
How do you Change Group Sort Direction using Report Client
It looks like there should be a sort direction property on the ISCRGroupOptions object but there is none. So how do you set the sort direction of the group?
I tried that and it did not work. Here's the code to change the grouping, note I also change the associated sort object. I did notice that if you go into the crystal reports designer and bring up the Record Sort Export and select the group's corresponding sort that the Sort Direction radio buttons are disabled. The question is how to change the sort direction shown on the Change Group Options dialog?
public bool GroupModify(short GroupIndex, string TableName, string ColumnName, SortDirection SortDirection)
bool result = false;
if ((_ReportClient != null) && (GroupIndex >= 0) && (GroupIndex < this.GroupCount()))
CrystalDecisions.CrystalReports.Engine.Group docGroup = _ReportDocument.DataDefinition.Groups[GroupIndex];
ISCRField field = _ReportClient.DataDefController.FindFieldByFormulaForm(docGroup.ConditionField.FormulaName);
if (field != null)
Group group = _ReportClient.DataDefController.GroupController.FindGroup(field);
if (group != null)
Group newGroup = group.Clone();
newGroup.ConditionField = FieldGet(TableName, ColumnName);
if ((newGroup.ConditionField != null) && (_ReportClient.DataDefController.GroupController.CanGroupOn(newGroup.ConditionField)))
_ReportClient.DataDefController.GroupController.Modify(group, newGroup);
result = this.SortSet(TableName, ColumnName, SortDirection);
return result;
public bool SortSet(string TableName, string ColumnName, SortDirection SortDirection)
bool successful = false;
if (_ReportClient != null)
ISCRField field = FieldGet(TableName, ColumnName);
if (field != null)
ISCRSort sort = _ReportClient.DataDefController.SortController.FindSort(field);
if (sort != null)
_ReportClient.DataDefController.SortController.ModifySortDirection(sort, CRSortDirection(SortDirection));
return successful;
public int GroupCount()
int count;
if (_ReportClient != null)
count = _ReportClient.DataDefController.DataDefinition.Groups.Count;
else
count = 0;
return count; -
Capture images from Camera directly at high resolution
Hello Users,
I want to capture images from Camera directly at high
resolution. The problem is that although I am able to capture
images from a Video Object, but the images are small because the
Video size is only 160x120. So if I am able to capture directly
from Camera, I am sure to get a higher resolution images at which
the camera is capturing.
Any help in this matter will be of great helpHello Users,
I want to capture images from Camera directly at high
resolution. The problem is that although I am able to capture
images from a Video Object, but the images are small because the
Video size is only 160x120. So if I am able to capture directly
from Camera, I am sure to get a higher resolution images at which
the camera is capturing.
Any help in this matter will be of great help -
How can I change the sorting direction of Events in Photos?
How can I change the date Sort "direction" in Photos for the iPhoto Events folder? Unlike iPhoto, which sorted the older photos at the top, Photos does the reverse. Can this be modified?
>System Preferences>Hardware>Mouse>Point & Click>Scroll Direction.
-
We have some columns being added to a table. We have set the sortProperty and the filterProperty on each of our columns.
This allows us to both filter and sort.
We want to be able to access the columns filter value and sort value after the fact. Can we access the table and then the columns and then a columns properties to find these two items? How can I access the sort direction and filter value of columns?
We would also like to store the filter value and the sort direction, and re-apply them to the grid if they have been set in the past. How can we dynamically set the filter value and sort direction of a column?
Can I catch or view the 'filtered' or 'sorted' event? We would like to look at the event that occurs when someone sorts or filters a column. Where can I see this event or where can i tie into it, without overwriting the base function?Hey everyone,
Just wanted to share how I implemented this:
Attach a sort event handler to table - statusReportTable.attachSort(SortEventHandler);
In this event handler, grab the sort order and sorted column name then set cookies with this info
function SortEventHandler(eventData)
var sortOrder = eventData.mParameters.sortOrder;
var columnName = eventData.mParameters.column.mProperties.sortProperty;
SetCookie(sortDirectionCookieName, sortOrder, tenYears);
SetCookie(sortedColumnCookieName, columnName, tenYears);
Added sortProperty and filterProperty to each column definition:
sortProperty: "ColName", filterProperty: "ColName",
When i fill the grid with data, i check my cookies to see if a value exists, and if so we apply this sort:
function FindAndSortColumnByName(columnName, sortDirection (true or false))
var columns = sap.ui.getCore().byId('statusReportTable').getColumns();
var columnCount = columns.length;
for(var i = 0; i < columnCount; i ++)
if(columns[i].mProperties.sortProperty == columnName)
columns[i].sort(sortDirection); -
Changing default sort direction
Hi there
The standard table analysis item that can be included in a template comes with functionality whereby a user can sort the data. The default sort direction is ASCENDING.
It is now my task to determine how to make that DESCENDING ... any ideas on how the default / initial sort direction can be altered?
Cheers,
AndrewHi Andrew,
maybe make the sort direction of the query DESCENDING.
regards,
Raymond Baggen
Uphantis bv -
Svp quand je clique dans n'importe quelle app sauf originaux sa sort direct ! les apps ne veulent plus marcher!!!! !!!!!!!!!!! aidez moi! mercii!
-
How To Sort the Table Through Push Buttons (ASC & Desc)???
Hi,
I am facing a problem with regard to 'Push Buttons' that I have created on
my Form. I want the 'Push Button' to sort the table with respect to a
specific column in 'Ascending order' on first push and then in 'Descending
order' on second push and then again in 'Ascending order' on third push and so
on...
please help me to achieve this
regards,
.Hello,
You could try something like this:
Declare
LC$Order Varchar2(128) := Get_Block_Property( 'EMP', ORDER_BY ) ;
Begin
If Instr( LC$Order, 'DESC' ) > 1 Then
Set_Block_Property( 'EMP', ORDER_BY, 'EMPNO ASC' ) ;
Else
Set_Block_Property( 'EMP', ORDER_BY, 'EMPNO DESC' ) ;
End if ;
Execute_Query ;
End ; Francois -
How to show values with initial sort asc/desc in 11.5.10 iProcurement page?
(Logged Bug 12902576 with OAFramework DEV, but OAF DEV closed the bug and advised to log the issue here in the forum)
How to have values sorted in ascending order when user first navigates to the page?
Currently the values are unsorted, and are only sorted after the user clicks the column heading to sort the values. We expect the users should not have to click the column heading, but instead that the values should be sorted in ascending order when the user navigates to the page. This issue occurs on an OAFramework based page in iProcurement application.
PROBLEM STATEMENT
=================
Receipts and Invoices are not sorted in iProcurement Lifecycle page even after implementing personalization to sort ascending on Receipt Number and Invoice Number. Users expect the receipts and invoices to be sorted but they are not sorted.
STEPS TO REPRODUCE
1. Navigate to iProcurement
2. Click the Requisitions tab
3. Search and find a requisition line that is associated to a Purchase Order having multiple receipts and multiple invoices.
4. Click the Details icon to view the lifecycle page where the receipts and invoices are listed
- see that the receipts are not sorted, and the invoices are not sorted
5. Implement personalization to sort in ascending order for Receipt Number and for Invoice Number. Apply the personalization and return to page.
- the receipts and invoices are still not sorted.
IMPACT
Users need the receipts and invoices sorted to make it easier to review the data. As a workaround, click the column heading to sort the results
Tried workaround suggested by OAFramework DEV in Bug 12902576 but this did not help.
TESTCASE of suggested workaround
NAVIGATION in visprc01
1. Login: dfelton / welcome
2. iProcurement responsibility / iProcurement Home Page / Requisitions tab
3. Click the Search button in the upper right
4. Specify search criteria
- Remove the 'Created by' value
- Change 'Last 7 Days' to 'Anytime'
- Type Requisition = 2206
5. Click Go to execute the search
6. Click the Requisition 2206 number link
7. Click the Details icon
8. In the Receipt section, click the link 'Personalize Table: (ReceivingTableRN)'
9. Click the Personalize (pencil) icon
10. Click the Query icon for Site level (looks different than the screenshots from OAFramework team, because this is 11.5.10 rather than R12
- Compare this to the Table personalization page show in the reference provided by OAFramework team -
http://www-apps.us.oracle.com/fwk/fwksite/jdev/doc/devguide/persguide/T401443T401450.htm#cust_persadmin_editperprop
11. See on the Create Query page
Sorting
No sorting is allowed
The Query Row option becomes available in personalize after setting the Receipt Number row to Searchable. However, even after clicking the Query icon to personalize, it is not possible to specify sorting. There is a Sorting heading section on the personalization page, but there is also a statement: No sorting is allowed
The workaround mentioned by OAFramework team in Bug 12902576 does not work for this case
- maybe because this is 11.5.10 rather than R12?
- maybe similar to Bug 8351696, this requires extension implementation?
What is the purpose of offering ascending/descending for Sort Allowed if it does not work?
Please advise if there is a way to have the initial sort in ascending order for this page.I´m sorry that you couldn´t reproduce the problem.
To be clear:
It´s not about which symbol should seperate the integer part from the fraction.
The problem is, that i can´t hide the fraction in bargraph.
The data im showing are integers but the adf bar graph component wants to show at least 4 digits.
As I´m from germany my locale should be "de" but it should matter in the test case.
You can download my test case from google drive:
https://docs.google.com/open?id=0B5xsRfHLScFEMWhUNTJsMzNNUDQ]
If there are problems with the download please send me an e-mail: [email protected]
I uploaded another screenshot to show the problem more clear:
http://s8.postimage.org/6hu2ljymt/otn_hide_fraction.jpg
Edited by: ckunzmann on Oct 26, 2012 8:43 AM -
Hi
i want to know if the clicked column is sorted ASC or DESC,
While debugging step by step, i found a property in dataGrid whis is "sortDirection"
but this property is not accessible like this "dataGrid.sortDirection"
is there any method to access this property.
thank youHi, for using that kind of property you have to use 'mx_internal'.
I am putting the code here which can explore you mutch better.
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.collections.*;
import mx.core.mx_internal;
use namespace mx_internal; [Bindable]
public var ac:ArrayCollection = new ArrayCollection([ {No:'1', Name:'Charl' },{No:
'2', Name:'Mark' },{No:
'3', Name:'James' },{No:
'4', Name:'Robin' }]);
private function onCreationComplete(): void{
dg.mx_internal::sortDirection ="DESC" ;}
]]>
</mx:Script>
<mx:DataGrid id="dg" width="350" height="200" dataProvider="{ac}" creationComplete="onCreationComplete()">
<mx:columns>
<mx:DataGridColumn dataField="No"/>
<mx:DataGridColumn dataField="Name"/>
</mx:columns>
</mx:DataGrid>
Hope it will help you.
with Regards,
Shardul Singh Bartwal -
Break Order Attribute (Asc/Desc) in Reports
Please forgive me my ignorance.
I have a dummy column that I use to select another column into. I set the break attribute on it as ascending.
Now my user wants it either way i.e. ascending or descending.
Is there way to change the break order attribute to change sorting dynamically depending on inputs.
Thanks in advance to all who reply.I was hoping that someone would know how I can modify the
ORDER BY 1 DESC,27 ASC part
The ORDER BY 1 DESC,27 ASC part is generated by break attributes. I would like to modify the "DESC" dynamically from within the report so I could change it as needed.
I don't know if it can be done via one of the srw package functions... and if so, which one and how. That was where I was trying to go. -
How can I capture live HD video direct to hard drive?
Hello,
My goal is to be able to capture 1080p video from a camcorder direct to the hard drive of a mac. Space is a concern, so ideally this would capture directly to a Mac Mini, but if the only option is to upgrade to a Mac Pro or MacBook Pro (for Thunderbolt), I may be able to work with that. What I know about so far are the offerings from Black Magic:
1) The H.264 pro recorder: http://www.blackmagic-design.com/products/h264prorecorder/
2) and the Ultra Studio 3D: http://www.blackmagic-design.com/products/ultrastudio3d/
With the first option, I'm worried about the quality. Ultra Studio 3D is very expensive ($1000) and would require upgrading to a MacBook Pro for Thunderbolt, but I'm open to that if it is the only way to get full 1080p quality.
I also have read about an app in the Firewire SDK called DHS cap. I haven't been able to try this since the cameras I have access do not have Firewire, but if people have had success with that, then I can purchase a camera that can connect through Firewire.
The last thing I've read about is Capture Magic HD. I would like to test this as well, but it appears the developers are out of business (their website is down), and i cannot find the software anywhere.
Any advice about the best way to go about this would be greatly appreciated. I've been googling away and searching forums for days now.Really? You've never opened up the capture window?
Never since about CS2.
I have had a tapeless workflow for ever... so never had reason to even take a look at the Capture Window in later versions of Premiere. -
Hi! all
i would appreciate if any one would clear me the concept of the
order by clause using the ASC and DESC
i have a table which has the few columns
including the date the column as one of them
Most of the Queires i deal with need to
return the most recent records
( as each record entered today as date field entered ..today's date..)
So...
select * from
<table_name>
where rownnum <=10 **need to only first 10 records**
order by datefiled desc
hoping that i would get most recent at the top...
but it falied...
i tried with
**Order by ASC*** it also returned same
old ten records(1998) but not new(2000)
Now i am confused with the concept of DESC/ASC
does it work with DATE field...
if not what would be best way to query the most recent records.(DATE FIELD)
Experts please clarify my question ASAP
Best Rgds
nullHello Some,
This type of subquery was first available in 7.3.4 (I think). You can find more about it in:
Oracle8i SQL Reference
Release 8.1.5
Chapter 5 Expressions, Conditions, and Queries
This type of subquery can be used instead of creating a view. You can also use it to bypass some limitations. A nice example is the CONNECT BY clause. When you use this, you have limitations. When you put the part with the CONNECT BY clause in such a subquery, you are able to do a lot more in this SQL-statement than otherwise.
SELECT TRE.TREELEVEL, TRE.PARENTID, TRE.NODEID,
DOC.URL, DOC.DESCRIPTION,
NVL(IMG.CLOSEDIMAGE, nvl(IMG.OPENIMAGE, 'folder')) CLOSEDIMAGE,
NVL(IMG.OPENIMAGE, 'folder') OPENIMAGE
FROM (select level TREELEVEL, nod.documentid, nod.nodeid, nod.nodeseq, nod.parentid
from web.nodes nod
start with nod.nodeid=&TreeRoot
connect by prior nod.nodeid=nod.parentid) TRE,
WEB.DOCUMENTS DOC, WEB.IMAGES IMG
WHERE TRE.DOCUMENTID=DOC.DOCUMENTID(+)
AND DOC.IMAGEID =IMG.IMAGEID(+)
ORDER BY DOC.DESCRIPTION
null -
Capture HPX500 live feed directly to Mac?
How to capture directly into a Mac from a live feed from a HPX500 P2 camera?
We did several hours with 2 HPX 500s at the 145th Gettysburg event this year. We used FCP 5.1.4 log and capture over firewire. Make sure to keep the firewire cable under 15 feet. Settings DVCPro HD 720p30. Set the HPX 500 to 720p30 NOT 720p30n. Make sure you are capturing to a fast Raid array with firewire 800 interface and enough space. Connect the camera to the firewire 400 port. Turn off the abort dropped frames, auto render, turn off drive and computer sleep. No problems at all. Great thing is that it is already there ready to edit at the end of the show. Really cool way to do a long form capture.
Maybe you are looking for
-
Photo-merge or photo-stitch?
Is there a way to take several photos amd merge them into a panorama with Aperture? I know Photoshop can do it, but I'd like to try it in Aperture, if possible. Thanks in advance!
-
My Zen Micro won't start!
Hi, my zen micro turns on when it is connected to the computer. but it only says, "creative, copyright...." how do i get it to start again? i tried it on different computers to see if it was a pc problem but that didn't help either. then, i tried cha
-
Anyone have any idea what this error is or how to resolve it? I'm trying to run smpatch on a Solaris 8 Sun Blade 100 box and getting the following error: /usr/sadm/bin/smpatch download -i 112438-01 Requested patches: 112438-01 Downloading the request
-
This happened to me when sharing to Apple ProRes. My solution: I switched the timeline view to frame view and discovered that the "bad" frame was actually outside my edited part. So I just selected a range of what I wanted to export, excluding any
-
I need create a new database in bpa
Hello need to create a new database in the repository of BPA in the new server added apart from the local database. When I say create nothing happens. Thanks ...