Little help with complex XML data as data provider for chart and adg

Hi all,
I've been trying to think through a problem and Im hoping for
a little help. Here's the scenario:
I have complex nested XML data that is wrapped by subsequent
groupings for efficiency, but I need to determine if each inner
item belongs in the data collection for view in a data grid and
charts.
I've posted an example at the bottom.
So the goal here is to first be able to select a single
inspector and then chart out their reports. I can get the data to
filter from the XMLListCollection using a filter on the first layer
(ie the name of the inspector) but then can't get a filter to go
deeper into the structure in order to determine if the individual
item should be contained inside the collection. In other words, I
want to filter by inspector, then time and then tag name in order
to be able to use this data as the basis for individual series
inside my advanced data grid and column chart.
I've made it work with creating a new collection and then
looping through each time there is a change to the original
collection and updating the new collection, but that just feels so
bloated and inefficient. The user is going to have some buttons to
allow them to change their view. I'm wondering if there is a
cleaner way to approach this? I even tried chaining filter
functions together, but that didn't work cause the collection is
reset whenever the .refresh() is called.
If anyone has experience in efficiently dealing with complex
XML for charting purposes and tabular display purposes, I would
greatly appreciate your assistance. I know I can get this to work
with a bunch of overhead, but I'm seeking something elegant.
Thank you.

Hi,
Please use the code similar to below:
SELECT * FROM DO_NOT_LOAD INTO TABLE IT_DO_NOT_LOAD.
SORT IT_DO_NOT_LOAD by WBS_Key.
    IF SOURCE_PACKAGE IS NOT INITIAL.
      IT_SOURCE_PACKAGE[] = SOURCE_PACKAGE[].
LOOP AT IT_SOURCE_PACKAGE INTO WA_SOURCE_PACKAGE.
        V_SYTABIX = SY-TABIX.
        READ TABLE IT_DO_NOT_LOAD into WA_DO_NOT_LOAD
        WITH KEY WBS_Key = WA_SOURCE_PACKAGE-WBS_Key
        BINARY SEARCH.
        IF SY-SUBRC = 0.
          IF ( WA_DO_NOT_LOAD-WBS_EXT = 'A' or WA_DO_NOT_LOAD-WBS_EXT = 'B' )     
          DELETE IT_SOURCE_PACKAGE INDEX V_SYTABIX.
        ENDIF.
ENDIF.
      ENDLOOP.
      SOURCE_PACKAGE[] = IT_SOURCE_PACKAGE[].
    ENDIF.
-Vikram

Similar Messages

  • Little help with FORM POST data not in UTF-8 (JSP/servlet)

    Hello,
    I am trying to update a MySQL database record with UTF-8 characters with my JSP application.
    1) I have MySQL correctly configured to handle UTF8 and have tested insert/update/select with UTF8 characters
    2) I have an "editRecord.jsp" page. At the top of the page, I specify:
    <% request.setCharacterEncoding("UTF-8"); %>
    3) I have an input form which is specified in that page which follows:
    <form action="<c:url value="/updateRecord.jsp"/>"
    name="updatetForm" method="post"
    ACCEPT-CHARSET="UTF-8"
    enctype="multipart/form-data">
    4) I have a servlet filter that takes every HttpServletRequest and modifies that object in
    doFilter(...){
    request.setCharacterEncoding("UTF-8");
    chain.doFilter(...)
    5) In updateRecord.jsp, I fill a JavaBean with the form data. Here's an example of the form input:
    name = Company
    Comments=Here's some unicode text: "&#1610;&#1606;&#1610; &#1573;&#1606; &#1576;&#1604;&#1575;&#1583;&#1607; &#1605;
    6) When I put a breakpoint and inspect the contents of the UpdateBean after posting the form, running the request through the filter, I see
    I see:
    name = Company
    Comments=Here's some unicode text: &#132;������...."
    Where could I possibly be missing something to force UTF8 encoding of these values?

    If you have to use the following code to fix the encoding:
    String value = new String(item.getString().getBytes("ISO-8859-1"), "UTF-8"); ...
    then you are just putting a band aid on something that is broken somewhere else (since this code creates a byte array in 8859-1 and then creates a string from that byte array, but assuming that the array is encoded in UTF-8). That will only work if the string you start out with is mangled.
    In many cases such a fix will actually "work" (in the sense that you may end up with something that is correctly encoded in the end), but you run the risk of breaking if the source of the original corruption is removed.

  • Using Non-destructive filter with Nested XML data

    Hi,
    How do you use Non-destructive filter with Nested XML data?
    I am using the non-destructive filter sample with my own xml which is setup to search for the <smc></smcs> in my xml below. But when i test it it only searches the last row of the "smc". How can i make it work so it can search for repeating nodes? or does it have something to with how my xml is setup?
        <ja>
            <url>www.sample.com</url>
            <jrole>Jobrole goes here</jrole>
            <prole>Process role goes here...</prole>
            <role>description...</role>
            <prole>Process role goes here...</prole>
            <role>description....</role>
            <prole>Process role goes here...</prole>
            <role>description...</role>
            <sjc>6K8C</sjc>
            <sjc>6B1B</sjc>
            <sjc>6B1F</sjc>
            <sjc>6B1D</sjc>
            <smc>6C9</smc>
            <smc>675</smc>
            <smc>62R</smc>
            <smc>62P</smc>
            <smc>602</smc>
            <smc>622</smc>
            <smc>642</smc>
            <smc>65F</smc>
            <smc>65J</smc>
            <smc>65L</smc>
            <smc>623</smc>
            <smc>625</smc>
            <smc>624</smc>
            <smc>622</smc>
            <audience>Target audience goes here....</audience>
        </ja>
    here is the javascript that runs it.
    function FilterData()
        var tf = document.getElementById("filterTF");
        if (!tf.value)
            // If the text field is empty, remove any filter
            // that is set on the data set.
            ds1.filter(null);
            return;
        // Set a filter on the data set that matches any row
        // that begins with the string in the text field.
        var regExpStr = tf.value;
    if (!document.getElementById("containsCB").checked)
            regExpStr = "^" + regExpStr;
        var regExp = new RegExp(regExpStr, "i");
        var filterFunc = function(ds, row, rowNumber)
            var str = row["smc"];
            if (str && str.search(regExp) != -1)
            return row;
            return null;
        ds1.filter(filterFunc);
    function StartFilterTimer()
        if (StartFilterTimer.timerID)
            clearTimeout(StartFilterTimer.timerID);
        StartFilterTimer.timerID = setTimeout(function() { StartFilterTimer.timerID = null; FilterData(); }, 100);
    I really need help on this, or are there any other suggestions or samples that might work?
    thank you!

    I apologize, im using Spry XML Data Set. i guess the best way to describe what im trying to do is, i want to use the Non-desctructive filter sample with the Spry Nested XML Data sample. So with my sample xml on my first post and with the same code non-destructive filter is using, im having trouble trying to search repeating nodes, for some reason it only searches the last node of the repeating nodes. Does that make sense? let me know.
    thank you Arnout!

  • Problem with load XML data

    Hi.
    I have a problem this load XML data. For example: file name:
    01-05-2008.xml => in this file all data have date=01.05.2008.
    Once i load period 01.05.2008 to 10.05.2008 my app load 10 files.
    Sometimes some row this greater date stay earlier then row this
    smaller date. I don't know why this happend. Bellow part of code.
    Please help.
    P.S. sorry for my very bad english.

    Hi Lekser,
    ntsii is totally right.
    Calling httpservice send is a async operation, which means
    you don´t know when the result event of such operation will
    return.
    You can also sort your grid after a xml data file was loaded.
    At least it would guarantee that the entries appear in the
    right order.
    best regards,
    kcell

  • Xml publisher enterprise!!! create rtf file dynamically with load xml data

    i am new to xml publisher enterprise , i want a solution for this question ...
    i want create rtf file dynamically with loading xml data....means i wrote a program in jsp where the the output in xml file simultaneously create rtf file..but i enable load the xml data in rtf file but when i goto rtf file from where data in that load xml then it genrate the columns..but i want in dynamiclly to load the data will you please guide me ......

    Hi Atiq
    Im not quite clear on the requirement here:
    1. Do you just want to be able to extract the data and apply a template to the XML data from your jdp and render output?
    If so then you can use the XMLP APIs ... the are in the user guide. Particularly:
    RTFProcessor - converts RTF template to XSLFO stylesheet
    FOProcessor - takes, XML data, XSLFO stylesheet and output format and generates the required output.
    2. Do you want a template that will accept any data and just format it into rows and columns ? This can be written but your XML structure is going to have to be static, the data of course can be dynamic.
    Regards, Tim

  • Hi to all... What is a  XML data provider,stored Procedure, personal data

    Hi to all... What is a  XML data provider,stored Procedure, personal data providers in deski.  when we use these data provider in desk top intelligence.. and use of it.
    Please give detail description of the above...
    Thanks for reply..........

    Hi,
    We can create Desktop Intelligence reports using XML Data Provider, Personal Data Files and Stored Procedure.
    Following is some detailed information about these three.
    Xml data provider:
    Xml data provider is used for the integration of external data sources stored in XML format.
    This is similar to HTML.
    Stored Procedure:
    A stored procedure is a set of SQL commands that has been compiled and stored on the database server.
    Once the stored procedure has been "stored", client applications can execute the stored procedure over and over again without sending it to the database server again and without compiling it again.
    Stored procedures improve performance by reducing network traffic and CPU load.
    Personal data files:
    u2022     *.prn files
         A PRN file is a special type of file which contains instructions for a printer, it tells the printer what to print on the page and where as well as which paper tray to use, what the paper size is and a number of other controls.
    u2022     *.asc files
          Between the values of a row any number of carriage returns  or blanks are allowed. In any case it is strongly recommended that the data table be stored in such a way that it can be read and edited easily.
           The values may be stored in any format (integer, floating point, exponential notation) and they must be separated at least by one blank. The class information must be of integer type, the row identifiers are interpreted as strings. The lines can have any length and must not contain any comment.
    u2022     *.csv files
    A CSV file is a specially formatted plain text file which stores spreadsheet or basic database-style information in a very simple format, with one record on each line, and each field within that record separated by a comma.
    Regards,
    Pradnya Kokil

  • Can Discoverer be used as an XML Data source for XMLP ?

    I am wondering if Discoverer can generate an XML Data Source for XMPL.
    I have heard that Discoverer Viewer can have XML as an output. Is there a way of using this XML output with XMLP and, if yes, how to batch both steps ?

    Hi
    My understanding is that Discoverer does not generate XML data as an ouput that XMLP can consume. The XML is does generate is actually an XML RDF for Oracle Reports.
    XMLP is integrated thou, when you export your Disco report to PDF thats XMLP doing the conversion to PDF for you.
    Regards, Tim

  • ComboBox XML Data Provider

    Hello all,
    I'm having trouble creating an XML data provider to use for a
    ComboBox. Below is what I've done:
    XML data I get from Rails server:
    <states>
    <state name="Arizona" id="1" />
    </states>
    CDATA:
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    [Bindable] private var stateData:ArrayCollection;
    private function getStates(event:ResultEvent):void {
    stateData = (event.result as XML).states.state;
    state.dataProvider = stateData;
    state.labelField = "name";
    state.data = "id";
    <mx:ComboBox id="state" />
    This compiles, but when I run it, I don't get anything in the
    ComboBox. I know I'm getting data from the server, because I can
    set the data provider for the ComboBox to be event.result and I see
    all the resulting XML in the ComboBox.
    Please help!!! What am I doing wrong here?!
    Thanks in advance! -- BTR

    Hey Vygo,
    Thanks for the suggestion. I'll try it out and let you know
    how it goes. However, I was worried about the attributes so I tried
    it using regular elements as well, but to no avail. Anyway, I'll
    get back to you once I have a chance to try out your suggestion.
    Thanks again! -- BTR

  • Error using an XML as data provider for either datagrid or linechart

    Hi,
    I am developing an application using Flex and Java servlets.
    Upon user
    event, I load the data using the servlet and store the data
    in a
    Dictionary. I am running into couple of issues from here
    a. If I try to use the XML object in the dictionary as the
    data provider
    for either Datagrid or Linechart I am unable to view the
    data. I did a
    trace on the object and it has the correct data.
    b. Also, I am unable to access the content of child elements
    when using
    a parent element as the data provider.
    ex. parent. child1. child2 does not work, it works when I
    provide child2
    as the dataprovider directly.
    Please let me know what might be the root causes and
    resolutions.
    Thanks in advance,
    Nataraj

    I did not find a solution to the problem and created a list
    of the child objects and used that as the source instead of the top
    level XML object. This worked.

  • Need a little Help with my new xfi titanium

    +Need a little Help with my new xfi titanium< A few questions here.
    st question? Im using opt out port on the xfi ti. card and using digital li've on a windows 7 64 bit system,? I would like to know why when i use 5. or 7. and i check to make sure each speakear is working the rear speakers wont sound off but the sr and sl will in replace of the rear speakers. I did a test tone on my sony amp and the speaker are wired correctly becasue the rear speakers and the surrond? left and right sound off when they suppose too. Also when i try to click on? the sl and sr in the sound blaster control panel they dont work but if i click on the rear speakers in the control panel the sl and sr sound off. Do anyone know how i can fix this? So i would like to know why my sl and sr act like rears when they are not?
    2nd question? How do i control the volume from my keyboard or from windows period when using opt out i was able to do so with my on board? sound max audio using spidf? Now i can only control the audio using the sony receiver.
    Thank you for any help..

    /Re: Need a little Help with my new xfi titanium? ?
    ZDragon wrote:
    I'm unsure about the first question. Do you even have a 7. system and receiver? If you just have 5., you should be able to remap the audio in the THX console.
    I do have a sony 7. reciever str de-995 its an older one but its only for my cpu. At first i didnt even have THX installed because it didnt come with the driver package for some reason until i downloaded the daniel_k support drivers and installed it. But it doesnt help in anyway.
    I have checked every where regarding the first question and alot of people are having problems getting sound out of there rear channels and the sound being re-mapped to the surround right and the surround left as if there rear left and rear right.
    I read somewhere that the daniel_k support drivers would fix this but it didnt for me and many others.
    For the second question i assumed it would be becasue of the spidf pass through and that my onboard sound card was inferior to the xfi titaniums. But i wasnt sure and i was hopeing that someone would have a solution for that problem because i miss controlling the volume with my keyboard.

  • Need a little help with syncing my iPod.

    I got a new macbook pro for cristmas and a few cds. After i tried to sync my ipod to itunes i put a symbol next to each song that i got from other cds saying that they were downloading but they werent. Also the cds i downloaded to my ipod for the first time didnt appear at all. Need help.

    /Re: Need a little Help with my new xfi titanium? ?
    ZDragon wrote:
    I'm unsure about the first question. Do you even have a 7. system and receiver? If you just have 5., you should be able to remap the audio in the THX console.
    I do have a sony 7. reciever str de-995 its an older one but its only for my cpu. At first i didnt even have THX installed because it didnt come with the driver package for some reason until i downloaded the daniel_k support drivers and installed it. But it doesnt help in anyway.
    I have checked every where regarding the first question and alot of people are having problems getting sound out of there rear channels and the sound being re-mapped to the surround right and the surround left as if there rear left and rear right.
    I read somewhere that the daniel_k support drivers would fix this but it didnt for me and many others.
    For the second question i assumed it would be becasue of the spidf pass through and that my onboard sound card was inferior to the xfi titaniums. But i wasnt sure and i was hopeing that someone would have a solution for that problem because i miss controlling the volume with my keyboard.

  • My iphone has synced with a later date than photos taken and now cant get resent photos back?

    my iphone has synced with a later date than photos taken and now cant get photos recently taken same with messages :-(

    iDevices do not sync with a date... they sync with the computer.
    If the user has restored the device using an older backup, simply restore it with a more current backup.

  • How can I do for a row of a query be data provider for a variable?

    Hi friends, I have a problem !
    How can I do for a row of a query be data provider for a variable?
    I need that a value of variable be stored when the user select a row in a query. At the BPS we can do this configuring the variable selector in WIB, and in a WAB how I can do this ?
    Best regards,
    Gustavo Liberado

    In this case when I press the key to call other forms I need to wait for the response in the secondary form and then process the result.That is exactly what a "modal JDialog" (or JOptionPane) are used for.
    Try it. Create a short demo program. All you need is a JFrame with a single button to show the modal dialog. All you modal dialog needs is a single button to close the dialog. After you show the modal dialog add a System.out.println(...) statement in your code and you will see that it is not executed until the dialog is closed.
    Then once you understand the basics you add the code to your real program.
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Create withholding tax data subsequently for reconciled and open items in c

    Hi All,
    Mine is a US co code and I have a  vendor for which invoice and payment documents are posted. After posting the invoice i found that the vendor is subjected to classic withholding tax which i did not calculate when posting invoice, making payments.
    Now i have changed the vendor master data with relevant withholding tax details.
    I know the program RFWT0020 allows us to create withholding tax data subsequently for reconciled and open items in cases where vendors or customers become liable for withholding tax with a tax rate of 0 %.
    It is not working out for me.
    Can any body help me on this.
    Thanks in advance.

    Dear all,
    by se38 --> report documentation, You can read carefully the following:
    The auxiliary program makes it possible to convert both classic and extended withholding tax data. However, with classic withholding tax, ONLY VENDOR data can be converted.
    In addition, the program enables the withholding tax code to be changed for reconciled and open items with existing withholding tax data. For this, the tax rate of the existing withholding tax data as well as the tax rate of the new withholding tax code must be 0%. The new withholding tax codes are taken from the customer or vendor master data. In the case of extended withholding tax, the withholding tax code is only changed if the related withholding tax categories are the same.  The withholding tax base amount is not changed by this procedure.
    Recreating or changing the withholding tax data requires that the program first be executed for INVOICES and then executed for PAYMENTS in a subsequent step.
    I hope this helps You.
    Mauri

  • Using HTTPService as data provider for mx:ComboBox

    Hello all,
    I'm trying to use an HTTPService as a data provider for an
    mx:ComboBox. Here's how I have my HTTPService configured:
    <mx:HTTPService id="listStates" url="
    http://localhost:3006/state/list"
    useProxy="false" method="GET" />
    I have a Rails backend setup and talking to a database on my
    local machine. I have a list of states in a table in my database,
    and the table has two columns: id and name. When I go to
    localhost:3006/state/list in my browser, I get the following XML:
    <states>
    <state>
    <id type="integer">1</id>
    <name>New Mexico</name>
    </state>
    <state>
    <id type="integer">2</id>
    <name>Arizona</name>
    </state>
    </states>
    I have my mx:ComboBox set up like so:
    <mx:ComboBox width="199" id="state" dataProvider="{
    listStates.lastResult.states.state }" />
    However, when I browse to my .swf file, my state combo box
    shows [object Object] twice in the drop-down list. Anyone have any
    idea why it's not parsing the data correctly? Any suggestions on
    how to make it work?
    Thanks in advance!!! -- BTR

    Alright I worked one out for you. Let me know if you have any
    questions.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="dropDown.send()">
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    public var dropArr:XML;
    public function get_drop_down(e:ResultEvent):void{
    dropArr = e.result as XML;
    state.dataProvider = dropArr.state;
    state.labelField = "name";
    state.data = "id";
    ]]>
    </mx:Script>
    <mx:HTTPService id="dropDown" useProxy="false"
    url="
    http://localhost/dropDown.php"
    resultFormat="e4x"
    result="get_drop_down(event)" />
    <mx:ComboBox width="199" id="state" />
    </mx:Application>

Maybe you are looking for