Adding a spesific data item to a Data Grid - Flex 4 - actionscript-3

I better explan what i mean:
I have a Data Grid with automacticly genorated columns, i now need to add data items into
a spesific row / column of this grid e.g. col 2 row 3. It dosnt have a data provider at the moment as i wish to be very selective about which data goes where.
Which is the best way to do this?

I don't think it's possible to use a Datagrid without any dataProvider.
If you wan't to now where your data goes you could use an ArrayCollection with objects.
These objects can have multiple attributes like "column1", "column2" and so on.
So you can do something like this:
var obj:MyObject = new MyObject();
obj.column2 = "foo";
myDataGrid.dataProvider.addItemAt(obj,3);
Now you have placed "foo" in column2 of row 3.
But this isn't really beautiful, maybe you can achieve what you want without abusing the DataGrid.

Related

SSRS - Return to the line with column group

I've got a problem about SSRS design.
I need to make a report to display a list of item size.
I need to have 1 line per item with all the size of this item (and the quantity) on the same line
SSRS Design
The "Row group" have a grouping on the "Item No" field.
Actual result
Expected result
How can you put line 2 back to the beginning?
Thanks everyone for your help !
Data :
Item No
Size
Qty
1896-S
T32
4
1896-S
T34
3
1906-S
T32
2
1906-S
T34
4
1906-S
T36
5
You can do this easily with a matrix control.
Drop a Matrix control onto your report and then drag Item_No to the 'Rows' placeholder, Size to the 'Columns' placeholder and Qty to the 'Data' placeholder.
this will will give you a basic matrix, the design looks like this...
And it will look like this when rendered..
This is not quite what you wanted but we can soon change that.
All you need to do is change the expression in the 'Data' cell from [Sum(qty)] to something like this ...
=FIRST(Fields!Size.Value) & " " & Sum(Fields!Qty.Value)
Now when we render we get this...
If you want to put line breaks in etc then you can just edit the expression to suit. Alternatively you can use placeholders in the cell to have even more control of the layout and formatting.

Create a DataSet with multiple labels and unknown number of classes in deeplearning4j

What DataSetIterator should I use in order to create a DataSet object that contains miultiple features and labels? I have only seen examples similar to 'Iris example' where there is only one label and it is known how many different labels there are. In my problem there are four labels (position X, position Y, width and height of a shape) and many features (pixels values) and it's impossible to calculate how many different labels there could be.
I want something like this
RecordReader recordReader = new CSVRecordReader(0, ',');
recordReader.initialize(new FileSplit(new File(fileName)));
DataSetIterator iterator = new CustomDataSetIterator(recordReader, numRows, numFeatures, numLables);
DataSet allData = iterator.next();
Using data that looks like this
feature0;feature1;feature2;feature3;label0;label1;
I know that this question seems very basic and it is but I really had hard time finding any information about this topic in official tutorials or in documentation.
it seems like you are looking for an object detection kind of data with bounding boxes an multiple possible objects in your picture.
take a look at this example for that: https://github.com/eclipse/deeplearning4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/convolution/objectdetection/HouseNumberDetection.java
in general there is a MultiDataSet that can take multiple inputs and can have multiple outputs.

How to check TabNavigator Page efficiently

I am using flex TabNavigator to display few datagrids. Each datagrid have same structure but populated with different dataProvider. Currently I am using following method to check which datagrid or an element from a tab was clicked.
if(TabNavigator.selectedIndex == 0){
}else if(TabNavigator.selectedIndex == 1){
}
...
else if(TabNavigator.selectedIndex == 4){
}
My question is is there an efficient way to check this? Is there anyway I can organize similar structure in to one property?
Thank you.
Add all your data providers into an array in the same sequence as the items in the tab navigator. Then simply do:
dataGrid.dataProvider = dataProviderArray[tabNavigator.selectedIndex];
Here 'dataProviderArray' is the array of all the data providers for the data grid.
Also, since you mentioned that the data grid has the same structure for all the tabs, I am assuming you are using one Data Grid and not multiple. If not, I would recommend you keep one data grid only and change its data provider when the tabs change.
Hope this solves your question.

sorting column data in advanceddatagrid flex while displaying

I am new to working on flex. I looked at several stackoverflow questions but they didnt seem to answer my question.
I am using Advanced data grid column to display my data in a table. I know that columns can be sorted using the controls on the table being displayed.
But is there a way to sort data based on a single column when the data gets displayed.
I used sortDescending ="true" attribute but no change in the data.
Any help is much appreciated
Try to dispatch event
var adgEvent:AdvancedDataGridEvent =
new AdvancedDataGridEvent(AdvancedDataGridEvent.SORT, false, true);
adgEvent.columnIndex = columnIndex;
adgEvent.dataField = dataField;
adgEvent.triggerEvent = triggerEvent;
adgEvent.multiColumnSort = false;
on your AdvancedDataGrid to sort some column

How do I insert a dataset value to a BIRT report outside of a table / cube?

okay, this has got to be simple - but I can't seem to find an answer...
I am creating a summary report (using BIRT 2.6.1), and laying out a few specific summary values in a grid (not a table or a cube).
Say it's a simple query:
SELECT decision FROM dataTable
I created a data binding / aggregation (named "sumDecision") on my grid, of a type count, where my expression is:
dataSetRow["decision"]
Now, I've tried to insert this into a grid, either as "data" or "dynamic text" with the column binding:
row["sumDecision"]
But when I run the report, it comes up blank. How would I do this? Using dataSet["decision"] doesn't seem to do anything either.
I would create a Text Item (not Dynamic Text, just Text) and use the "Value Of" tags on the text item. This will give you an expression editor and as long as your grid is bound to the data set in question, you will be able to choose your data element there.
Since you just want to see the text in the grid, make sure and choose "HTML" for the format of the text item.
One solution is to create a table of 1 column, 1 detail - then delete the detail & header rows, and create my grid inside the footer of the table.
From here, I can add a dataset to the table, and create aggregations that work to my hearts content.
Is this the right way to do this, or am I missing something?