Problem in filling jasper report with XML Data source

Hello!
I am trying to build a report uxing xml data source..Please verify following code:
String outFileName = "c:/Report1.pdf";
File xmlFileName = new File("C:/Program Files/JasperSoft/iReport-1.2.5/report.jrxml");
String recordPath = "/SiteDetails/Site";
JasperDesign jasperDesign = JRXmlLoader.load(xmlFileName);
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
JRXmlDataSource jrxmlds = new JRXmlDataSource(new File("c:/NewSite.xml"),recordPath);
HashMap hm = new HashMap();
try
JasperPrint print = JasperFillManager.fillReport(jasperReport,hm,jrxmlds);
JRExporter exporter = new net.sf.jasperreports.engine.export.JRPdfExporter();
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,outFileName);
exporter.setParameter(JRExporterParameter.JASPER_PRINT,print);
exporter.exportReport();
catch (JRException jre)
jre.printStackTrace();
catch (Exception e)
e.printStackTrace();
My Xml file is:
<?xml version="1.0" encoding="UTF-8"?>
<SiteDetails>
<Site>
<Name>Site1</Name>
<Addr>Bangalore</Addr>
<supersiteid>null</supersiteid>
</Site>
<Site>
<Name> Site2</Name>
<Addr> Madras</Addr>
<supersiteid>Site1</supersiteid>
</Site>
</SiteDetails>
I want to display details of Siteand Address..My program works fine but displays only 1 (first) record...What should i do to display the full file..do i need to navigate thru the file and give that as an input to fillReport ()method...

Hi,
Have a look at below URL.
http://ireport.sourceforge.net/cap7.html#7.4
Regards
VInK

Similar Messages

  • Jasper Report with XML data Source problem

    I have a problem in getting a report run on my machine..
    I have a report that uses XML-dataSource to read info stored in xml file, I use XPath query to traverse xml nodes,
    I have JBoss Server installed but the problem is that I want to know how to configure JBoss and tell it where to look for the xml file so the report can produce right information.
    I use Windows XP and JBoss 4.23 and I finished the report using i-report 2.0.2
    please I need the configuration steps to make this report work... thanx in advance

    Hi,
    Have a look at below URL.
    http://ireport.sourceforge.net/cap7.html#7.4
    Regards
    VInK

  • How to create a report using XML data source from Crystal Report Designer

    Hi,
    Iu2019m having Crystal Report Designer XI R2 SP4. Iu2019m trying to create a report using XML data source stored on disk. This is a customer order report and the xml is structured in such a way that it has an order details header part (master) and then it has several order lines (detail). One order line can have several order line characteristics (detail-detail). So what I need to know is now I can design this layout from the designer. If this was done using views I can do it with sub-reports but using xml data this seems to be different. Can you help me to design this layout? I have included the xml and xsd as well.
    Thank you in advance.
    Regards,
    Chanaka
    XML
    <?xml version="1.0" encoding="UTF-8"?>
    <CUSTOMER_ORDER_CONF_REP_REQUEST xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns="urn:ifsworld-com:customer_order_conf_rep">
        <CUSTOMER_ORDER_CONF_REP>
            <ORDER_NO>D555809</ORDER_NO>
            <PRINTED_DATE>2009-03-26T08:52:54</PRINTED_DATE>
            <AUTHORIZE_NAME>Chanaka</AUTHORIZE_NAME>
            <CUSTOMER_NO>CU-1473-INV</CUSTOMER_NO>
            <CUST_NAME>Mr.Johan Matts</CUST_NAME>
            <SHIP_ADDR_1>93,Main Street</SHIP_ADDR_1>
            <SHIP_ADDR_2>Negambo Road</SHIP_ADDR_2>
            <SHIP_ADDR_3>Watthala</SHIP_ADDR_3>
            <SHIP_ADDR_4>SRI LANKA</SHIP_ADDR_4>
            <BILL_ADDR_1>93,Main Street</BILL_ADDR_1>
            <BILL_ADDR_2>Negambo Road</BILL_ADDR_2>
            <BILL_ADDR_3>Watthala</BILL_ADDR_3>
            <BILL_ADDR_4>SRI LANKA</BILL_ADDR_4>
            <CUSTOMER_PO_NO>112984638</CUSTOMER_PO_NO>
            <CUSTOMER_FAX>112984639</CUSTOMER_FAX>
            <CUSTOMER_EMAIL>abcbababab</CUSTOMER_EMAIL>
            <ORDER_LINES>
                <ORDER_LINE>
                    <LINE_NO>1</LINE_NO>
                    <CUSTOMER_PART_NO>NW-IP11</CUSTOMER_PART_NO>
                    <CUSTOMER_PART_DESC>iPod</CUSTOMER_PART_DESC>
                    <SALE_UNIT_PRICE>1200</SALE_UNIT_PRICE>
                    <PRICE_TOTAL>1200</PRICE_TOTAL>
                    <DISCOUNT>0</DISCOUNT>
                    <PRICE_QTY>1</PRICE_QTY>
                    <ORDER_LINE_CHARACTERSTICS>
                        <CHARACTERISTIC_ITEM>
                            <CHARACTERISTIC_ID xsi:nil="1"/>
                            <CHARACTERISTIC_VALUE xsi:nil="1"/>
                        </CHARACTERISTIC_ITEM>
                    </ORDER_LINE_CHARACTERSTICS>
                </ORDER_LINE>
                <ORDER_LINE>
                    <LINE_NO>2</LINE_NO>
                    <CUSTOMER_PART_NO>NW-IP24</CUSTOMER_PART_NO>
                    <CUSTOMER_PART_DESC>XGA Projector</CUSTOMER_PART_DESC>
                    <SALE_UNIT_PRICE>500</SALE_UNIT_PRICE>
                    <PRICE_TOTAL>1500</PRICE_TOTAL>
                    <DISCOUNT>0</DISCOUNT>
                    <PRICE_QTY>3</PRICE_QTY>
                    <ORDER_LINE_CHARACTERSTICS>
                        <CHARACTERISTIC_ITEM>
                            <CHARACTERISTIC_ID>1</CHARACTERISTIC_ID>
                            <CHARACTERISTIC_VALUE>Free Instalation</CHARACTERISTIC_VALUE>
                        </CHARACTERISTIC_ITEM>
                    </ORDER_LINE_CHARACTERSTICS>
                </ORDER_LINE>
                <ORDER_LINE>
                    <LINE_NO>3</LINE_NO>
                    <CUSTOMER_PART_NO>NW-IP02</CUSTOMER_PART_NO>
                    <CUSTOMER_PART_DESC>Sony DVD Player</CUSTOMER_PART_DESC>
                    <SALE_UNIT_PRICE>1000</SALE_UNIT_PRICE>
                    <PRICE_TOTAL>1000</PRICE_TOTAL>
                    <DISCOUNT>0</DISCOUNT>
                    <PRICE_QTY>1</PRICE_QTY>
                    <ORDER_LINE_CHARACTERSTICS>
                        <CHARACTERISTIC_ITEM>
                            <CHARACTERISTIC_ID>1</CHARACTERISTIC_ID>
                            <CHARACTERISTIC_VALUE>Free 5 DVDs</CHARACTERISTIC_VALUE>
                        </CHARACTERISTIC_ITEM>
                    </ORDER_LINE_CHARACTERSTICS>
                </ORDER_LINE>
                <ORDER_LINE>
                    <LINE_NO>4</LINE_NO>
                    <CUSTOMER_PART_NO>NW-IP99</CUSTOMER_PART_NO>
                    <CUSTOMER_PART_DESC>Flatscreen TV</CUSTOMER_PART_DESC>
                    <SALE_UNIT_PRICE>1500</SALE_UNIT_PRICE>
                    <PRICE_TOTAL>1350</PRICE_TOTAL>
                    <DISCOUNT>10</DISCOUNT>
                    <PRICE_QTY>1</PRICE_QTY>
                    <ORDER_LINE_CHARACTERSTICS>
                        <CHARACTERISTIC_ITEM>
                            <CHARACTERISTIC_ID>1</CHARACTERISTIC_ID>
                            <CHARACTERISTIC_VALUE>Free Delivery</CHARACTERISTIC_VALUE>
                        </CHARACTERISTIC_ITEM>
                        <CHARACTERISTIC_ITEM>
                            <CHARACTERISTIC_ID>2</CHARACTERISTIC_ID>
                            <CHARACTERISTIC_VALUE>1 year additional warranty</CHARACTERISTIC_VALUE>
                        </CHARACTERISTIC_ITEM>
                    </ORDER_LINE_CHARACTERSTICS>
                </ORDER_LINE>
                <ORDER_LINE>
                    <LINE_NO>5</LINE_NO>
                    <CUSTOMER_PART_NO>NW-IP56</CUSTOMER_PART_NO>
                    <CUSTOMER_PART_DESC>Sony MP3 Player</CUSTOMER_PART_DESC>
                    <SALE_UNIT_PRICE>200</SALE_UNIT_PRICE>
                    <PRICE_TOTAL>400</PRICE_TOTAL>
                    <DISCOUNT>0</DISCOUNT>
                    <PRICE_QTY>2</PRICE_QTY>
                    <ORDER_LINE_CHARACTERSTICS>
                        <CHARACTERISTIC_ITEM>
                            <CHARACTERISTIC_ID>1</CHARACTERISTIC_ID>
                            <CHARACTERISTIC_VALUE>Free carry belt</CHARACTERISTIC_VALUE>
                        </CHARACTERISTIC_ITEM>
                        <CHARACTERISTIC_ITEM>
                            <CHARACTERISTIC_ID>2</CHARACTERISTIC_ID>
                            <CHARACTERISTIC_VALUE>Free promotional 4GB memory bar</CHARACTERISTIC_VALUE>
                        </CHARACTERISTIC_ITEM>
                        <CHARACTERISTIC_ITEM>
                            <CHARACTERISTIC_ID>3</CHARACTERISTIC_ID>
                            <CHARACTERISTIC_VALUE>No warranty on memory bar</CHARACTERISTIC_VALUE>
                        </CHARACTERISTIC_ITEM>
                    </ORDER_LINE_CHARACTERSTICS>
                </ORDER_LINE>
            </ORDER_LINES>
        </CUSTOMER_ORDER_CONF_REP>
    </CUSTOMER_ORDER_CONF_REP_REQUEST>
    XSD
    <?xml version="1.0" encoding="UTF-8"?>
    <?report  module="ORDER" package="CUSTOMER_ORDER_CONF_REP" ?>
    <xs:schema targetNamespace="urn:ifsworld-com:customer_order_conf_rep" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:ifsworld-com:customer_order_conf_rep" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="CUSTOMER_ORDER_CONF_REP_REQUEST">
    <xs:complexType>
    <xs:all minOccurs="1" maxOccurs="1">
    <xs:element name="CUSTOMER_ORDER_CONF_REP">
    <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="50">
    <xs:element name="ORDER_NO" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="PRINTED_DATE" type="xs:dateTime" nillable="true" minOccurs="0"/>
    <xs:element name="AUTHORIZE_NAME" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="CUSTOMER_NO" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="CUSTOMER_PO_NO" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="CUST_NAME" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="SHIP_ADDR_1" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="SHIP_ADDR_2" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="SHIP_ADDR_3" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="SHIP_ADDR_4" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="BILL_ADDR_1" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="BILL_ADDR_2" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="BILL_ADDR_3" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="BILL_ADDR_4" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="CUSTOMER_FAX" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="CUSTOMER_EMAIL" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="ORDER_LINES" nillable="true" minOccurs="0">
    <xs:complexType>
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:element name="ORDER_LINE">
    <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="39">
    <xs:element name="LINE_NO" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="SALE_UNIT_PRICE" type="xs:float" nillable="true" minOccurs="0"/>
    <xs:element name="PRICE_TOTAL" type="xs:float" nillable="true" minOccurs="0"/>
    <xs:element name="DISCOUNT" type="xs:float" nillable="true" minOccurs="0"/>
    <xs:element name="PRICE_QTY" type="xs:float" nillable="true" minOccurs="0"/>
    <xs:element name="CUSTOMER_PART_NO" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="4000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="CUSTOMER_PART_DESC" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="4000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="ORDER_LINE_CHARACTERSTICS" nillable="true" minOccurs="0">
    <xs:complexType>
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:element name="CHARACTERISTIC_ITEM">
    <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="6">
    <xs:element name="CHARACTERISTIC_ID" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="CHARACTERISTIC_VALUE" nillable="true" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2000"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
    </xs:all>
    </xs:complexType>
    </xs:element>
    </xs:schema>

    Hi Sourashree,
    Thank you for the response and ideas you have given me so far. I can get the fetch the data from the data source without any problem. That is I do the following,
    1.     New Report
    2.     From Create New Connection-> XML
    3.     Provide the u201CLocal XML Fileu201D and have u201CSpecify Schema Fileu201D checked -> Next
    4.     Provide the u201CLocal Schema Fileu201D  -> Finish
    Then I can see the following under XML
    + CUSTOMER_ORDER_CONF_REP_REQUEST
            CUSTOMER_ORDER_CONF_REP_REQUEST
         CUSTOMER_ORDER_CONF_REP_REQUEST/CUSTOMER_ORDER_CONF_REP
         CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES
         CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES/ORDER_LINE
         CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES/ORDER_LINE/ORDER_LINE_CHARACTERSTICS
         CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES/ORDER_LINE/ORDER_LINE_CHARACTERSTICS/CHARACTERSTIC_ITEM
    And from here if I add the following three I can get all the fields I need to the report
         CUSTOMER_ORDER_CONF_REP_REQUEST/CUSTOMER_ORDER_CONF_REP
         CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES/ORDER_LINE
         CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES/ORDER_LINE/ORDER_LINE_CHARACTERSTICS/CHARACTERSTIC_ITEM
    Then I come to the Linking section. Here I canu2019t link anything. There is a common field called u201CInternal_IDu201D but I canu2019t link using it. So I get a message when I click Next. From here I add all the fields.
    For this point onwards only I need help. How do I group, add fields and design the layout so I can get an report output as follows.
    Date
    Order number                                   Authorized code
    Customer No
    Name
    Phone
    Fax email
    Shipping address 1                              Billing Address 1
    Shipping address 2                              Billing Address 2
    Shipping address 3                              Billing Address 3
    Shipping address 4                              Billing Address 4
    Order Line 1 detailsu2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026                      LINE_NO     CUSTOMER_PART_NO          CUSTOMER_PART_DESC     SALE_UNIT_PRICE     PRICE_QTY     DISCOUNT     PRICE_TOTAL
    Characteristic details belonging to Order line 1       CHARACTERISTIC_ID 1  CHARACTERISTIC_VALUE1
                                           CHARACTERISTIC_ID 2  CHARACTERISTIC_VALUE2
                                           CHARACTERISTIC_ID 3  CHARACTERISTIC_VALUE3
    Order Line 2 detailsu2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
    Characteristic details belonging to Order line 2
    Order Line 3 detailsu2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
    Characteristic details belonging to Order line 3
    Order Line 4 detailsu2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
    Characteristic details belonging to Order line 4
    Order Line 5 detailsu2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
    Characteristic details belonging to Order line 5
    How can I achieve this kind of a layout using the give xml and xsd? Should I use grouping if so how should I do the grouping?
    I have included the full xml and xsd in the first mail I posted but I canu2019t see it now. I can include that again if you want.
    Regards,
    Chanaka

  • BI+ Reporting With Multiple Data Sources

    Hi -
    We've been using BI+ Reports with multiple data sources on separate grids. We are wondering if there is a better way to ensure the user has their point of view bar in sync between the the data sources. In our case, both Data Sources are separate HFM applications with all the dimensions identical except the account which is defined on the report. We are not using Metadata Management.
    I'm aware of the "Merge Equivalent Prompts" in the Preferences > Financial Reporting window, but this does not always ensure the users have the same point of view.
    What practice are other companies using to make sure the user runs the reports accurately with both point of view bars pulling the same entity/year/period.
    Thanks in advance.

    Thanks for your answer, however my question - I know it looks quite messy - is not directly related to data templates, my problem is that at the moment I am using a stored procedure following - almost exactly - what another procedure does in oracle EBS to call a BI publisher report.
    1. This procedure populates some temporary table with the xml data where the concurrent request picks it up and uses it to populate the BI publisher template.
    2. However I can't go and specify the XML location in my data template as this is not an option for us (i.e. reading the xml from the temporary table), so I am looking for another way to populate the BI publisher template (Note: I can't as well include the SQL queries in my Data template).
    Thanks ;)

  • XmlDataProvider .... is gone completely in my Xaml file. Why? How many different ways to deal with xml data source through WPF

    I followed a procedure described in a book.
    1. insert "Inventory.xml" file to a project "WpfXmlDataBinding" .
    2. add the XML data source through the data panel of "blend for 2013", named it "InventoryXmlDataStore" and store it in the current document.
    3. dragged and droppped the nodes from the Data panel onto the artboard.
    Then I checked my Xaml file against the one provided by the book
    Xaml file by the book:
    <Window.Resources>
    <!-- This part is missing in my xaml file --><XmlDataProvider x:Key="InventoryDataSource"
    Source="\Inventory.xml"
    d:IsDataSource="True"/>
    <!-- This part is missing in my xaml file -->
    <DataTemplate x:Key="ProductTemplate">
    <StackPanel>
    <TextBlock Text="{Binding XPath=@ProductID}"/>
    <TextBlock Text="{Binding XPath=Cost}"/>
    <TextBlock Text="{Binding XPath=Description}"/>
    <CheckBox IsChecked="{Binding XPath=HotItem}"/>
    <TextBlock Text="{Binding XPath=Name}"/>
    </StackPanel>
    </DataTemplate>
    </Window.Resources>
    <Grid>
    <ListBox HorizontalAlignment="Left"
    ItemTemplate="{DynamicResource ProductTemplate}"
    ItemsSource="{Binding XPath=/Inventory/Product}"
    Margin="89,65,0,77" Width="200"/>
    </Grid>
    my Xaml file:
    <Window x:Class="WpfXmlDataBinding.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="922" Width="874">
    <Window.Resources>
    <DataTemplate x:Key="ProductTemplate">
    <StackPanel>
    <TextBlock Text="{Binding XPath=@ProductID}"/>
    <TextBlock Text="{Binding XPath=Cost}"/>
    <TextBlock Text="{Binding XPath=Description}"/>
    <CheckBox IsChecked="{Binding XPath=HotItem}"/>
    <TextBlock Text="{Binding XPath=Name}"/>
    </StackPanel>
    </DataTemplate>
    </Window.Resources>
    <Grid DataContext="{Binding Source={StaticResource InventoryXmlDataStore}}">
    <ListBox HorizontalAlignment="Left" Height="370"
    ItemTemplate="{DynamicResource ProductTemplate}"
    ItemsSource="{Binding XPath=/Inventory/Product}"
    Margin="65,55,0,0" VerticalAlignment="Top" Width="270"/>     
        </Grid>
    </Window>
    All looks quite the same except the <XmlDataProvider ....> part under <Window.Resources>, which is gone completely in my Xaml file.
    1, Why?
    2, How many different ways to deal with xml data source through WPF?
    Thanks, guys.
    (ps My "WpfXmlDataBinding" runs without problem through.)

    Never do yourself down Richard.
    Leave that to other people.
    It's quite common for smart developers to think they're not as good as they are.
    I coach a fair bit and it's a surprisingly common feeling.
    And to repeat.
    Never use anything ends .. provider.  They're for trivial demo apps.  Transform xml into objects and use them.  Write it back as xml.  Preferably, use a database.
    You want to read a little mvvm theory first.
    http://en.wikipedia.org/wiki/Model_View_ViewModel
    Whatever you do, don't read Josh Smiths explanation.  I used to recommend it but it confuses the heck out newbies. Leave that until later.
    Laurent Bugnion did a great presentation at mix10.  Unfortunately that doesn't seem to be working on the MS site, but I have a copy.  Download and watch:
    http://1drv.ms/1IYxl3z
    I'm writing an article at the moment which is aimed at beginners.
    http://social.technet.microsoft.com/wiki/contents/articles/30564.wpf-uneventful-mvvm.aspx
    The sample is just a collection of techniques really.
    I have a sample which involves no real data but is intended to illustrate some aspects of how viewmodels "do stuff" and how you use datatemplates to generate UI.
    I can't remember if I recommended it previously to you:
    https://gallery.technet.microsoft.com/WPF-Dialler-simulator-d782db17
    And I have working samples which are aimed at illustrating line of business architecture.  This is an incomplete step by step series but I  think more than enough to chew on once you've done the previous stuff.
    http://social.technet.microsoft.com/wiki/contents/articles/28209.wpf-entity-framework-mvvm-walk-through-1.aspx
    The write up for step2 is work in progress.
    https://gallery.technet.microsoft.com/WPF-Entity-Framework-MVVM-78cdc204
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • 11i EBS XML Publisher Report with Multiple Data Source

    I need to create XML Publisher report in 11i EBS pulling data from another 10.7 EBS Instance as well as 11i EBS in single report.
    I am not allowed to create extract or use db links.
    My problem is how to create Data Source Connection using Java Concurrent Program.
    The approach I am trying is
    1. create Java concurrent program to establish connection to 10.7 instance.
    2. Will write the SQL queries in Data Tempalete with 2 Data Source 1 for 11i EBS and 2 for 10.7 EBS
    3. Template will show the data from both query in 1 report..
    Is there any other way to proceed using datasource API...
    thanks

    option1:
    The query should be same @ detail level, only the template has to be different for summary and details.
    @runtime, user can choose to see the detail/summary
    Disadvantage, if the data is huge,
    advantage , only one report.
    option2:
    create two separate reports summary and details
    and create diff data and diff layout and keep it as different report
    Advantage, query will perform based on the user run report, summary/detail, so that you can write efficient query.
    Dis advantage , two reports query/template to be maintained.

  • Problem using JRC 2.0 on Unix with xml data source

    Hello,
    I am experimenting difficulties using the JRC 2.0 (which I hadn't with the previous version) on a RedHat 4 machine. It takes 7 minutes (only 20 seconds on Windows) to create a pdf (1 page) from a simple report using an xml file as data source.
    It takes approximately 2 minutes when opening the report
          > reportClientDoc.open(REPORT_NAME, 0);
    then 4 minutes are required to connect the report to the xml data source
          > reportClientDoc.getDatabaseController().setDataSource(xml_ds, "", "");
    Have you got any clue on possible reasons for this issue ?
    Edited by: florian epiard on Jan 30, 2009 4:33 PM

    Hello,
    I am experimenting difficulties using the JRC 2.0 (which I hadn't with the previous version) on a RedHat 4 machine. It takes 7 minutes (only 20 seconds on Windows) to create a pdf (1 page) from a simple report using an xml file as data source.
    It takes approximately 2 minutes when opening the report
          > reportClientDoc.open(REPORT_NAME, 0);
    then 4 minutes are required to connect the report to the xml data source
          > reportClientDoc.getDatabaseController().setDataSource(xml_ds, "", "");
    Have you got any clue on possible reasons for this issue ?
    Edited by: florian epiard on Jan 30, 2009 4:33 PM

  • Crystal reports from XML data source in 'CR in Eclipse(CR4E)'.

    I'm trying to generate the crystal reports from XML file using 'eclipse in crystal reports' through programatically. It had thrown this error.                                                                               
    log4j:WARN No appenders could be found for logger (com.businessobjects.reports.sdk.JRCCommunicationAdapter).
    log4j:WARN Please initialize the log4j system properly.
    Exception in thread "main" com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Error loading database connector.  The class 'com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader' could not be accessed.---- Error code:-2147467259 Error code name:failed
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(Unknown Source)
         at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.businessobjects.sdk.erom.jrc.a.a(Unknown Source)
         at com.businessobjects.sdk.erom.jrc.a.execute(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ds.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.an.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.b0.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.b0.b(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.bb.int(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.byte(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.addTable(Unknown Source)
         at com.businessobjects.samples.CreateXMLInlineSchemaReport.main(CreateXMLInlineSchemaReport.java:50)
    Caused by: com.crystaldecisions.reports.common.QueryEngineException: Error loading database connector.  The class 'com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader' could not be accessed.
         at com.crystaldecisions.reports.queryengine.Connection.ur(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.uB(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.br(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.bs(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.t1(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Table.u7(Unknown Source)
         at com.crystaldecisions.reports.dataengine.datafoundation.AddDatabaseTableCommand.new(Unknown Source)
         at com.crystaldecisions.reports.common.CommandManager.a(Unknown Source)
         at com.crystaldecisions.reports.common.Document.a(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.f.a(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.byte(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(Unknown Source)
         ... 24 more
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         ... 36 more
    Caused by: com.businessobjects.reports.jdbinterface.common.DBException: Failed to load the database connector 'crdb_xml.dll'.
         at com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader.loadDriver(Unknown Source)
         ... 40 more
    Edited by: Kondal Kolipaka on May 29, 2009 6:25 AM

    Hi,
    1) Open the Crystal report with XML datasource connectivity in the Crystal Report designer.
    2) Click on File ->Report Options.
    3) Uncheck the Verify On First Refresh box.
    4) Save the Crystal report.
    5) Open this Crystal report in Crystal Report for Eclipse designer and try Executing it again.
    Please let me know the results.
    Thanks,
    Neeraj

  • CollapsiblePanel with XML data source

    I've been working with the CollapsiblePanel for the past two
    nights. I can't make the panel collapse at runtime when I have XML
    data attached.
    I validated by downloading one of the Adobe Lab
    CollapsiblePanel samples. I validated that I could make the sample
    work from my Dreamweaver CS3 environment. Then, I added an XML data
    source and retested. The panel would not collapse. Then, I took out
    the XML dataset and retested the CollapsiblePanel. It worked.
    Is this a design feature? I can't imagine this was designed
    to work this way. I'm trying to create a scrollable div that can
    collapse. I have everything working except the collapse feature.
    (BTW: I tried defining a spry:region and spry:detailregion, it
    didn't seem to matter.)
    CODE SNIPIT
    <div id="CollapsiblePanel1" class="CollapsiblePanel"
    spry:region="dsWeek">
    <div class="CollapsiblePanelTab">Standard Collapsible
    Panel</div>
    <div class="CollapsiblePanelContent">
    <p>{feature}</p>
    </div>
    </div>

    How does the xml data look like? in GML?
    If the xml data set is not too large, maybe you can add them (after your application has parsed them) as additional MapViewer GeoFeatures in a map request.
    Currently MapViewer (preview or production release of 9.0.4) does not support xml-only datasource.
    We will look into incorporating GML or other standard-based xml datasource for a future release of MapViewer.

  • MapViewer with XML data source

    Hello all,
    We have the MapViewer read data from JDBC data source doing spatial queries. Can any one tell me if I can use XML data source as input to the MapViewer.
    We have a data source that is only available thru Web services, we cannot make a database view on the schema.
    If not is it planned in the production version.
    Thanks

    How does the xml data look like? in GML?
    If the xml data set is not too large, maybe you can add them (after your application has parsed them) as additional MapViewer GeoFeatures in a map request.
    Currently MapViewer (preview or production release of 9.0.4) does not support xml-only datasource.
    We will look into incorporating GML or other standard-based xml datasource for a future release of MapViewer.

  • One report with 2 data source

    Hi i want to produce one report from 2 data source where there is no relation but there is one common fields ,Like in form i using 2 datablock to produce the result. My query is
    GLDATA BRDATA
    tr-dt-------br---Acno---Amt trndt--------Branch-----Amt-curr
    01-08-09--020---111----1245.66 10-07-09---030---345000---INR
    02-08-09---021-121----16000 01-08-09---020---545----USD
    Here when i search by Br it should display from both tables.I cannot join or put datalink because it will produce duplicate records from the tables.
    rgds
    jyothi

    simple, either put them into one repeating frame by union or use two repeating frames.

  • 10g Reports issue with XML Data Source

    Hi,
    Has anybody ever encountered an issue with Oracle 10g report using an XML as the data source? What happens is, some of the values in the XML are printed to the wrong column.
    One of the elements in our XML file is a complex type with 10 elements under it. The first 5 are picked up properly, but the last 6 are not. Elements #6 to #9 has a minimum occurence of 0. What happens is when element #6 is present, but #7 is, the value for element #7 is passed on to element #6.
    The XSD and XSL files are both valid since the reports were working when we were still using 9i. There is no hidden logic in the report which might cause this issue to come up, i.e., the report just picks up the values from the XML and prints it to the appropriate columns.
    Any help will be greatly appreciated.

    XSD used
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
            <!-- trade instructions detail & trailer -->
            <xs:element name="TradeDetail">
                    <xs:complexType>
                            <xs:sequence>
                                    <xs:element ref="TradeType"/>
                                    <xs:element ref="TradeID"/>
                                    <xs:element ref="TradeDate"/>
                                    <xs:element ref="FundID"/>
                                    <xs:element ref="FundName"/>
                                    <xs:element ref="DollarValue" minOccurs="0"/>
                                    <xs:element ref="UnitValue" minOccurs="0"/>
                                    <xs:element ref="PercentageValue" minOccurs="0"/>
                                    <xs:element ref="OriginalTradeID" minOccurs="0"/>
                                    <xs:element ref="CancellationFlag"/>
                            </xs:sequence>
                    </xs:complexType>
            </xs:element>
            <xs:element name="Instruction">
                    <xs:complexType>
                            <xs:sequence minOccurs="0">
                                    <xs:element ref="TradeDetail" maxOccurs="unbounded"/>
                            </xs:sequence>
                    </xs:complexType>
            </xs:element>
            <!-- overall trade instruction message -->
            <xs:element name="InterchangeHeader">
                    <xs:complexType>
                            <xs:sequence>
                                    <xs:element ref="Instruction"/>
                            </xs:sequence>
                    </xs:complexType>
            </xs:element>
            <!-- definition of simple elements -->
            <xs:element name="FundID" type="xs:string"/>
            <xs:element name="TradeType" type="xs:string"/>
            <xs:element name="TradeID" type="xs:string"/>
            <xs:element name="TradeDate" type="xs:string"/>
            <xs:element name="FundName" type="xs:string"/>
            <xs:element name="DollarValue" type="xs:decimal"/>
            <xs:element name="UnitValue" type="xs:decimal"/>
            <xs:element name="PercentageValue" type="xs:decimal"/>
            <xs:element name="OriginalTradeID" type="xs:string"/>
            <xs:element name="CancellationFlag" type="xs:string"/>
    </xs:schema>
    XML used
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <InterchangeHeader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="TradeInstruction.xsd">
       <Instruction>
          <TradeDetail>
             <TradeType>Purchase</TradeType>
             <TradeID>M000038290</TradeID>
             <TradeDate>20061201</TradeDate>
             <FundID>ARO0011AU</FundID>
             <FundName>ABN Fund</FundName>
             <DollarValue>2111.53</DollarValue>
             <CancellationFlag>N</CancellationFlag>
          </TradeDetail>
          <TradeDetail>
             <TradeType>Redemption</TradeType>
             <TradeID>M000038292</TradeID>
             <TradeDate>20061201</TradeDate>
             <FundID>ARO0011AU</FundID>
             <FundName>AMRO Equity Fund</FundName>
             <UnitValue>104881.270200</UnitValue>
             <CancellationFlag>N</CancellationFlag>
          </TradeDetail>
          <TradeDetail>
             <TradeType>ISPurchase</TradeType>
             <TradeID>M000038312</TradeID>
             <TradeDate>20061201</TradeDate>
             <FundID>MLC0011AU</FundID>
             <FundName>Cash Fund</FundName>
             <OriginalTradeID>M000038311</OriginalTradeID>
             <CancellationFlag>N</CancellationFlag>
          </TradeDetail>
       </Instruction>
    </InterchangeHeader>
    XSLT used
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
            <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
            <xsl:template match="/">
                    <InterchangeHeader>
                            <xsl:for-each select="InterchangeHeader/Instruction/TradeDetail">
                            <xsl:sort select="FundName"/>
                            <xsl:sort select="TradeDate"/>
                                    <TradeDetail>
                                            <TradeType><xsl:value-of select="TradeType"/></TradeType>
                                            <TradeID><xsl:value-of select="TradeID"/></TradeID>
                                            <TradeDate><xsl:value-of select="TradeDate"/></TradeDate>
                                            <FundID><xsl:value-of select="FundID"/></FundID>
                                            <FundName><xsl:value-of select="FundName"/></FundName>
                                            <DollarValue><xsl:value-of select="DollarValue"/></DollarValue>
                                            <UnitValue><xsl:value-of select="UnitValue"/></UnitValue>
                                            <PercentageValue><xsl:value-of select="PercentageValue"/></PercentageValue>
                                            <OriginalTradeID><xsl:value-of select="OriginalTradeID"/></OriginalTradeID>
                                            <CancellationFlag><xsl:value-of select="CancellationFlag"/></CancellationFlag>
                                    </TradeDetail>
                            </xsl:for-each>
                    </InterchangeHeader>
            </xsl:template>
    </xsl:stylesheet>

  • Problem in using Jasper Reports with JFrames

    Hi,
    I am using Jasper Reports in Swings.
    I could Generate Jasper Reports from JFrames with out any problem,
    but while closing the Report, the JFrame is also getting closed automatically.
    this should not happen for my application.
    So, how could i restrict the JFrame from exiting when Jasper Reports are closed.
    Thanx in advance.
    Reddy

    Create jasperviewer object as JasperViewer jasperViewer = new JasperViewer(jasperPrint, false);

  • Filling PDF Form with XML data file

    Hello everybody.
    I need help.
    I created a form with LiveCycle Designer. I filled it and generated a XML data files. Now, I would like to fill the same blank PDF form with this XML data file.
    I know that I can do it with Adobe 8.0 but I must do it in an C# / .NET application that I have to create.
    (Forms I'm creating are not for me, I create the forms. Client uses them form but he don't have Adobe Acrobat 8.0, so he can't realise the automatic PDF filling with Adobe Acrobat 8.0)
    So I am looking for help with ".NET" "COM" or other library to help me to do it. If someone has other idea just give it.
    Thanks for your reply
    Jean Pierre (sorry for my bad English)

    Hello Mike
    Thank's for your reply. I used XPAAJ and it works very well but my company his develloping software with C# langage.
    I tried to convert XPPAJ to C#, I did it with the Java Langage Conversion Assistant but "Adobe Library" included in jar files cannot be translated to C#/.NET library. So, I can't use it.
    I found some C#/.NET API on the NET but they are very expensive and my company don't want to pay. They want me to create my own solution with library given by Adobe when you buy Adobe 8. So I am looking for this library.
    Is there an Adobe LiveCycle Designer SDK to help me.
    Thank you in advance for your reply
    Jean Pierre (student developing with LiveCycle Designer)

  • Reporting Services: XML Data Source and Parameters

    I’ve created an XML service (asmx) in ASP.Net that I want to use as a data source for an SQL Reporting Services report. The report and service work just fine if I use a Method from the service that does not have parameters. However, if I use a Method that
    needs a parameter, the query/report fails. My investigation makes it seem that the parameter is not getting passed to the Method at all. (The parameter is a DateTime and it always ends up uninitialized and the WebMethod throws an exception.)
    I’ve exhausted all my TechNet resources and Googled this excessively. It would seem that I am doing this correctly, based on all the examples I’ve seen, but I still can’t get it to work.
    I've done a lot of different permutations, but this is where I’m at right now.
    (Note: I've changed the Web Method's parameter to be a String instead of a DateTime. I did this as part of my trial-and-error process. Once I get this figured I'll return it to a DateTime.)
    I'm trying to include everything here that will help you help me (see attached image). I had to obfuscate a few things (not sure if that is necessary).
    See attached image:
    Created Shared Data Source in SQL Report Services
    Create Report Parameter (matching Web Method parameter)
    Created a data set in Report Builder (with Query, and parameter - matching Web Method parameter)
    Query in Data Source
    <Query>
    <Method Name="GetDueDateAging" Namespace="http://zzz.com/vvv">
    <Parameters>
    <Parameter Name="cutoffDate">
    <DefaultValue></DefaultValue>
    </Parameter>
    </Parameters>
    </Method>
    <SoapAction>http://zzz.com/vvv/GetDueDateAging</SoapAction>
    <ElementPath IgnoreNamespaces="true">*</ElementPath>
    </Query>
    This is where I needed the most help, and I don't totally understand it. But again, the parameter-less Method worked. I've tried adding different things in the <DefaultValue> tag (like @cuttoffDate and constant values), with no success.
    WebMethod Code
    [WebMethod]
    public List<AgingInvoice> GetDueDateAging(string cutoffDate)
    DateTime cd = DateTime.MinValue;
    if (!DateTime.TryParse(cutoffDate, out cd))
    cd = DateTime.Now;
    Shared.DueDateAging aging = new Shared.DueDateAging();
    return aging.GetDueDateAging(cd, Settings.Default.ConnectionString);
    I've looked at every online resource that I could find, but I'm striking out right now. Any help or hints would be greatly appreciated.
    Thanks.
    Derrick

    Hi Derrick,
    In your case, please refer to the following method to troubleshooting this problem:
    We can use Fiddler2 to monitor the HTTP post, and check whether the parameter is being sent. The Fiddler tool can helps us debug web applications by capturing network traffic between the Internet and test computers. If the parameter is being sent, please
    debug the web service to ensure the method has values return.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

Maybe you are looking for