Sum datagrid column values
I am looking for a way (action script code?) to sum datagrid
column values.
I am using Flex2 with Cold Fusion MX7.
I populate a DataGrid by setting dataprovider to the result
of a Coldfusion query.
(this.masterList.dataProvider = event.result as
ArrayCollection;)
This all works fine.
The masterList datagrid has debit, credit, and unitcost
columns. I want to sum those columns individually, and display the
results in text boxes in another panel.
I could run a Coldfusion query to return the sums, but would
like to do it on the client side with action script.
I want to sum them everytime I update the datagrid, so need
action code that I can put in the result function.
I am new to ActionScript, and not sure how to loop through
the array collection(and/or) dataprovider and sum the items.
Any help would be appreciated.
Thanks.
Loop through your array..if the arrayCollection was named
myArray;
private sumFunction():Number{
var sum:Number=0;
for(var i:uint=0;i<myArray.lenght;i++){
sum+=myArray
.debitValue;
return sum;
Similar Messages
-
How to sum a column value using CAML Query?
Hi All,
I would like to sum the column value using CAML qeury. Actually in my list, I have two column "Projects Name" and "Number of Issues". Now need to get sum of "Number of Issues" column. How to achieve in CAML Query.
Thanks in advance!Hi Sam,
it looks like you can use your current view based agregation, otherwise it is not possible(
http://msdn.microsoft.com/en-us/library/ms467521.aspx) and you need to work on custom bit on this requirement.
use the below link and create a view element as described and see if that works for you
Aggregations Element
http://msdn.microsoft.com/en-us/library/ms468626%28v=office.12%29.aspx
Another reference
Query Element
http://msdn.microsoft.com/en-us/library/ms471093.aspx
Hope this helps!
Ram - SharePoint Architect
Blog - SharePointDeveloper.in
Please vote or mark your question answered, if my reply helps you -
hello every one.
this is IBRAN, i am using datagrid in my flex application now i want to add only one column data and i want to display it in textinput,
please help me i am trying this from last 7 days please please help me,
this is my datagrid that how i defined-
<mx:DataGrid id="neworderdetails" width="839" height="400" editable="true" visible="false" itemClick="editablefunc(event)" variableRowHeight="true"
draggableColumns="false" sortableColumns="false" >
<mx:columns>
<mx:DataGridColumn headerText="Product Barcode" dataField="ABarcode"/>
<mx:DataGridColumn headerText="Product Description" dataField="BDescription"/>
<mx:DataGridColumn headerText="Ordering Quantity" dataField="COrderingQty"/>
<mx:DataGridColumn headerText="Max Quantity" dataField="DMaxQty"/>
<mx:DataGridColumn headerText="Current Quantity" dataField="ECurrentQty"/>
<mx:DataGridColumn headerText="Cost" dataField="FCost"/>
<mx:DataGridColumn headerText="MRP" dataField="GMrp"/>
<mx:DataGridColumn headerText="Total Discount" dataField="HDiscount"/>
<mx:DataGridColumn headerText="VAT" dataField="IVat"/>
<mx:DataGridColumn headerText="Amount" dataField="GAmount" labelFunction="{Amount}"/>
</mx:columns>
</mx:DataGrid>
and one more thing, I am using labelFunction Amount i am calculating amount by multiplying two columns of datagrid this is working fine
now i want to add the only Amount column values one by one and i want to display result as total amount in one textInput.
please please help me for this problem.
thank you.Hey
to get the multiple selected row use the property datagrid.selectedindices this will return a string with all the selected index with (,) separated .
then get the data of selcted index and put it in to database.
regards.
gajanan hiroji | [email protected] | www.isacglobal.com -
Hi,
Is there a way to sum | total a column of numeric values in a
cfgrid? I want to populate a cfinput text box with the number, and
bind it so that as changes to numbers occur on the grid, the
cfinput box changes.
I've been able to do this by creating a function that goes
and extracts the information via a database query. Running the
query seems to add overhead to the screen response time.
The variable could start as a value passed from a query. Say
2000. When a field changes, it would take the original value,
subtract out the original "row" value, then add in the new "row"
value. Say a 2 is being replaced by a 3. Then you'd have 2000-2+3 =
2001 which becomes the new "original" total value.
Any thoughts would be appreciated.
cfwildHi Dan,
Thanks for the feedback. The grid really works well for what
I'm trying to do. I can filter the pages and make minor changes to
the data quite quickly. When I add in the extra function (to sum
the column) that goes out to the table to extract the data, it
seems to take a performance hit on the "page".
In looking at the code I've seen, it seems easy(?) to get to
the new value of the column. Is there a decent way to get to the
"old" value of the column, prior to an update? (or as you update)?
cfwild -
How do I iterate over each row and then the columns of the
datagrid?
I populate the datagrid columns through an actionscript
function (on click of a button and using datagrid.addItem()
method). So my dataprovider is not an arraycollection or from xml
or whatever.DataGrid does not have an "addItem()" method.
Are you using Flex 1.5?
Show us the code where you are doing this.
Tracy -
Changing a datagrid column image according to the datagrid column value
Flash Builder 4.5 / SDK 4.5.1.
Fairly new to Flash Builder & Flex
Application targets tablets so it's a "mobile" project.
Been beating my head up against the wall on trying to figure out how to do this. Watched videos on Lynda.com. Read Adobe "docs" till my eyes glaze over. Takes me about 2 lines of code in my corresponding .NET project doing the same thing.....
Tried numerous examples. Inline rendering, external rendering files per the examples.
I have a response field in the database and corresponding column in the s:datagrid. If the "reportInfoResponse" field is null (not answered), show an image with a question mark. If yes show an image with "Yes" on it. Same for a no answer.
I get errors of:
1120:Access of undefined property negativeAnswer.
1120:Access of undefined property affirmativeAnswer
1120:Access of undefined property reportInfoResponse
1120:Access of undefined property showResponseImage
If I put this in an external rendering file I also get an error where it can't access the datafield (reportInfoResponse). I've tried data.reportInfoResponse, {data.reportInfoResponse}, {reportInfoResponse} and just plain reportInfoResponse the external rendering file with no luck. I've tried single and double quotes around Y and N. According to all the examples (not to say there aren't more!), I should be able to reference data.reportInfoResponse in the external file and things should be fine. Of course, the examples are bare bones code and I don't have a clue if any importing of classes or other items need to take place. I never see any references of such. The examples also show the image embedding and changing the image by using imageID.source=... In my code it tells me it can't find it.
I have put (ERROR HERE...) on the lines where I'm getting the error messages. I've eliminated a lot of database scripting and such cause that's all working.
Any and all suggestions would be appreciated as I'm pulling out what little hair I have left.......and that's not much at my age........ And yes, I probably could do it by just show text in the column, but that's not what the customer wants... There are other columns I need to do this for so I figure if I can get 1 done and working, the rest are a snap. I CAN use inline or external rendering to show an image. It's the changing it that is the catch.........
Thanks in advance!
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="onCreationComplete()"
title="{whichCategoryName} > {whichSubCatName} > Questions">
<fx:Script>
<![CDATA[
import com.adobe.serializers.utility.TypeUtility;
import flash.data.SQLConnection;
import flash.data.SQLMode;
import flash.data.SQLResult;
import flash.events.StatusEvent;
import flash.filesystem.File;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.navigateToURL;
import flashx.textLayout.tlf_internal;
import mx.collections.ArrayCollection;
import mx.core.BitmapAsset;
import mx.events.FlexEvent;
import spark.events.GridEvent;
import spark.events.IndexChangeEvent;
...(lots of database coding left out here)
<s:DataGrid id="showQuestions" width="100%" height="100%"
creationComplete="Grid_creationCompleteHandler(event)" fontFamily="_sans"
gridClick="gridClickEvent(event);" horizontalScrollPolicy="off"
selectionColor="#8AD8EF" selectionMode="singleRow" sortableColumns="false"
variableRowHeight="true" verticalCenter="middle">
<s:columns>
<s:ArrayList>
<s:GridColumn visible="false" dataField="id_report" headerText="id_report" resizable="true" sortable="false"></s:GridColumn>
<s:GridColumn visible="false" dataField="id_question" headerText="id_question" resizable="true" sortable="false"></s:GridColumn>
<s:GridColumn id="col_reponse" visible="true" dataField="reportInfoResponse" headerText="Response" resizable="true" sortable="false">
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer>
<fx:Script>
<![CDATA[
[Embed(source="assets/unknown.png")]
[Bindable]
public var unknownAnswer:Class;
[Embed(source="assets/yes.png")]
[Bindable]
public var affirmativeAnswer:Class;
[Embed(source="assets/no.png")]
[Bindable]
public var negativeAnswer:Class;
(ERROR HERE - 1120:Access of undefined property reportInfoResponse)
if(reportInfoResponse == "Y")
(ERROR HERE - 1120:Access of undefined property showResponseImage)
showResponseImage.source = affirmativeAnswer;
(ERROR HERE - 1120:Access of undefined property reportInfoResponse)
if (reportInfoResponse == "N")
(ERROR HERE - 1120:Access of undefined property showResponseImage)
showResponseImage.source = negativeAnswer;
]]>
</fx:Script>
<s:Image id="showResponseImage" source="{unknownAnswer}" verticalCenter="0" horizontalCenter="0"/>
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:GridColumn>
<s:GridColumn id="col_question" visible="true" dataField="question" headerText="Question" resizable="true" sortable="false"></s:GridColumn>
</s:ArrayList>
</s:columns>
<s:AsyncListView list="{showTheseQuestions}"/>
</s:DataGrid>
</s:View>Ioan Thanks for the reply.
Probably my previous explanation of the problem was a little incomplete. Let me give a better description.
The situation is something like this.
I have a requirement in which the customer wants the column header to reflect the 'keep filter value' restriction that he does dynamically in the query report.
i.e:
-- usually the kf column header shows 'sales volume'
-- column header with text variable of the Calender year / month variable -- 'sales volume for 2000 oct'
-- but when the report is run, if the user wants to go and change the filter: calender year / month > rt clk > keep filer value > select Jan 2003.
The kf column header still shows 'Sales Volume 2000 Oct'
How to make the column header change to 'sales volume for Jan 2003' ?
Any suggestions greatly appreciated.
Thanks, -
ADF Table: sum of column value
Hi Experts,
I have a editable table which is having "Quantity of Volume" column.When user ll input the value in to this,Then the lower panel should show the sum of Volume. How I ll do this? Below is my table src code:
<af:table value="#{bindings.NominatedAllocationType2.collectionModel}"
var="row" rows="#{bindings.NominatedAllocationType2.rangeSize}"
emptyText="#{bindings.NominatedAllocationType2.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.NominatedAllocationType2.rangeSize}"
rowBandingInterval="0" id="t2">
<af:column sortProperty="TheQuantityOfVolume" sortable="false"
headerText="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.label}"
id="c6">
<af:inputText value="#{row.Volume.bindings.TheQuantityOfVolume.inputValue}"
label="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.label}"
required="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.mandatory}"
columns="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.displayWidth}"
maximumLength="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.precision}"
shortDesc="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.tooltip}"
id="it1">
<f:validator binding="#{row.Volume.bindings.TheQuantityOfVolume.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.format}"/>
</af:inputText>
</af:column>
</af:table>
Thanx
AswiniHi.
Check
Calculate Sum in VO issue again
http://technology.amis.nl/blog/1295/creating-a-dynamic-ajax-column-footer-summary-in-a-table-component-using-adf-faces -
Hi
My question is - i would like to do sum of 'volume' column
Current Output
ENVIRONMENT Volume
Production 79
QA 66
Development 30
Desired Output
ENVIRONMENT Volume
Production 79
QA 66
Development 30
*Total 175*
select * from (
select ci.environment, count(1) "Volume"
from tsgdw_task@awhsncp1 t,
tsgdw_operational_process@awhsncp1 op,
tsgdw_support_group@awhsncp1 sg,
tsgdw_person@awhsncp1 p,
tsgdw_configuration_item@awhsncp1 ci
where sg.SUPPORT_GROUP_SEQ_ID in (SELECT sg2.SUPPORT_GROUP_SEQ_ID FROM tsgdw_support_group@awhsncp1 sg2
start with sg2.SEARCH_CODE = 'DBNONEC' --p_target_name
connect by prior sg2.SUPPORT_GROUP_SEQ_ID=sg2. PARENT_SUPPORT_GROUP_SEQ_ID)
and t.task_seq_id = op.task_seq_id
and sg.support_group_seq_id = op.support_group_seq_id
and op.assigned_person_seq_id = p.person_seq_id
and op.open_CONFIG_ITEM_SEQ_ID = ci.CONFIGURATION_ITEM_SEQ_ID
and t.task_type = 'Change Task'
and t.state = 'Closed'
--and sg.search_code = p_target_name
and ci.environment in ('Production','Development','Staging','QA')
and OP.EST_ACTUAL_END_DATETIME between to_date('01-Apr-2012,00:00:00','DD-Mon-YYYY,HH24:MI:SS') and to_date('08-Apr-2012,23:59:59','DD-Mon-YYYY,HH24:MI:SS')
--and t.LAST_UPDATE_DATE between ??EMIP_BIND_START_DATE?? and ??EMIP_BIND_END_DATE??
group by ci.environment
order by 2 desc)
where rownum < 6;user546629 wrote:
Hi Vivek,
How can I name the column name heading as "Environment" or "Category"
NVL(CI.ENVIRONMENT,'TOTAL') Volume
Development 37
QA 100
Production 149
Total 286
RegardsUse Column Alias the same way you have done for count(1):
select nvl(ci.environment,'Total') "Environment" , count(1) "Volume" http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_10002.htm#i2080424 -
How to get sum of highlighted column values.
Is there currently any functionality that allows you to highlight a certain number of column values in the returned result set and to see the sum of the values highlighted.
Hi,
Not directly, sorry.
You could always try highlighting the desired cells, copy/paste them into a column in a spreadsheet like MS Excel or Open Office Calc, then add a sum function into a nearby open cell. The spreadsheet can be added to SQL Developer's Tools|External Tools menu for convenience.
Regards,
Gary Graham
SQL Developer Team -
If myText.text == any value in a datagrid column
Hey guys, in a simple form, I am trying to achieve what's in my title.
I have a text box in which you type in a value (number).
I have a submit button which inserts the value into my data-grid which is populated by a data provider to display that information (ZendAMF).
For my submit button function I need it to loop through all the values(rows) in a column (my dataprovider) of my data-grid to check if my text box value is equal to any of the data in the rows for that column.
I found a function on another forum that should help me achieve this but I still cannot get it to work as I don't think I'm using the function correctly. Note the function is called "findItem()"
Here is my example code:
//I have a datagrid
<mx:DataGrid id="myDataGrid" dataProvider="amfcall.getData.lastResult}">
<mx:columns>
<mx:DataGridColumn headerText="MyHeading" dataField="myDataField"/>
</mx:columns>
</mx:DataGrid>
//I have a form for adding data into the datagrid
<mx:Form id="addData">
<mx:FormItem>
<mx:TextInput id="myText"/>
</mx:FormItem>
</mx:Form>
//I have a button to submit the form data by calling a function
<mx:Button label="Add" id="addData" click="findItem()"/>
//I have the function to find any item in the datagrid column that is equal to the text input in the form. This is what I can't code correctly.
public function findItem(myDataGrid.dataProvider, myDataField:String, myText.text):Boolean
for each(var item:Object in myDataGrid.dataProvider)
if(item[myDataField] == myText.text)
return true;
return false;
So I don't think I'm correctly typing the first line of the 'findItem' function as I'm currently receiving [I]1084: Syntax error: expecting rightparen before dot.[/I] for this line [I]public function findItem(myDataGrid.dataProvider, myDataField:String, myText.text):Boolean [/I]
Also, the error does not change if I strict type those things to ':Object' etc.
I may just be using the function totally wrong, can anyone hlpe me out?Hard to tell what’s going on from the information you are providing; but just looking at the first line of your sample code:
Have you checked in the debugger to see what your dataProvider looks like?
You want a resultHandler to set some kind of list – let’s say a previously declared AC, which then becomes your dataProvider for the DataGrid. Something like:
private function amfCallResultHandler(event:ResultEvent):void{
Var someVar:ArrayCollection = event.result as ArrayCollection;
blah blah blah;
myDataProvider = someVar;
HTH,
Carlos -
Regarding alv function of summing up the values of columns.
hi friends:
could you please tell me how to sum up the values of columns.
for example, there are columns of room rent, expense of cell phone call,
expense of taxi fee.
thank you very muchhi For calculating one more coloum . try this logic
write this piece of code in wddoinit
data : lt_column type salv_wd_t_column_ref,
ls_column type salv_wd_s_column_ref,
lo_aggr_rule TYPE REF TO cl_salv_wd_aggr_rule.
* display columns in correct order
lr_column_settings ?= wd_this->lr_config.
lt_column = lr_column_settings->get_columns( ).
loop at lt_column into ls_column.
case ls_column-id.
when 'ROOM_RENT'.
* aggregate field
call method lr_config->if_salv_wd_field_settings~get_field
exporting
fieldname = 'ROOM_RENT'
receiving
value = lr_room_rent_total.
* create aggregate rule as total
call method lr_field_amnt->if_salv_wd_aggr~create_aggr_rule
exporting
aggregation_type = if_salv_wd_c_aggregation=>aggrtype_total
receiving
value = lv_aggr_rule.
when 'CALL'.
* aggregate field
call method lr_config->if_salv_wd_field_settings~get_field
exporting
fieldname = 'CALL'
receiving
value = lr_call_AVG.
* create aggregate rule as total
call method lr_field_amnt->if_salv_wd_aggr~create_aggr_rule
exporting
aggregation_type = if_salv_wd_c_aggregation=>AGGRTYPE_AVERAGE
receiving
value = lv_aggr_rule.
endcase.
endloop.
Regards
Chinnaiya -
APEX Interactive Report - sum multiple columns table1 X with table2 value
I have a challenge in oracle apex, were i want to sum multiple columns to give 3 extra rows namely points, Score, %score. There are more columns but chose only few for now.
Below is an example structure of my data:
Town | Sector | Outside| Inside |Available|Price
Roy-----Formal----0----------0----------1------0
Kobus Formal--0 ---------0--------- 1------0
Wika ---Formal----0----------0--------- 1------0
Mevo----Formal----1----------1---------1------0
Hoch----Formal----1----------1---------1-------1
Points--------------2----------2----------5-------1
Score-------------10---------10---------10------10
%score-----------20---------20---------50------10
Each column has a constant weighting (which serves as a factor and it can change depending on the areas) in this case the weighting for this areas are the ones in the first row for the sector Formal:
Sector |Outside| Inside |Available|Price
Formal----1----------1 ----------1-----1
Informal--1----------0 ----------2-----1
I tried using the aggregate sum function in apex but it wont work since i need the factor in the other table. Which is where my challenge started
To compute the rows below the report:
points = sum per column * weighting factor per column
Score = sum of no of shops visited (in this case its 5) * weighting factor per column
% score = points/Score * 100
The report should display as described above. With the new computed rows below.
I kindly ask anyone to assist me with this challenge as i tried searchin on the internet for solutions but havent come across any.
Thanks a lot for your support in advance!!>
Please update your forum profile with a real handle instead of "823433".
I have a challenge in oracle apex, were i want to sum multiple columns to give 3 extra rows namely points, Score, %score. There are more columns but chose only few for now.
Below is an example structure of my data: Use <tt>\...\</tt> tags as described in the FAQ when posting code and sample data and layouts. Please edit the OP and reformat the example using <tt>\...\</tt> tags so it's clear.
Town | Sector | Outside| Inside |Available|Price
Roy-----Formal----0----------0----------1------0
Kobus --Formal----0 ---------0--------- 1------0
Wika ---Formal----0----------0--------- 1------0
Mevo----Formal----1----------1---------1------0
Hoch----Formal----1----------1---------1-------1
Points--------------2----------2----------5-------1
Score-------------10---------10---------10------10
%score-----------20---------20---------50------10Each column has a constant weighting (which serves as a factor and it can change depending on the areas) in this case the weighting for this areas are the ones in the first row for the sector Formal:
Sector |Outside| Inside |Available|Price
Formal----1----------1 ----------1-----1
Informal--1----------0 ----------2-----1I tried using the aggregate sum function in apex but it wont work since i need the factor in the other table. Which is where my challenge started
To compute the rows below the report:
points = sum per column * weighting factor per column
Score = sum of no of shops visited (in this case its 5) * weighting factor per column
% score = points/Score * 100
The report should display as described above. With the new computed rows below.
I kindly ask anyone to assist me with this challenge as i tried searchin on the internet for solutions but havent come across any.How critical to the solution is using an interactive report? It would be much easier to do this in a standard report where you've complete control over the query SQL and the report structure.
When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand. -
DataGrid column width is not set properly
Hi,
In the below example I has called the OptimizeDataGrid method on Button Click event to resize the Column according to the data. First time of the button click event it called the function whereas the Datagrid Column width alone is not set properly.whereas on second time it is working properly.
For Eg : In the below statement the text value is coming as 55 and widthPadding is comes as 25. but the sum of these two value is not in the dg.columns[col].width.
dg.columns[col].width = text + widthPadding;
But the same is working on the second time of the Button click event. is any help me out to resovle this issue. Thanks in Advance.
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
width="100%" height="100%" >
<mx:Script>
<![CDATA[
import mx.utils.ObjectUtil;
import mx.collections.ArrayCollection;
import mx.core.UITextField;
import mx.events.AdvancedDataGridEvent;
import mx.binding.utils.BindingUtils;
import mx.controls.Alert;
import mx.controls.AdvancedDataGrid;
import mx.controls.advancedDataGridClasses.*;
import mx.controls.DataGrid;
import mx.controls.dataGridClasses.*;
[Bindable]
private var dpFlat:ArrayCollection = new ArrayCollection([
{Region:"aabbCC", Territory:"Central Californiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000},
{Region:"AAbbcc", Territory:"Nevada",
Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000}
private function optimizeDataGrid(dg:Object,widthPadding:uint = 0,heightPadding:uint = 0):void
if ((!dg is DataGrid))
return;
var col:uint;
var colWidth:uint;
var tf:TextFormat;
var renderer:UITextField;
var widths:Array = new Array(dg.columnCount);
var height:uint = 0;
var dgCol:Object;
var text:uint = 0;
if (dg.columnCount > 0 && dg.dataProvider != null)
for (col = 0; col < dg.columnCount; ++col)
widths[col] = 0;
for each (var item:Object in dg.dataProvider)
for (col = 0; col < dg.columnCount; ++col)
renderer = new DataGridItemRenderer();
dg.addChild(renderer);
dgCol = dg.columns[col];
renderer.text = dgCol.itemToLabel(item);
widths[col] = Math.max(renderer.measuredWidth, widths[col]);
height = Math.max(renderer.measuredHeight, height);
dg.removeChild(renderer);
for (col = 0; col < dg.columnCount; ++col)
dg.addChild(renderer);
renderer.text = dg.columns[col].headerText;
widths[col] = Math.max(renderer.measuredWidth,widths[col]);
dg.removeChild(renderer);
text = widths[col];
dg.columns[col].width = text + widthPadding;
if (height != 0)
dg.rowHeight = height + heightPadding;
]]>
</mx:Script>
<mx:DataGrid id="myADG"
dataProvider="{dpFlat}" rowCount="{dpFlat.length}" sortableColumns="false">
<mx:columns>
<mx:DataGridColumn dataField="Region" />
<mx:DataGridColumn dataField="Territory_Rep" headerText="Territory Rep" />
<mx:DataGridColumn dataField="Territory" />
<mx:DataGridColumn dataField="Actual" />
<mx:DataGridColumn dataField="Estimate" />
</mx:columns>
</mx:DataGrid>
<mx:Button label="click" id="click" click="optimizeDataGrid(myADG,25,5);"/>
</mx:Application>
Regards
HarikumarWith horizontalScrollPolicy="off" (the default), it is hard to control
column widths because the columns are sometimes overridden to make sure they
fit on the screen. -
SSRS - Expression to color column value dynamically in Matrix
Hi ,
I have a matrix which looks like :
The <<Expr>> value can be 1 /0 /"-" .
The Expr value is being calculated dynamically.
The data set query I am using has a column called due_days.
In the color expression of the <<Exp>> box I am using the expression as :
=IIf(Fields!Due_Days.Value>14 and Fields!Notes_Count.Value>0,"Blue",(Iif(Sum(Fields!Notes_Count.Value)=0 ,"Red","Black")))
My requirement is if the Due_Days column value is >14 then I need to highlight the value as blue else black and if value is 0 then red. When I use the above query it is just highlighting the color blue for 1st column only. Eg: 4th row . Due days for month
of Oct and Nov is > 14 but it shows blue only for month of oct.
How can i resolve the issue?In select query i have 5 columns:
Due days(Which is difference between 2 dates) ,
Notes count (Which is just a count of notes entered or not having value 0/1 and value '-' if another column CRD is greater than the matrix month and year.)Eg: below date 11/12/2014 is greater than Oct 2014 hence Oct 2014 should have "-"
Month Name , Year , Month Nbr (last 6 months which I cross joined with the table to get counts for each month)
The matrix has year and last 6 month as column groups
Color coding should be if notes count is 0 then red ,if notes count is 1 and due_days> 14 then blue else black . When i try to use expression for color as i mentioned above, it colors only 1st colum.eg: 2nd row
Nov 2014 is blue but for jan 2014 also it should show blue as due days>14 .
Is there any way i can do that ??
Eg: data set returns value as :
Due Days CRD Month
Month_Nbr Year Notes _Count
5 2014-11-28 00:00:00.000 December 12 2014
0
5 2014-11-28 00:00:00.000 February 2 2015
0
5 2014-11-28 00:00:00.000 January 1 2015
0
5 2014-11-28 00:00:00.000 November 11 2014 1
5 2014-11-28 00:00:00.000 October 10 2014 0
5 2014-11-28 00:00:00.000 September 9 2014 0
Matrix is of the form :
YEAR
MONTH
CRD Notes_count -
How to Suppress Report Total When Using Sum on Columns & Break Formatting
I need to know how to NOT show the report total line when using the sum functionality with a break in a report.
I am summing two columns, a debit amount and credit amount. I am breaking on the first column which is the level of a hierarchical query. I want to see something like this:
Parent Record xxxxxxxxxxxxxx
Parent Sum $$ $$
Child Record xxxxxxxxxxxxxx
Child Record xxxxxxxxxxxxxx
Child Sum $$ $$
However, when I run the report, I also get a report total line under the child sum which is really meaningless for this report.
I have also tried creating this report as an interactive report. When applying the sum on the two columns, I do get the sum totals on the break only - no report total - however, it is reversing the order of the hierarchical query results putting the child records first and the parent records second.
Thanks in advance for your help.Hi, and welcome!
I don't think that there's an easy way to "switch off" the Total line on a report. The nearest I could suggest would be to either hide the entire row or colour the text so that it's the same as the background - either way, the total is calculated but the user won't see it.
If you put something like the following into your report region's Region Footer:
<script type="text/javascript">
var outertable = document.getElementById("#REGION_ID#");
var innertable = outertable.getElementsByTagName("TABLE")[1];
var rs = innertable.rows;
var lastrow = rs[rs.length-1];
if (lastrow.cells[0].innerHTML == '<b>TOTAL</b>')
rs[rs.length - 1].style.display = "none";
</script>Then, on your report's Report Attributes page, scroll down to the Break Formatting section and put TOTAL into the "Display this text when printing report sums" setting. Also, in the "Layout and Pagination" section, set "Enable Partial Page Refresh" to No.
The above code is based on the report and region templates that I'm using here: [http://apex.oracle.com/pls/otn/f?p=267:147] (Theme 18, "Report Region" region template and "Standard" report template). Your report may use different templates, so the first two lines on the code may have to change. #REGION_ID# would be replaced with the region's ID value (which would be "R" followed by a long number). As long as you can identify the HTML tag that uses this ID value, you can then get to the actual table that contains the data as it would be a TABLE within that tag - the [1] above is the second table within the region. In some instances, you may have to use "region_#REGION_ID#" as the starting point.
Andy
Maybe you are looking for
-
i cant download any apps on my i pad because the apple i.d i created has a didgit missing how do i resolve this??
-
Website doesn't display correctly, some areas cut off
All pages of my website cut off some text at the top and bottom. This does not happen with any other web pages I browse! The site was created by our developer and based on a Themeforest theme (from Envato) called Franklin Crowdfunding. Interestingly,
-
[SOLVED] Wrong scancodes for Ctrl, Super and Alt on keyboard
I have bought this keyboard and I'm having an issue with it that I can't figure out. Under Archlinux, the Control, Super and Alt key are interpreted as the Shift key. I have tested it on a tablet running Android and its behavior is identical however
-
How do i get an internet server on apple tv?
hi i just bought Apple TV and when i was at the store and being shown how it works there was a Safari icon on the Apple TV page on the television. When i get home and try to set it up with my computer and i phone i notice there is no icon for me to r
-
Change the default entity in the lookup window in PhoneCall Form
Hello, I'm trying to write a javascript to change the default entity in the lookup window for the 'from' field to use the Contact entity. Right now Account is the default entity. So this is what I have: document.getElementById("from").setAttribute("d