OLAP Datagrid
Hi All
This is quite a general question but I was wondering if
anyone was using the OLAP Datagrid in Flex 3.
Also, I was wondering if the OLAP calculations (data) within
the datagrid could be used to produce charts.
Any experiences would be worth hearing.
Best regards
Versie
Can any one help me convert flex3 code of olapdatagrid to flex2 but it should not give runtime error
Thanks in advance
Niranjan
Similar Messages
-
Implement OLAP Datagrid in flex2
Actually olap datagrid is a component in flex 3. but i want to implent this datagrid in flex 2.
If any one have any idea or any help link is avaliable in web plz send me.
Thanks in advance.
Niranjan Swain.Can any one help me convert flex3 code of olapdatagrid to flex2 but it should not give runtime error
Thanks in advance
Niranjan -
Hi,
I am using the olapdatagrid and am using a date field as a
column axis. For the other axis I have an account hierarchy. For
the measure I am using a sum aggregator.
When aggregated the data contains 5 different dates. The
problem is that where an account contains values for only some of
the dates, the olapdatagrid displays NaN which looks as though
there is an error.
I would prefer it displayed 0 but a blank (as per the Excel
Pivot Control) would suffice.
Any suggestions.OK, actually the answer is in the documentation. You can
apply a defaultCellString property to the datagrid. In this case I
am choosing the value "" to have the grid show a blank. -
Suppressing the total row and column in OLAP datagrid
I have created an OLAPDatagrid and everything looks fine
except that I don't want to show the '(All)' row and column in the
grid. Is there a way to suppress them?
Thanks,
FredInstead of using members() in the query use children() for
the attribute/hierarchy. -
Hi
how can i create an arraycollection from xml and the pass it
to a
advanceddatagrid?
my xml looks like this:
<root>
<week id="1">
<production day="monday">
<book>23</book>
<cds>49</cds>
</production>
<production day="tuesday">
<book>56</book>
<cds>68</cds>
</production>
...other weeks production...
</week>
</root>
i would display data contains in xml within a datagrid
through this layout
monday tuesday ...
books 23 56
cds 49 68
regards
thanks a lot"Bilbo1984" <[email protected]> wrote in
message
news:ggjmtp$oa1$[email protected]..
> Hi
>
> how can i create an arraycollection from xml and the
pass it to a
> advanceddatagrid?
>
> my xml looks like this:
>
> <root>
> <week id="1">
> <production day="monday">
> <book>23</book>
> <cds>49</cds>
> </production>
> <production day="tuesday">
> <book>56</book>
> <cds>68</cds>
> </production>
> ...other weeks production...
> </week>
> </root>
>
> i would display data contains in xml within a datagrid
through this layout
>
> monday tuesday ...
> books 23 56
> cds 49 68
>
I think what you need is called an OLAP datagrid, and I think
it will
probably work with your existing XML. -
Hello,
I have been struggling with this and would appreciate if anyone can guide me here.
I am getting a resultset from a database and I need to present it in a particular format. I tried with DataGrid and it doesnt work, I read through OLAP documentation and saw the statement "Flex supports only numeric values for the measure of a cube". I am stuck and not sure how to do this.
The resultset I am getting is of the following format
<Details>
<Company>
<Name> Intel </Name>
<ID> 2356 </ID>
<City>Santa Clara </City>
<State> California </State>
</Company>
<Financials>
<Cash>2345</Cash>
<Liability>9876</Liability>
<Assets>457847</Assets>
</Financials>
<Profile>
<Employees>44459</Employees>
<Industry>computer</Industry>
</Profile>
<Year>2009</Year>
</Company>
<Company>
<Name> Intel </Name>
<ID> 2356 </ID>
<City>Santa Clara </City>
<State> California </State>
</Company>
<Financials>
<Cash>4857</Cash>
<Liability>8769</Liability>
<Assets>36456</Assets>
</Financials>
<Profile>
<Employees>56489</Employees>
<Industry>computer</Industry>
</Profile>
<Year>2010</Year>
</Company>
<Company>
<Name> IBM </Name>
<ID> 2356 </ID>
<City>Santa Clara </City>
<State> California </State>
</Company>
<Financials>
<Cash>2345</Cash>
<Liability>9876</Liability>
<Assets>457847</Assets>
</Financials>
<Profile>
<Employees>44459</Employees>
<Industry>computer</Industry>
</Profile>
<Year>2009</Year>
</Company>
<Company>
<Name> IBM </Name>
<ID> 2356 </ID>
<City>Santa Clara </City>
<State> California </State>
</Company>
<Financials>
<Cash>4857</Cash>
<Liability>8769</Liability>
<Assets>36456</Assets>
</Financials>
<Profile>
<Employees>56489</Employees>
<Industry>computer</Industry>
</Profile>
<Year>2010</Year>
</Company>
</Details>
The output needs to of the below
Intel
IBM
2009
2010
2009
2010
Financials
Cash
58748
456476
4657846
456740
Liability
564756
343545
857898
98798
Assets
35455
87990
34535
789787
Profile
Employees
634536
67886
87668
95688
Industry
Computers
Computers
Computers
Computers
ID
2356
67678
City
Santa Clara
San Jose
State
California
CaliforniaStatspack and AWR do not run continuously and collect stats, so they don't cause any performance impact.
When you run a snap it just reads the current system stats from the V$ and X$ tables and stores them in permanent tables. The V$ and X$ tables are always updated even if statspack is not installed.
Edited by: Robert Geier on Oct 13, 2009 1:06 PM -
Programatic creation of OLAP Levels?
While I can create an OLAP Level in Action Script. It seems a
fruitless endeavor due to that fact that all the attributes of the
object are read only.
var myOlapDim2Level1:OLAPLevel = new OLAPLevel();
myOlapDim2Level1.name = "Product";
This creates an OLAPLevel object, no problems there.
myOlapDim2Level1.dataField = "product";
This however fails due to the dataField being read only. Same
is true of the attribute property. So there seems to be no means of
assigning a data field to a OLAP Level created in action script.
Anyone have any ideas?quote:
OLAPLevel gets associated with the OLAPAttribute object with
that name. The dataField property of the OLAPAttribute would be
used by the OLAPLevel.
So the following should just work then? Without having to
assign the attribute to the level?
//Create dimension 1
var myDimension1:OLAPDimension = new
OLAPDimension("CustomerDim", "Customer");
//Create hierarchy for dimension 1
var myHierarchy1:OLAPHierarchy = new
OLAPHierarchy("CustomerHier", "Custmer");
myHierarchy1.hasAll = true;
myHierarchy1.allMemberName = "(All)";
//Create the levels
var myOlapAttribute1:OLAPAttribute = new
OLAPAttribute("Customer");
myOlapAttribute1.dataField="customer";
var myOlapDim1Level1:OLAPLevel = new OLAPLevel("Customer");
myOlapDim1Level1.attributeName="Customer";
//assign hierarchy & levels to dimension 1
myHierarchy1.levels = new
ArrayCollection([myOlapDim1Level1]);
myDimension1.hierarchies = new
ArrayCollection([myHierarchy1]);
I've tried this, and while it compiles I dont seem to be
getting any data in the datagrid and chart. Its acting like it did
before I added the levels and attributes (empty dimensions). So I
feel I'm still missing something.
In fact, the query is failing on the cube when I try to pull
out the attribute of the dimension. -
Hi all,
I am new to Flex/Flash Builder, actionscript, and mxml, so please be kind.
I have developed a small program that has a component that displays a datagrid fed with information out of a mysql db via a php data services connection. Within that same component (page), I have a graph that charts the dates via a plot chart. I am interested in adding a line series to the graph, but the data I want to use is a calculated field in the datagrid which I used a custom lable function to derive and display. Can someone steer me to the correct method to store such values and how to call them into a chart?
Some addition information
Custom label function:
/* Custom label function for the Delta1 column. Calculates the number of days between the planting date and 10% flower. */
private function calculateTo1stFlower(item:Object, column:GridColumn):String {
var tempDate1:Date = new Date(item.dflower10 - item.dplanting);
return Math.round((tempDate1.time / MS_PER_DAY) + 1).toString();
/* Number of milliseconds in a day. (1000 milliseconds per second * 60 seconds per minute * 60 minutes per hour * 24 hours per day) */
private const MS_PER_DAY:uint = 1000 * 60 * 60 * 24;
Within my spark datagrid
<s:GridColumn width="30" headerText="Δ1" labelFunction="calculateTo1stFlower" ></s:GridColumn>
I assume I need to store the array of values for this column and then chart the saved values as the xField within the LineSeries. Should I use a class based model?
The following link seemed like it may be an appropriate path; I am not sure though.
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7b51.html
Thanks in advance for any support,
MatthewThanks for trying to post DDL, but you have no idea how to do a data model. You do not know that tables have to have keys, what ISO-11179 is, etc.
You have a table that is supposed to model companies. Your singular names says that there is only one company! There is no company identifier (the industry standard is the DUNS). A customer is not a company. We do not use numeric data types for identifiers;
do you do math on them? NO! The attribute property comes after the attribute name (you never heard of ISO-11179).
Think about how silly VARCHAR(1) is.
CREATE TABLE Companies
(company_duns CHAR(9) NOT NULL PRIMARY KEY,
company_name VARCHAR(30)NOIT NULL,
margin_oil INTEGER NOT NULL,
margin_hangar INTEGER NOT NULL,
margin_cleaning INTEGER NOT NULL);
INSERT INTO Companies
VALUES (1, 'AviatKorea', 100, 125, 200),
(2, 'AXHollande', 50, 40, 30),
(3, 'BFXNorway', 60, 80, 600),
(4, 'EEEFrance', 10, 25, 60);
CREATE TABLE Company_Tariffs
(company_duns INTEGER NOT NULL
REFERENCES Companies(company_duns),
tariff_type CHAR(1) NOT NULL
CHECK (tariff_type IN ('A','B','C','D'),
PRIMARY KEY (company_duns, tariff_type));
INSERT INTO Company_Tariffs values (1, 'A'), (2, 'C'), (2, 'D'), (3, 'A'), (4, 'A'), (4, 'C'), (4, 'D')
SELECT * -- do not use * in production code
FROM Companies AS C,
Company_Tariffs AS T
WHERE C.company_duns = T.company_duns;
>> I would like something like with a computed column [ ] that retrieves the different contracts used: <<
You might but a SQL programmer would not. This violated First Normal Form. It is a display report and is done in the presentation layers.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Datagrid doesn't display numbers with more than 19 digits
With patch 1 the SQL Developer datagrid should display numbers with more than 10 digits. But the limit seems to be 19 digits now. Number20 and Number21 fields are not displayed on my machine.
WinXP Prof. 2002 SP2
SQL Developer 1.0.0.14.67
Personal Oracle Database 10g Release 10.2.0.2.0 - Production with options Partitioning, Spatial and OLAPI saw this as well and am working on fixing it.
-kris -
How to handle datagrid reference
when working in a datagrid and using an item render button i
cannot reference to remove the item because even
parentapplication.NAMEOFARRAY.addItem wont work.?
what else can i use to get access to add and remove items
from within a button inside the datagridHi Kenny_I,
According to your description, you want to know how to import flat files into SQL Server Analysis Services tabular model, right?
In your description, you said that "you can import these 2 files to 2 staging table, then ETL to one DimCountry table on DW in OLAP cube." Based on my research, the flat files are not supported as the datasource of SSAS tabular model. So you can import
these 2 files to 2 staging table, and import the tables into SSAS tabular model.
Reference
http://msdn.microsoft.com/en-in/library/gg492165.aspx
http://msdn.microsoft.com/en-us/library/hh230968.aspx
If I have anything misunderstood, please point it out.
Regards,
Charlie Liao
TechNet Community Support -
Hi,
We are trying to run a doscoverer OLAP PLUS report therough a URL. The help says that we need to use the workbook ID, but in the workbook property we cannot find identifier field. The URL we are forming is as shown. Please help
http://itlinuxdevblade18.hq.emirates.com:7778/discoverer/plus?%20%20%20&us=S243191%20%20&pw=S243191%20%20&db=itlinuxdevblade18:1521:cvu10gd%20&lm=OLAP&wb=root\Users\S243191\A1As regards the Forms 6i.....
Re: Calling a Disco Report from Forms
Greetings....
Sim -
Creation of Universe based on Hana OLAP connection
I have to create a universe in IDT 4.1 sp2 based on SAP HANA OLAP
connection ?
How can i access SAP HANA view which was created using OLAP connection in Business objects Explorer? It does not allow creating Universe on top of SAP HANA OLAP connection and gives an error
SAP Business Objects query and reporting applications can directly connect to OLAP SAP HANA connections. No universe is required, only a published OLAP SAP HANA connection.
ThanksHi Jyothy,
Refer the below link on how to create universe on Analytic View/Calculation View using relation connection in IDT
http://www.sapanalyticsguru.com/index.php/sap-bobi/31-universe-creation-on-hana-view-using-information-design-tool -
Datagrid Image Renderer Broken in CS SDK but not Flex project
Within a Photoshop Extension, I have a DataGrid which has an inline custom image renderer whose dataprovider is an ArrayCollection called "photos" representing a list of photos and some metadata properties. One of the properties "fileName" is concatenated with a path to a thumbnail image such as source="{'LR_AUTO/imported/thumbs/' + data.fileName}".
The dataprovider is bound to a LCDS DataService. When the extension is first launched, the dataservice initializes the dataprovider with the existing values for the "photos" arraycollection. The thumbnail images are correctly shown.
However, when the DataService receives a new row and updates the photos dataprovider, the datagrid's new row shows a broken image for the thumbnail even though the path is correct. I have dumped the photos dataprovider and verified that all information is correct. When I close Photoshop and relaunch it from Flash Builder, once again LCDS initializes the photos ArrayCollection and THEN the thumbnail that previously showed as broken show up correctly.
I have a ColdFusion Directory Watcher Gateway that watches a directory where Lightroom auto-imports images from a tethered capture session. When the camera sends Lightroom a new image, the new image is processed by Lightroom and moved to a target directory, and since ColdFusion's Directory Watcher is watching that targeted directory, ColdFusion will create a thumbnail image in a subfolder and notifiy LCDS that of the new image and related metadata.
*** This is the interesting part *** When Lightroom places new images in the target directory, this is propogated to the Photoshop Extension's datagrid, and the new row shows up as described earlier, showing a broken image for the thumbnail. BUT, instead of Lightroom, if I manually copy images to the folder where ColdFusion is watching, then exact same code path is exectuted and in the Photoshop Datagrid the new row appears and THE THUMBNAIL IMAGE shows up correctly.
The difference seems to be only in how the images are put in the original target location. The problem is when Lightroom puts them there, but it works when I put them there as a user.
*** More Interesting Info *** I have the Flex code for the Photoshop Extension duplicated in a standalone, non-CSSDK project using Flex 3.4 which I launch in a browser. I have mirrored the code in the Photoshop extension, but in this manner, the problem does not exist. With plain Flex 3.4 in a browser, whenever LCDS notifies the datagrid of a new photo record, the datagrid's new row ALWAYS shows the thumbnail correctly.
A primary difference in how the thumbnail image is rendered is that in a browser, the Flex 3.4 project accesses the image assets over the network, however, in the Photoshop Extension, the image asset WITH THE SAME RELATIVE PATH is accessed over the local file system.
source="{'LR_AUTO/imported/thumbs/' + data.fileName}"
So in the case of the browser, this path is a relative URL and the image is retrieved over HTTP, however, in the PS Extension, the same path represents a file system path relative to the project folder.
Unfortunately, because the Flash Player (including APE) cannot access BOTH the network and the local filesystem, so I cannot change the Extension to use network access.
** The important part to remember is that when I stop the Flash Builder debug session and close Photoshop, then relaunch the debug with Photoshop, then all the images show up correctly in the Extension.
Your advice is appreciated.
Thank you!
Steve
====================================================
Environment
====================================================
Photoshop CS5 Extended 12.01 x32
Flash Builder 4
CS SDK 1.02
Extension Builder SDK 3.4
MacBook Pro / OS X 10.5 / Intel Core 2 Duo 2.66 GHz / Procs: 1 / Cores: 2 / Memory: 8 GB
App configured for Photoshop CS5 and Photoshop CS5 Extended
====================================================
NewsAgencyPhotoshop.mxml
====================================================
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="com.stevenerat.news.*"
horizontalScrollPolicy="off" verticalScrollPolicy="off" verticalGap="0"
layout="vertical" horizontalAlign="left" backgroundColor="#353535"
historyManagementEnabled="false"
creationComplete="init();">
<mx:Script>
public function handlePhotoClick(data:Object):void {
this.PreviewImageWindow = PreviewImage(PopUpManager.createPopUp(this,PreviewImage,true));
var filePath:String = data.dirPath + data.fileName;
PreviewImageWindow.addEventListener("imageOpenEvent",imageOpenListener);
PreviewImageWindow.addEventListener("imageCloseEvent",imageCloseListener);
PreviewImageWindow.addEventListener("imageSavedEvent",imageSaveListener);
PreviewImageWindow.setFileName(data.fileName);
PreviewImageWindow.setFilePath(filePath);
PreviewImageWindow.y = 0;
PreviewImageWindow.x = 0;
]]>
</mx:Script>
<mx:ArrayCollection id="photos"/>
<NewsPhoto/>
<mx:DataService id="ds" destination="NewsAgencyPhotos" autoSyncEnabled="true" autoCommit="true" conflict="conflictHandler(event)"/>
<mx:Label text="News Agency Photos" fontSize="20" paddingBottom="30"/>
<mx:Label text="Available Images" fontSize="15"/>
<mx:DataGrid id="photoIPTC" dataProvider="{photos}" editable="true" width="220" rowCount="5" rowHeight="75" wordWrap="true">
<mx:columns>
<mx:DataGridColumn headerText="id" dataField="fileName" width="40" editable="false" sortDescending="true"/>
<mx:DataGridColumn dataField="psLock" width="65" headerText="Status" editable="false" editorDataField="value">
<mx:itemEditor>
<mx:Component>
<mx:ComboBox editable="false">
<mx:dataProvider>
<mx:String>New</mx:String>
<mx:String>Open</mx:String>
<mx:String>Edited</mx:String>
</mx:dataProvider>
</mx:ComboBox>
</mx:Component>
</mx:itemEditor>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="Photo" dataField="fileName" width="80" editable="false">
<mx:itemRenderer>
<mx:Component>
<mx:HBox horizontalAlign="center" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:Image click="outerDocument.handlePhotoClick(data);" source="{'LR_AUTO/imported/thumbs/' + data.fileName}" width="75" height="75"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</mx:Application>
====================================================
A DUMP OF THE DATAPROVIDER
in this case, one array item existed when launched, then a second was added
while running. The first has its thumbnail show, the second item has broken image
====================================================
------------------DUMP----------------------------
(mx.collections::ArrayCollection)#0
filterFunction = (null)
length = 2
list = (mx.data::DataList)#1
fillParameters = (Array)#2
length = 2
localItems = (Array)#3
[0] (com.stevenerat.news::NewsPhoto)#4
aperture = "F10"
cameraLens = "EF24-70mm f/2.8L USM"
cameraModel = "Canon EOS 7D"
city = ""
copyrightNotice = "© Steven Erat 2011"
country = ""
creator = "Steven Erat"
description = ""
dirPath = "/Users/stevenerat/LR_AUTO/imported/"
fileName = "ERAT_STEVEN_20110122_162.jpg"
focalLen = "42.0 mm"
headline = ""
id = 1
iso = "100"
keywords = "Alt, Dramatic, Fashion, Girl, Glamorous, Glamour, Inked, Model, Portrait, SOPHA"
psLock = "New"
shutterSpeed = "1/128 sec"
state = ""
[1] (com.stevenerat.news::NewsPhoto)#5
aperture = "F10"
cameraLens = "EF24-70mm f/2.8L USM"
cameraModel = "Canon EOS 7D"
city = ""
copyrightNotice = "© Steven Erat 2011"
country = ""
creator = "Steven Erat"
description = ""
dirPath = "/Users/stevenerat/LR_AUTO/imported/"
fileName = "ERAT_STEVEN_20110122_163.jpg"
focalLen = "42.0 mm"
headline = ""
id = 2
iso = "100"
keywords = "Alt, Dramatic, Fashion, Girl, Glamorous, Glamour, Inked, Model, Portrait, SOPHA"
psLock = "New"
shutterSpeed = "1/128 sec"
state = ""
uid = "8BAC025E-60D1-11F1-3654-44BDB0D218CE"
view = (mx.collections::ArrayCollection)#6
filterFunction = (null)
length = 2
list = (mx.data::DataList)#1
sort = (null)
source = (null)
sort = (null)
source = (null)
------------------END_DUMP------------------------I expected that if my extension uses the local filesystem AND the network that I would get a Security Sandbox Exception as I recently described in this thread:
http://forums.adobe.com/thread/791918?tstart=0
However, I just tried changing my datagrid image renderer to access the thumbnail via HTTP and the thumbnail issue after Lightroom export does not happen.
<mx:DataGridColumn headerText="Photo" dataField="fileName" width="80" editable="false">
<mx:itemRenderer>
<mx:Component>
<mx:HBox horizontalAlign="center" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:Image click="outerDocument.handlePhotoClick(data);" source="{'http://localhost:8500/LR_AUTO/imported/thumbs/' + data.fileName}" width="75" height="75"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
Furthermore, I can also open the image via the Photoshop DOM, and it does open correctly. It seems that I do have a solution now, although I'm not certain as to why I'm not getting a Security Sandbox Exception as I described in the other post.
Thanks for reading. -
URGENT : Help needed for OLAP tools selection
Hi Gurus,
Environment :
Oracle 10g
.net web application with backend as Oracle 10g server embaded with OLAP server.
Application - CRM
Feature requreid - OLAP, OLAP Reporting, Drilldown graphical analysis, US MAP view location specific queries, Ad-hoc analysis.
I have to take a descision for for the OLAP tool selection with above mention client requirement.
* Please let me know if anybody have worked on above combination for the required features and held up with any issue (if any) ?
* Please go thru Oracle options below per feature and let me know is there any issue with .NET and IIS server,Oracle 10g OLAP compatibily ? specially for following points from the below details -
4. OLAP Reporting Tool :
6. Web deployment of Cubes :
8. Graphing :
9. Geographical Map View based query :
1.Extraction Transformation and loading (ETL) Tool : Oracle Business Intelligence Warehouse Builder, tightly integrated with Database Server.
2. Analysis Tool (Multidimensional Data Analysis using cubes) : Oracle Business Intelligence Discoverer·
3. Ad-hoc query and analysis by end User :
Oracle Business Intelligence Spreadsheet Add-in.OLAP DML Regular Sql with OLAP_TABLE Function.
4. OLAP Reporting Tool : Oracle Reports 10g.
5. Multidimensional Data (Cube) Query Language OLAP DML : Regular Sql with OLAP_TABLE Function
6.Web deployment of Cubes : Available
7. Cube data export to xls, html, format : Available
8.Graphing : Oracle Reports 10g Graph Wizard for Graphical Analysis.
9. Geographical Map View based query : Oracle Locator: Location-Enabling Every Oracle Database
Please send me the relevent urls in support / issues for the above featues.
TIA,
SheileshThe only Adobe program I know that can edit images is Photoshop.
If you have troubles with Google software, you need to post in the appropriate Google forum. -
DataGrid does not display XML data
Hello, and thanks for reading this...
I am having a problem displaying XMLList data in a DataGrid.
The data is coming from a Tree control, which is receiving it
from a database using HTTPService.
The data is a list of "Job Orders" from a MySQL database,
being formatted as XML by a PHP page.
If it would be helpful to see the actual XML, a sample is
here:
http://www.anaheimwib.com/_login/get_all_orders_test2.php
All is going well until I get to the DataGrid, which doesn't
display the data, although I know it is there as I can see it in
debug mode. I've checked the dataField property of the appropriate
DataGrid column, and it appears correct.
Following is a summary of the relevant code.
...An HTTPService named "get_all_job_orders" retrieves
records from a MySQL database via PHP...
...Results are formatted as E4X:
HTTPService resultFormat="e4x"
...An XMLListCollection's source property is set to the
returned E4X XML results:
...The "order" node is what is being used as the top-level of
the XML data.
<mx:XMLListCollection id="jobOrdersReviewXMLList"
source="{get_all_job_orders.lastResult.order}"/>
...The "jobOrdersReviewXMLList" collection is assigned to be
the dataProvider property of a Tree list, using the @name syntax to
display the nodes correctly, and a change event function is defined
to add the records to a DataGrid on a separate Component for
viewing the XML records:
<mx:Tree dataProvider="{jobOrdersReviewXMLList}"
labelField="@name"
change="jobPosForm.addTreePositionsToDG(event)"/>
...Here is the relevant "jobPosForm" code (the Job Positions
Form, a separate Component based on a Form) :
...A variable is declared:
[Bindable]
public var positionsArray:XMLList;
...The variable is initialized on CreationComplete event of
the Form:
positionsArray = new XMLList;
...The Tree's change event function is defined within the
"jobPosForm" Component.
...Clicking on a Tree node fires the Change event.
...This passes an event object to the function.
...This event object contains the XML from the selected Tree
node.
...The Tree node's XML data is passed into the positionsArray
XMLList.
...This array is the dataProvider for the DataGrid, as you
will see in the following block.
public function addTreePositionsToDG(event:Event):void{
this.positionsArray = selectedNode.positions.position;
...A datagrid has its dataProvider is bound to
positionsArray.
...(I will only show one column defined here for brevity.)
...This column has its dataField property set to "POS_TITLE",
a field in the returned XML record:
<mx:DataGrid width="100%" variableRowHeight="true"
height="75%" id="dgPositions"
dataProvider="{positionsArray}" editable="false">
<mx:columns>
<mx:DataGridColumn width="25" headerText="Position Title"
dataField="POS_TITLE"/>
</mx:columns>
</mx:DataGrid>
In debug mode, I can examine the datagrid's dataProvider
property, and see that the correct XML data from the Tree control
is present. However, The datagrid does not display the data in any
of its 6 columns.
Does anyone have any advice?
Thanks for your time.Hello again,
I came up with a method of populating the DataGrid from the
selected Item of a Tree Control which displays complex XML data and
XML attributes. After the user clicks on a Tree branch, I call this
function:
public function addTreePositionsToDG(event:Event):void{
//Retrieve all "position" nodes from tree.
//Loop thru each Position.
//Add Position data to the positionsArray Array Collection.
//The DataGrid dataprovider is bound to this array, and will
be updated.
positionsArray = new ArrayCollection();
var selectedNode:Object=event.target.selectedItem;//Contains
entire branch.
for each (var position:XML in
selectedNode.positions.position){
var posArray:Array = new Array();
posArray.PK_POSITIONID = position.@PK_POSITIONID;
posArray.FK_ORDERID = position.@FK_ORDERID;
posArray.POS_TITLE = position.@POS_TITLE;
posArray.NUM_YOUTH = position.@NUM_YOUTH;
posArray.AGE_1617 = position.@AGE_1617;
posArray.AGE_1821 = position.@AGE_1821;
posArray.HOURS_WK = position.@HOURS_WK;
posArray.WAGE_RANGE_FROM = position.@WAGE_RANGE_FROM;
posArray.WAGE_RANGE_TO = position.@WAGE_RANGE_TO;
posArray.JOB_DESCR = position.@JOB_DESCR;
posArray.DES_SKILLS = position.@DES_SKILLS;
positionsArray.addItem(posArray);
So, I just had to manually go through the selected Tree node,
copy each XML attribute into a simple Array, then ADD this Array to
an ArrayCollection being used as the DataProvider for the DataGrid.
It's not elegant, but it works and I don't have to use a Label
Function, which was getting way too complicated. I still think that
Flex should have an easier way of doing this. There probably is an
easier way, but the Flex documentation doesn't provide an easy path
to it.
I want to thank you, Tracy, for the all the help. I checked
out the examples you have at www.cflex.net and they are very
helpful. I bookmarked the site and will be using it as a resource
from now on.
Maybe you are looking for
-
Yet another customer with Photoshop CC crashing on opening!
Hi Photoshop CC keeps closing as soon as it opens on my PC. I have installed, uninstalled and reinstalled over five times since starting my subscription to CC two days ago, to no avail. I have thoroughly cleaned my PC, followed all the advice I can f
-
Dont allow to change item level data in sales order.
Hi all, I have a requirement in which, users should not be allowed to change item level data or not allowed to add any new items in sales order on a certain condition. But they should be allowed to change the header level data. How can i achieve thi
-
Save as PDF - Change Author Name?
In any application when you go to Print, Save as PDF is there any way to change the default author name it already has written there?
-
Ndata not returning all possible results
i created an index with userdatastore, basic lexer and basic wordlist preferences. Also a section group with ndata section. base letter, substring index all are true. but when i search for 'scri', i am not getting 'de*scri*ption' in the results. pls
-
RFC adapters for BusinessService??
Hi XI Friends.. In my FILE to BAPI scenario..i am using Receiver as BusinessService and adapter as RFC adapter. can I use RFC adapters for BusinessService ?? please guide me.. regards Ram