Devexpress Gridview Filter Control - filter

I have a ASPxGridView component that is filled from a SQL query
I wanted to apply a filter on my ASPX Gridview
so I wrote:
<dx:ASPxGridView runat="server" ID="gvExecReq" Visible="false" AutoGenerateColumns="true"
OnPageIndexChanged="gvExecReq_PageIndexChanged" OnBeforeColumnSortingGrouping="gvExecReq_BeforeColumnSortingGrouping">
**<Settings ShowFilterRow="True" />
<Settings ShowFilterBar="Visible" ShowHeaderFilterButton="True" />**
</dx:ASPxGridView>
the filter is well established, but it is not functional
What do I need to add more?

Please Use Following Settings For Filter To Be Operational :
<Settings ShowHeaderFilterButton="true"
EnableFilterControlPopupMenuScrolling="True"
ShowFilterBar="Visible" ShowFilterRow="True" ShowFilterRowMenu="True" />
Also In The Columns of The Grid You Can Control The Condition of Filtering i.e. Contains, Equal, Does Not Contain etc.
<dx:GridViewDataColumn Settings-AutoFilterCondition="Contains" Settings-FilterMode="DisplayText">

if in the database filed type is string you can write part of text for search,but is type of int or decimal or so on,you should write ALL text even it can find rows

Related

How to get ID for onRowSelected event for asp.net webforms jqGrid?

I have implemented server side jqgrid with the following code
<trirand:JQGrid ID="jQGrid1" runat="server" OnDataRequesting="jQGrid1_DataRequesting" Height="220" LoadOnce="false" OnRowSelecting="jQGrid1_RowSelecting">
<AppearanceSettings ShowRowNumbers="true" />
<Columns>
<trirand:JQGridColumn DataField="AppId" HeaderText="Application ID" PrimaryKey="True" Width="100" />
<trirand:JQGridColumn DataField="Name" HeaderText="Application Name" Width="200"/>
<trirand:JQGridColumn DataField="Link" Width="280" />
</Columns>
<PagerSettings ScrollBarPaging="true" PageSize="20" NoRowsMessage="scroll down to fetch records" CurrentPage="1"/>
</trirand:JQGrid>
But for the onRowSelected Event when i check in my c# code i was getting selected index as some random values like jqg11,jqg25,....
why is it happening .What should i do to make one of my column to set as key when selected
I have checked below options
jQGrid1.SelectedRow
e.RowKey
I don't use commercial version of jqGrid, thus the code which you posted say me almost nothing. Nevertheless the reason of ids like jqg11 and jqg25 are typically errors in filling of the grid. jqGrid requires to assign id attribute to every row. So the server response should contains the id values. The exact information depends on the format of input data which you chosen, from the version of jqGrid which you use and from other options like id property of jsonReader or the existence of key: true property in one column of colModel. I recommend you to verify the JSON/XML data which you use to fill the grid. Probably you ddidn't specified correctly the id values.

Get the selected values from a rich:select which is inside o a4j:repeat

I am using a a4j:repeat control to iterate throughtout a Map<Object, List<MyType>> list. The XHTML page displays both h:outputText and rich:select controls.
I loop throughout a Map<String, List<Items>> instance, to show a master-detail tables. In the h:outputText I show the master description and the rich:select shows the detail.
The code is as follows:
customer.xhtml
<a4j:repeat value="#{masterManagedBean.listMasterItems.entrySet().toArray()}"
var="itemsVar">
<h:outputText value="#{itemsVar.key}" />
<rich:select enableManualInput="true">
<f:selectItems value="#{itemsVar.value}" id="itemsMenu"
var="itemsVarSelect"
itemLabel="#{itemsVarSelect.descriptionItems}"
itemValue="#{itemsVarSelect.idItems}" />
</rich:select>
</a4j:repeat>
This snippet works perfect. But, I don't have any idea how to gain the selected value from every rich:select generated by the repeater. Please guidance me to solve this issue.
Basically I would suggest not to use the datastructure Map<String,List> for the described case. Why not changing the Structure into a normal List of objects (List<SelectionObject>) with the SelectionObject-class holding:
name/label
possible values (as List or Array)
selected value
So the JSF code would look something like
<a4j:repeat value="#{masterManagedBean.listMasterItems}"
var="itemsVar">
<h:outputText value="#{itemsVar.label}" />
<rich:select enableManualInput="true" value="#{itemsVar.selectedValue}">
<f:selectItems value="#{itemsVar.possibleValues}" id="itemsMenu"
var="itemsVarSelect"
itemLabel="#{itemsVarSelect.descriptionItems}"
itemValue="#{itemsVarSelect.idItems}" />
</rich:select>
</a4j:repeat>
Any preparations/building for this object structure can be done e.g. in getListMasterItems (use some caching), the retrieval of the users data is done in the action of your submit-button, anyway. Just iterate through the list and read out the `selectedValue. If the answer is usable/helpful, please consider an upvote, confirm if it worked out for you.
Hope it helps...

Jaspersoft iReport Designer Stretch With Overflow not working if field is a group

Using 4.5.0 for numerous reports, each using the same datafield SVC_METH_NM. Have no problem word wrapping (using Stretch With Overflow) the datafield SVC_METH_NM unless the field is a group. When the field is a Group, the data is truncated instead of wrapped. If I set the Evaluation Time to Now, which blanks out the Evaluation group, it wraps correctly (but the report doesn't display properly). I tried removing the fields in the line immediately below, and have tried playing with the Position Type and Stretch Type options, to no avail.
<group name="ServiceMethodName">
<groupExpression><![CDATA[$F{SVC_METH_NM}]]></groupExpression>
<groupHeader>
<band height="20">
<textField isStretchWithOverflow="true" evaluationTime="Group" evaluationGroup="ServiceMethodName">
<reportElement x="23" y="0" width="180" height="20" printWhenGroupChanges="ServiceMethodName"/>
<textElement>
<font isBold="true" isItalic="false"/></textElement>
<textFieldExpression><![CDATA[$F{SVC_METH_NM}]]></textFieldExpression>
</textField>
Has anyone else run into this?
I am dealing with this issue right now. Did you find a solution? I was hoping to avoid it, but think I'll have to try and solve the problem using subreport(s). Fairly certain I can display the text appropriately that way, but feel like I shouldn't have to overcomplicate things with subreports.
Edit: TESTED SOLUTION - Put a subreport in your group header. Query for the subreport should be "select * from dual" since you will actually be passing all data in from the master report. Pass the field(s) to the subreport as parameters, and display them exactly as you would in the group header, but do it in the detail band. iReport will handle the wrapping of the text since it's in the detail band. Make sure Print When Detail Overflows is set on the subreport, and Stretch With Overflow is set on your subreport field.

Oracle ADF: LOV not working on create

I have a ViewObject (VO1) with a ListOfValue that points to a ViewObject (VO2), and fetches records from VO2. There is no ViewCriteria added on VO2.
When testing in the BC tester, the LOV works fine. Both on editing a row in VO1, and when creating a row in VO1.
Using the LOV in a jspx page, the LOV works fine when editing a row in VO1. But when I'm creating a new row in the jspx page, the LOV doesn't fetch any records. Just an empty list.
I can't figure out what is wrong, or why it doesn't work. I have created several LOV all working like a charm, but this one is making me tear my hair out.
Anyone else experienced a similar scenario where a LOV only works upon editing a row?
Any ideas what can be wrong?
The SOC on the jspx page:
<af:selectOneChoice value="#{row.bindings.IdSosBasGrantType.inputValue}"
label="#{row.bindings.IdSosBasGrantType.label}"
required="#{bindings.SosBasCaseGrantPerCaseType.hints.IdSosBasGrantType.mandatory}"
shortDesc="#{bindings.SosBasCaseGrantPerCaseType.hints.IdSosBasGrantType.tooltip}"
id="soc12" autoSubmit="true">
<f:selectItems value="#{row.bindings.IdSosBasGrantType.items}" id="si11"/>
</af:selectOneChoice>
The iterator binding:
<tree IterBinding="SosBasCaseGrantPerCaseTypeIterator" id="SosBasCaseGrantPerCaseType">
<nodeDefinition DefName="fo.att.alm.sos.model.bas.views.SosBasCaseGrantVO" Name="SosBasCaseGrantPerCaseType0">
<AttrNames>
<Item Value="Seq"/>
<Item Value="IdSosBasGrantType"/>
<Item Value="IdSosBasGrantVariant"/>
<Item Value="RuleType"/>
<Item Value="Status"/>
<Item Value="IdAplCfgPartyType"/>
</AttrNames>
</nodeDefinition>
</tree>
The ViewAttribute:
<ViewAttribute
Name="IdSosBasGrantType"
LOVName="LOV_IdSosBasGrantType"
IsUnique="true"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="IdSosBasGrantType"
EntityUsage="SosBasCaseGrantEO"
AliasName="ID_SOS_BAS_GRANT_TYPE">
<Properties>
<SchemaBasedProperties>
<CONTROLTYPE
Value="choice"/>
</SchemaBasedProperties>
</Properties>
</ViewAttribute>
The ListBinding:
<ListBinding
Name="LOV_IdSosBasGrantType"
ListVOName="SosBasGrantTypeUsgLOV"
ListRangeSize="-1"
NullValueFlag="none"
NullValueId="LOV_IdSosBasGrantType_LOVUIHints_NullValueId"
MRUCount="0">
<AttrArray Name="AttrNames">
<Item Value="IdSosBasGrantType"/>
</AttrArray>
<AttrArray Name="ListAttrNames">
<Item Value="GrantTypeId"/>
</AttrArray>
<AttrArray Name="ListDisplayAttrNames">
<Item Value="ObjectTypeDisplayName"/>
</AttrArray>
<DisplayCriteria/>
</ListBinding>
The ViewAccessor
<ViewAccessor
Name="SosBasGrantTypeUsgLOV"
ViewObjectName="fo.att.alm.sos.model.bas.views.SosBasGrantTypeUsgRO"
RowLevelBinds="true"/>
Hard to guess without knowing more about the code.
But if you have a situation where on creating a new record the LOV shows up empty, maybe you have a viewlink defined between the two VOs.
You need to make sure that the LOV data comes from an independent VO2 that is not a detail of VO1.
I guess that
1- Lov view object VO2 has view link defined between two View Objects
2- Lov view object VO2 has parameter in its sql statement to filter data which gets its value from current view object VO1 and the parameter is null so it will not return data
Try turning on the ADF BC debugging and see what is the query that the LOV sends to the DB when you invoke it from the page.
edit your project properties and in the Run/Debug page, select a run configuration and click Edit. Then add the string -Djbo.debugoutput=console to the Java Options field.
http://docs.oracle.com/cd/E16162_01/web.1112/e16182/web_testdebug.htm#BABDBCGF

How can I control the subreport layout?

My business analysts have created 7 reports (using Report Builder) they want merged into a MEGA-report. I've been trying to do this by wrapping them all in subreports (which you can't use in Report Builder 1.0). While all reports show up, the layouts are all over the place. The subreports seem to reorder themselves.
I've dropped down to only using two reports to try to isolate the error. When this runs, subreport2 shows up above subreport1.
What changes do I need to make to my report, (or the child reports) to get them to display in order?
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="schema">
<InteractiveHeight>11in</InteractiveHeight>
<rd:DrawGrid>true</rd:DrawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rd:SnapToGrid>true</rd:SnapToGrid>
<RightMargin>1in</RightMargin>
<LeftMargin>1in</LeftMargin>
<BottomMargin>1in</BottomMargin>
<rd:ReportID>480f6105-cb4d-4969-b530-81ab5a5e3fb8</rd:ReportID>
<Width>8.5in</Width>
<Body>
<ReportItems>
<Subreport Name="subreport1">
<ReportName>Report1</ReportName>
</Subreport>
<Subreport Name="subreport2">
<ReportName>Report2</ReportName>
</Subreport>
</ReportItems>
<Height>0.5in</Height>
</Body>
<Language>en-US</Language>
<TopMargin>1in</TopMargin>
</Report>
Add a Table
Place each subreport in its own table cell
Organize cells for desired layout

Resources