Passing Data to reports have Multi data set

Stimulsoft Reports.Flex discussion
Locked
kuocs
Posts: 9
Joined: Wed Mar 19, 2014 3:41 pm

Passing Data to reports have Multi data set

Post by kuocs »

Hi,

I've designed a report with twof(or multi) data set. How do I gen the XML content like below at runtime and then use the StiReport.regData() to pass the XML to the report?
ex:
<Categories>
<CategoryID>1</CategoryID>
<CategoryName>Beverages</CategoryName>
<Description>Soft drinks, coffees, teas, beers, and ales</Description>
</Categories>
<Categories>
<CategoryID>2</CategoryID>
<CategoryName>Condiments</CategoryName>
<Description>Sweet and savory sauces, relishes, spreads, and seasonings</Description>
</Categories>
<Products>
<ProductID>1</ProductID>
<ProductName>Chai</ProductName>
<SupplierID>1</SupplierID>
<CategoryID>1</CategoryID>
<QuantityPerUnit>10 boxes x 20 bags</QuantityPerUnit>
<UnitPrice>18</UnitPrice>
<UnitsInStock>39</UnitsInStock>
</Products>
<Products>
<ProductID>2</ProductID>
<ProductName>Chang</ProductName>
<SupplierID>1</SupplierID>
<CategoryID>1</CategoryID>
<QuantityPerUnit>24 - 12 oz bottles</QuantityPerUnit>
<UnitPrice>19</UnitPrice>
<UnitsInStock>17</UnitsInStock>
</Products>


Thanks in advance
Kuocs 2014.3.20
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Passing Data to reports have Multi data set

Post by HighAley »

Hello.

Could you specify what product and version do you use?
What is "Kuocs 2014.3.20"?

Thank you.
kuocs
Posts: 9
Joined: Wed Mar 19, 2014 3:41 pm

Re: Passing Data to reports have Multi data set

Post by kuocs »

Hello,
product and version is Stimulsoft Reports.Fx for Flex 2013.3

Kuocs is my name.
tks
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Passing Data to reports have Multi data set

Post by Vladimir »

Hello Kuocs,

You can use one of the methods described on the link below:
http://support.stimulsoft.com/index.php ... x-for-flex

As well in your data you need to add the root key:

Code: Select all

<Data>
<Categories>
<CategoryID>1</CategoryID>
<CategoryName>Beverages</CategoryName>
<Description>Soft drinks, coffees, teas, beers, and ales</Description>
</Categories>
<Categories>
<CategoryID>2</CategoryID>
<CategoryName>Condiments</CategoryName>
<Description>Sweet and savory sauces, relishes, spreads, and seasonings</Description>
</Categories>
<Products>
<ProductID>1</ProductID>
<ProductName>Chai</ProductName>
<SupplierID>1</SupplierID>
<CategoryID>1</CategoryID>
<QuantityPerUnit>10 boxes x 20 bags</QuantityPerUnit>
<UnitPrice>18</UnitPrice>
<UnitsInStock>39</UnitsInStock>
</Products>
<Products>
<ProductID>2</ProductID>
<ProductName>Chang</ProductName>
<SupplierID>1</SupplierID>
<CategoryID>1</CategoryID>
<QuantityPerUnit>24 - 12 oz bottles</QuantityPerUnit>
<UnitPrice>19</UnitPrice>
<UnitsInStock>17</UnitsInStock>
</Products>
</Data>
Thank you.
kuocs
Posts: 9
Joined: Wed Mar 19, 2014 3:41 pm

Re: Passing Data to reports have Multi data set

Post by kuocs »

Dear Vladimir,
Thanks for your help.

I have had implemented report using "DataTable and DataSet structures" already,
but I don't know how to gen XML structures by some methods?

SimpleXMLEncoder.encodeValue can't gen the correct XML structures for Multi tables.

I have Categories and Products ResultEvent,how do I use to convert(assemble) XML structures like below .

<root>
<Categories>
<CategoryID>1</CategoryID>
<CategoryName>Beverages</CategoryName>
<Description>Soft drinks, coffees, teas, beers, and ales</Description>
</Categories>
<Categories>
<CategoryID>2</CategoryID>
<CategoryName>Condiments</CategoryName>
<Description>Sweet and savory sauces, relishes, spreads, and seasonings</Description>
</Categories>
<Products>
<ProductID>1</ProductID>
<ProductName>Chai</ProductName>
<SupplierID>1</SupplierID>
<CategoryID>1</CategoryID>
<QuantityPerUnit>10 boxes x 20 bags</QuantityPerUnit>
<UnitPrice>18</UnitPrice>
<UnitsInStock>39</UnitsInStock>
</Products>
<Products>
<ProductID>2</ProductID>
<ProductName>Chang</ProductName>
<SupplierID>1</SupplierID>
<CategoryID>1</CategoryID>
<QuantityPerUnit>24 - 12 oz bottles</QuantityPerUnit>
<UnitPrice>19</UnitPrice>
<UnitsInStock>17</UnitsInStock>
</Products>
</root>

Thanks for your help again.

Kuocs 2014/3/21
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Passing Data to reports have Multi data set

Post by Vladimir »

Hello,

Please clarify, do you want to save the filled DataSet structure to XML data string?

Thank you.
kuocs
Posts: 9
Joined: Wed Mar 19, 2014 3:41 pm

Post by kuocs »

Sorry,I am unsure your Question. Please send an additional description.

Tks
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Passing Data to reports have Multi data set

Post by Vladimir »

Hello,

Sorry, we probably misunderstanding the problem. Please explain the problem in more detail, if possible, send us a sample application with the comments - in which place you want to connect the XML data structure and how you load it.

For registration data in the report, you can simply call the method:
report.regData(...);

Thank you.
Locked