Graphic design of data sourcing XML from a database

Hi all

I try to display a histogram with Source such as an XML that is generated from a database using PHP. Some how I get errors... Is it possible to do that... He... If so how should it be done.

This table exists in MYSQL

CREATE TABLE "project1". "bubble_graph")
Varchar (45) 'Product' NOT NULL default ",
int (10) 'delivery' unsigned zerofill NOT NULL,.
int (10) unsigned zerofill NOT NULL ' delay'
) ENGINE = InnoDB DEFAULT CHARSET = latin1;


INSERT INTO bubble_graph VALUES ('IteamA', 20, 2);
INSERT INTO bubble_graph VALUES ('IteamB', 20, 8);
INSERT INTO bubble_graph VALUES ('IteamC', 20, 1);
INSERT INTO bubble_graph VALUES ('IteamD', 20, 6);
INSERT INTO bubble_graph VALUES ('IteamE', 20, 15);
INSERT INTO bubble_graph VALUES ('IteamF', 20, 3);
--------------------------------------PHP----------------code
<? PHP
Define ("DATABASE_SERVER", "localhost: 3306 ');
Define ('DATABASE_USERNAME', 'root');
Define ("DATABASE_PASSWORD", "yyyyyyy");
Define ('database_name', 'Project1');

connect to the database
$mysql = mysql_connect (' localhost: 3306 ', 'root', 'yyyyyy');

@mysql_select_db (DATABASE_NAME);

Returns a list of all users
$Query = ' select Product, round (delivery) as delivery, round (delay) in the time of bubble_graph ";
$Result = mysql_query ($Query);

$Return = "< root >."

While ($User = mysql_fetch_object ($Result))
{
$Return. = "< Data > ';
$Return. = "< data". " Product =------"". " $User-> product. » \ "> » ;
$Return. = '< product >. $User-> product. "< / product > ';
$Return. = "< delivery >." $User-> delivery. "< / delivery > ';
$Return. "< delay > =. $User-> delay. "< / delay > ';
$Return. = "< / data > ';

}
$Return. = "< / root >;
mysql_free_result ($Result);
print ($Return)
? >
++++++++++++++++++++++++++++++Flex code+++++++++++

< mx:ColumnChart id = "table" dataProvider = "{results}" showDataTips = "true" width = "513" height = "286" type = "grouped" x = "0" y = "31" >
< mx:horizontalAxis >
< mx:CategoryAxis dataProvider = "{results}" categoryField = "Product" / >
< / mx:horizontalAxis >

< mx:series >
< mx:Array >
< mx:ColumnSeries yField = 'period' name = 'time' / >
< mx:ColumnSeries yField = 'delivery' name = 'delivery' / >
< / mx:Array >
< / mx:series >
< / mx:ColumnChart >


Consider this, your code is far away. Your idea is fundamentally correct, but take a look at one, I built. This actauly return xml from a database published on a page and access to the page & data using the correct data aggregate query string values. Look closley the code using im to organize the results.


http://www.Adobe.com/2006/mxml"layout ="absolute"backgroundGradientColors ="[#ffffff, #ffffff]"currentState ="stSalesByDate">


Import the required namespaces
Import mx.controls.Alert;
import mx.validators.DateValidator

var ResolveUrl:String = "";

Initialization function manages the init program
private function init (): void {}

ResolveUrl = Application.application.parameters.ResolveUrl;

}

Valid entries and fires http service
private function buildReports (): void {}

var retVal:Boolean = isValidDates (dateStart.text, dateEnd.text);

If (retVal == true) {}

wService.send ();
currentState = "stSalesResults";

} else {}

Alert.Show ("Please enter dates valid.', 'Invalid Date', Alert.OK");

}

}

Manages the State switch Events for new reports
private function newReport (): void {}

currentState = "stSalesByDate";

}

Date comparison function handles to ensure deadlines are valid
private void isValidDates(strStart:String,_strEnd:String):Boolean {}

var blnIsValid:Boolean = false;

If (strStart.length == 0 | strEnd.length == 0) {}

blnIsValid = false;

} else {}

blnIsValid = true;

}

return blnIsValid

}

]]>































This code is called e4x he treats xml as a native object, search :)

Tags: Flex

Similar Questions

  • Read configuration data source AM from Java Bean code

    Hi experts,


    I use Jdev 12.1.3 and I need to read the name of AM Datasource from Java Code, to get a text like "jdbc/nomsourcededonnees.


    Is this possible?

    Thank you very much
    Jose.

    This object has methods getURL(), getUser() and others.

    But there is no method as getDataSourceName()

    (AFAIK, jdbc connection "knows" nothing about the Data Source)

    You can try something like this inside your AppModuleImpl class:

    this.getSession () .getEnvironment () .get (Configuration.JDBC_DS_NAME)

    Dario

  • Process xml from oracle database

    Hello

    I have an XML file that:

    <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? >
    < table xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" >
    < Budgets30 >
    < id > < /ID > 83201
    < gm1 > 20575.2 < / gm1 >
    < gm2 > 20761.2 < / gm2 >
    < gm3 > 41583.6 < / gm3 >
    < > 46896 gm4 < / gm4 >
    < gs1 > 51438 < / gs1 >
    < > 51903 gs2 < / gs2 >
    < > 103959 gs3 < / gs3 >
    < gs4 > 117240 < / gs4 >
    < / Budgets30 >
    < Budgets30 >
    < id > < /ID > 83202
    < > 81000 gm1 < / gm1 >
    < gm2 > 0 < / gm2 >
    < > 16200 gm3 < / gm3 >
    < gm4 > 0 < / gm4 >
    < gs1 > 202500 < / gs1 >
    < gs2 > 0 < / gs2 >
    < > 40500 gs3 < / gs3 >
    < gs4 > 0 < / gs4 >
    < / Budgets30 >

    There are approximately 4000 lines. Following code does not work because of ' ORA-19011: character string buffer too small "."

    Insert into xxpm_sr_cost_prices_xml values (xmltype (dbms_xslprocessor.read2clob (lv_file_dir, lv_file_name)));
    --
    l_location: = ' select / Extract to inhabitants. "
    SELECT scp.content.extract('//Id').getStringVal () got Id
    scp.content.extract('//gm1').getStringVal () as gm1
    scp.content.extract('//gm2').getStringVal () as gm2
    scp.content.extract('//gm3').getStringVal () as gm3
    scp.content.extract('//gm4').getStringVal () as gm4
    scp.content.extract('//gs1').getStringVal () as gs1
    scp.content.extract('//gs2').getStringVal () like the gs2
    scp.content.extract('//gs3').getStringVal () as gs3
    scp.content.extract('//gs4').getStringVal () as gs4
    IN l_id, l_gm1, l_gm2, l_gm3, l_gm4, l_gs1, l_gs2, l_gs3, l_gs4
    OF xxpm_sr_cost_prices_xml scp

    What does not work?

    Robbert cordially

    And I guess that the default namespace that you use in the XMLTABLE is also in the XML file?

    So, if I change the example to work with your query data...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select xmltype('
      2  
      3    
      4      
      5        83201
      6        20575.2
      7        20761.2
      8        41583.6
      9        46896
     10        51438
     11        51903
     12        103959
     13        117240
     14      
     15      
     16        83202
     17        81000
     18        0
     19        16200
     20        0
     21        202500
     22        0
     23        40500
     24        0
     25      
     26    
     27  ') as xml from dual)
     28  --
     29  -- END OF TEST DATA
     30  --
     31  SELECT x.*
     32  FROM t, XMLTable(
     33  XMLNamespaces(default 'http://developer.cognos.com/schemas/xmldata/1/'),
     34  '/dataset/data/row'
     35  passing t.xml
     36  columns Id number path '//Id'
     37  ,gm1 number path '//gm1'
     38  ,gm2 number path '//gm2'
     39  ,gm3 number path '//gm3'
     40  ,gm4 number path '//gm4'
     41  ,gs1 number path '//gs1'
     42  ,gs2 number path '//gs2'
     43  ,gs3 number path '//gs3'
     44* ,gs4 number path '//gs4') x
    SQL> /
    
            ID        GM1        GM2        GM3        GM4        GS1        GS2        GS3        GS4
    ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
         83201    20575.2    20761.2    41583.6      46896      51438      51903     103959     117240
         83202      81000          0      16200          0     202500          0      40500          0
    
    SQL>
    
  • Adding a data source XML in Obiee 11 g on Linux

    Hi guys, I need your help.

    I create a new database in the physical layer as XML.

    On the connection pool (named xml_source), I'll put the path to the XML file, inside the datasourse name, with this format: / u01/app/xmltest /.

    My test XML file is the following: xml_test.xml, so in the information in the table, I'll put the name of the XML like this: xml_test (without the xml extension)

    The issue is when I am issuing the SQL, the displayed error message says:
    Query Failed: [nQSError: 64023] cannot access the /u01/app/xmltest\xml_test.xml: no such file or directory

    As you can read in the error message there is a "-" just before the xml file. So Linux is not a '-' but a ' / ', why obiee puts a bad path? How can I 'know' obiee that there is a Linux environment not a Windows?

    Thank you in advance.

    Sorry for my mistake, but I found a named XML in the physical Table Properties tab. I put the full URL to the file and now I am able to issue sql to her queries. Thank you!

  • data export XML from Adobe Muse

    Hello

    A customer of our company works with Dreamweaver and wants to change the layout of the site and add some features. I like to think using Adobe Muse because its easy. But he would like to share some detail information on the site at the other site of the retail by using XML. is this possible in Adobe Muse?

    Hello

    Unfortunately, there is not a way to export in XML format. Muse allows you to export as html only

  • Received the error when transferring data from the database file

    Hello...

    I have my using SOA 10.1.3.1.0. I am trying to transfer the data from the CSV of the oracle database.

    The settings of connection in file xml oc4j DBA adapter file in the path C:\product\10.1.3.1\OracleAS_1\j2ee\oc4j_soa\application-deployments\default\DbAdapter is shown below.

    < location connector-factory = name of the connector "ist/DB/DBConnection1" = "Adapter database" >
    < config-property name = "xADataSourceName" value = "jdbc/DBConnection1DataSource" / >
    < config-property name = "dataSourceName" value = "loc/DBConnection1DataSource" / >
    < config-property name = "platformClassName" value="oracle.toplink.platform.database.Oracle9Platform"/ >
    < config-property name = "usesNativeSequencing" value = "true" / >
    < config-property name = "sequencePreallocationSize" value = "50" / >
    < config-property name = "defaultNChar" value = "false" / >
    < config-property name = "usesBatchWriting" value = "true" / >
    < connection pooling using 'none' = >
    < / connection pooling >
    < use security-config 'none' = >
    < / security-config >
    < / connector-factory >


    I get the following error:

    < name of part = "summary" >
    < Summary >
    file:/C:/product/10.1.3.1/OracleAS_1/BPEL/domains/default/tmp/.bpel_FileToDb_v1.0_188277739ed1e0b720c1fefd0275d1c0.tmp/FileToAdapterService.WSDL [FileToAdapterService_ptt::insert (FiletodbCollection)] - SISM JCA Execute of operation "insert" has no reason to: could not create/access the TopLink Session.
    This session is used to connect to the data store. Caused by: loc/DBConnection1DataSource not found
    ; nested exception is:
    ORABPEL-11622
    Could not create/access the TopLink Session.
    This session is used to connect to the data store. [Caused by: loc/DBConnection1DataSource not found]
    See the first exception for the specific exception. You may need to configure the connection settings in the deployment descriptor (i.e. $J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml), and then restart the server. Caused by the Exception TOPLINK-7060 (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.ValidationException

    Description of the exception: could not acquire data source loc/DBConnection1DataSource

    Inner exception: javax.naming.NameNotFoundException: loc/DBConnection1DataSource not found.
    < / Summary >
    < / part >


    What is the error in the loc/DBConnection1DataSource line? Guys thank you in advance...


    Thank you...

    Published by: userus007 on January 2, 2010 17:16

    Published by: userus007 on January 2, 2010 17:18

    Visit similar thread oc4j - RA.xml and data - sources.xml

  • Problems connecting to JDBC data source

    We have recently upgraded to JDeveloper 11 g to 10g and flies our applications (primarily the Struts). They are compiled fine, and I am able to create data sources and successfully test the connection to open the data source through the window of Application resources. The problem comes when I try to connect through the application. In Java code, I use a DataSource object to get the connection of InitialContext.lookup ("jdbc/sun_DS1") where the JNDI name is in parentheses. We used to define this connection in JDev 10 g via the file data - sources.xml and it worked very well. Now with 11g and defines the connection to the application, I don't know if I'm missing a step between the creation of the data source and run the application.

    The error I get is: javax.naming.NameNotFoundException: while trying to search for "jdbc.sun_DS1" did not find subcontext "jdbc." Solved "; rest the name "jdbc/sun_DS1.
    at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
    at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
    at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
    at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)

    I spent a lot of time reading Oracle help docs and Googling the problem without success.

    Help, please.

    Once you run your application on the WLS console launch (http://localhost:7101/console) and look to see if JDev created a data source for you in WLS.)
    You may need to add it manually.

  • SQL Query to retrieve data in XML format with several levels

    Hello

    I'm looking to help generate XML from Oracle database. The request must contain many levels of sub...

    For example.
    Create table inventory
    (Group varchar2 (10))
    category varchar2 (10),
    ProductName varchar2 (10),
    Detail varchar2 (10));

    The output should be also present below. The data must be multiple values for each item.

    < inventory >
    < name of group 'auto' = >
    < category name 'cars' = >
    < name productname = 'Seat' >
    < details > red color < / details >
    < details > 5 seats < / details >
    < / productname >
    < / category >
    < / Group >
    < / inventory >

    Please share your ideas by retrieving data in the XML structure using SQL or PL/SQL for oracle 10 g.

    Thank you and best regards,
    Siva.

    This?

    SQL> create table t as
    with t as (
     select 'automobiles' "GROUP", 'cars' category, 'seat' productname, 'color red' details from dual union all
     select 'automobiles', 'cars', 'seat', '5 seats' from dual union all
     select 'automobiles', 'cars', 'make', 'ford' from dual union all
     select 'automobiles', 'cars', 'make', 'Toyota' from dual union all
     select 'automobiles', 'Bus', 'Model', 'volvo' from dual union all
     select 'automobiles', 'flight', 'Airbus', '400 passenger' from dual union all
     select 'automobiles', 'flight', 'Airbus', '500 mph' from dual union all
     select 'HealthCare', 'Nutrition', 'centrum', 'Organic' from dual union all
     select 'HealthCare', 'Nutrition', 'centrum', 'Chemical' from dual union all
     select 'Computers', 'Software', 'Database', 'Oracle' from dual union all
     select 'Computers', 'Software', 'Database', 'sqlserver' from dual
    )
    select * from t
    /
    Createtable successfully completed.
    
    SQL> select xmlserialize (content x.column_value indent) xml
      from xmltable('element Inventory
                     {for $g in distinct-values(ora:view("t")/ROW/GROUP)
                       return element group
                          {attribute name {$g},
                            for $c in distinct-values(ora:view("t")/ROW[GROUP=$g]/CATEGORY)
                              return element category {attribute name {$c},
                                for $p in distinct-values(ora:view("t")/ROW[GROUP=$g and CATEGORY=$c]/PRODUCTNAME)
                                  return element productname {attribute name {$p},
                                    for $d in distinct-values(ora:view("t")/ROW[GROUP=$g and CATEGORY=$c and PRODUCTNAME=$p]/DETAILS)
                                      return element details {$d}
                                                             }
                                                      }
                          }
                     }') x
    /
    XML
    --------------------------------------------------------------------------------
    
      
        
          
            
    Oracle
    sqlserver
    Chemical
    Organic
    volvo
    Toyota
    ford
    5 seats
    color red
    400 passenger
    500 mph
    1 row selected.
  • Issue in economy/recovery of TEXT RICH in/from MySQL database

    Hello

    I am not able to save rich text (htm tag) to the database. When I save the text content rich in textfield to database, it is saved in plain text format, but not as rich text.

    When I select in the table. I'm getting Plain text but not rich.

    This could be a variable incompatibility. I traced a content rich text field to a column of type text variable. Please let me know what I do to store rich text mapped to the database.

    following commands I used...

    CREATE TABLE fordEformTC4

    (

    eformName VARCHAR (25),

    Fr1Value TEXT,

    Fr2Value TEXT,

    Fr3Value TEXT

    );

    I'm putting below the content of the column Fr1Value

    <? XML version = "1.0" encoding = "UTF-8" ?>

    - < TextField1 type of =" text " >

    - < body xmlns =" http://www.w3.org/1999/xhtml " >

    - < p style = " margin-top:0pt;margin-bottom:0pt;text-valign:middle;text-align:justify;font-family:'Myriad Pro'; do-size: 10pt; make-weight: bold; text-decoration: no " " >

    Problem

    < span style = » police-weight: normal""">to store the text in the database< /span>

    </p>

    </body>

    < / TextField1 >

    When I retrieve the XML from the database, I see clear...

    <? XML version = "1.0" encoding = "UTF-8"? >

    < form1 >

    < Page > 1

    < TextField1 type = "text" > problem by storing the text in the database < / TextField1 >

    < / TextField1 >

    < / Page1 >

    < / form1 >

    Please let me know what the problem is. What mistake I make in my design.

    Concerning

    Sunil


    I used the function serialize() and Deserialize () in the activity of Misc setValue to save and retrieve data xhtml from adobe to db.

    It has worked well.

    Concerning

    Sunil

  • Integration of data from external sources (xml, webservice)

    is it possible to supply the content of DPS to an XML (or other data source)?

    You cannot directly import XML or other data sources in DPS, however, there are many options for the style of the content into the system. Assuming that you are talking about DPS 2015, all what you need to do is to convert your data to HTML format, then use packaging article HTML tool to generate a .article to the HTML file. This can be a manual or automated process. For example, there are plugins for Wordpress that automate this workflow to make Wordpress posts and ingest them in 2015 of DPS.

    Neil

  • How to draw 16 signals from a simple 8 channel 2 Data Sources file?

    Matrix is an hour + 8 channels from a data source unique assyncronos; MSC is a XY Chart. This works well until now data records changed to 2 assyncronos sources. The format is now: where the data comes from (0,1) + time + 8 channels of data.

    Rgds,


  • Hello, a graphic designer created my logo. I need to change the color from black to white and then make it bigger so I can add it to a T-shirt. I looked online and can't find a way to do it. Please help :)

    Hello, a graphic designer created my logo. I need to change the color from black to white and then make it bigger so I can add it to a T-shirt. I looked online and can't find a way to do it. Help, please

    Guess that's your logo. His place of 1000px

    Select each layer, and then type cmd - I or ctrl-I on the keyboard and that will reverse the color of the objects on the layer. Black is the

    opposite of white

    And then resizing the image size under Select image menu and place values expanded in the dialog box

    as below.

    That's all. It may be useful

    Terri

  • How we change our plan of the plan from photography to plan student (all products)? I recently became a student in graphic design.

    How we change our plan of the plan from photography to plan student (all products)? I recently became a student in graphic design.

    Please contact Adobe support to terminate this program & re buy a new plan according to your choice.

    In case you are re buying a different plan, cancellation fees are waived off the coast.

    Concerning

    Stéphane

  • Delete zero of the rows from the data source target

    Hi all

    We have an ODI interface that loads data directly on a DB2/400 data source into an Essbase cube. The routine uses a SQL Server staging area. We are summarizing the source data and transforming before members of the load in Essbase. It is version 10.1.3.5.5 ODI.

    We would like to remove the zero lines created after the sum. Is it possible to do so within the same interface? We understood that we could accomplish this by dividing the interface into 2 parts: 1) load the source data in the staging area and 2) load data from the staging area into the target. We wonder if we can take advantage of the existing interface and somehow add a filter to the target data source.

    Thanks for your help,
    O

    "I pull out the filter on a column in the data source and then put the content of the declarations AMOUNT and CASE in there?"-Yes. Deepak may be just fine. Is it JDE G/L, a/c balance treatment?

  • map a java object to data from multiple data sources

    We have the requirement that the attributes in a domain class can come from data from multiple data sources. Is TopLink supports this type of mapping? Is it possible to do this mapping in the workbench?

    Thank you very much!

    Ming-Wen

    TopLink supports a feature of SessionBroker. This allows classes in the same session to come from different sources of data and for the relations between the classes of data sources. It does not allow a single instance of direct data from multiple data sources, but the Forum could have a link with its data in the other data source.

    ----
    James: http://www.eclipselink.org

Maybe you are looking for