Passing Data to reports
Passing Data to reports
Hi,
This is a great product which is just what we're looking for. I've designed a report with a sample data set. How do I pass the actual data (XML) to the report at runtime? I can only see an example of how to pass a filename which is not very practical in a web application...
Thanks in advance
Dom
This is a great product which is just what we're looking for. I've designed a report with a sample data set. How do I pass the actual data (XML) to the report at runtime? I can only see an example of how to pass a filename which is not very practical in a web application...
Thanks in advance
Dom
Passing Data to reports
Hello,
You can see the article in our knowledgebase:
http://stimulsoft.helpserve.com/index.p ... ticleid=63
Thank you.
You can see the article in our knowledgebase:
http://stimulsoft.helpserve.com/index.p ... ticleid=63
Thank you.
Passing Data to reports
Hello,
Unfortunately, at this moment you can load the data only from XML file. In the release version, which will be in end of September within two weeks, will be able to load data from XML variables, and also from table structures, formed from the code.
Thank you.
Unfortunately, at this moment you can load the data only from XML file. In the release version, which will be in end of September within two weeks, will be able to load data from XML variables, and also from table structures, formed from the code.
Thank you.
-
- Posts: 20
- Joined: Sun Aug 29, 2010 2:56 am
- Location: Buffalo, NY
Passing Data to reports
Has the ability to pass data from XML varilables happened yet?
Passing Data to reports
Hello,
Yes, it is already available in the new release 2010.2 Reports.Fx for Flex.
Method registers XML data source in the report:
Method registers a created data source in the report:
Use the following code to create a data source:
Thank you.
Yes, it is already available in the new release 2010.2 Reports.Fx for Flex.
Method registers XML data source in the report:
Code: Select all
report.regDataXml(name: String, dataNode: XMLNode, schemaNode: XMLNode = null): void
Code: Select all
report.regDataSet(name: String, alias: String, dataSet: DataSet): void
Code: Select all
var table: DataTable = new DataTable("Customers");
var column: DataColumn = new DataColumn("CustomerName", StorageType.StringType);
table.columns.add(column);
table.addNewRow().sett("CustomerName", "John Smith");
table.addNewRow().sett("CustomerName", "Antonio Moreno");
table.addNewRow().sett("CustomerName", "Elizabeth Brown");
var dataSet: DataSet = new DataSet("DataSetName");
dataSet.tables.add(table);
var report: StiReport = new StiReport();
report.regDataSet("DataSetName", "DataSetName", dataSet);
report.dictionary.synchronize();
report.design();
Passing Data to reports
Hi,
Just wondering why are you using XMLNode here rather than XML? Is there a way of passing an XML class or do we need to always convert to XMLNode?
Thanks
Dom
Just wondering why are you using XMLNode here rather than XML? Is there a way of passing an XML class or do we need to always convert to XMLNode?
Thanks
Dom
Passing Data to reports
Hello,
We used XMLNode type as a data adapter works with XMLNode. We will add the method to work with XML type.
Thank you.
We used XMLNode type as a data adapter works with XMLNode. We will add the method to work with XML type.
Thank you.
Passing Data to reports
Hi Dom,
Use the function to convert XML or arraycollection to xmlNode
protected function objectToXML(obj:Object,myString:String):XMLNode {
var qName:QName = new QName("root");
var xmlDocument:XMLDocument = new XMLDocument();
var simpleXMLEncoderNeu:SimpleXMLEncoderNeu = new SimpleXMLEncoderNeu(xmlDocument);
var xmlNode:XMLNode = simpleXMLEncoderNeu.encodeValue(obj, qName, xmlDocument, myString);
return xmlNode;
}
report.regDataXml('data1', objectToXML(MyArray.source,"data1"),null)
Use the function to convert XML or arraycollection to xmlNode
protected function objectToXML(obj:Object,myString:String):XMLNode {
var qName:QName = new QName("root");
var xmlDocument:XMLDocument = new XMLDocument();
var simpleXMLEncoderNeu:SimpleXMLEncoderNeu = new SimpleXMLEncoderNeu(xmlDocument);
var xmlNode:XMLNode = simpleXMLEncoderNeu.encodeValue(obj, qName, xmlDocument, myString);
return xmlNode;
}
report.regDataXml('data1', objectToXML(MyArray.source,"data1"),null)
Passing Data to reports
Hello,
We added a new functions:
Thank you.
We added a new functions:
Code: Select all
public function regData(name: String, alias: String, data: Object): void
public function regDataTable(name: String, alias: String, dataTable: DataTable): void
public function regDataSet(name: String, alias: String, dataSet: DataSet): void
public function regDataXML(name: String, alias: String, data: XML): void
public function regDataXMLNode(name: String, alias: String, dataNode: XMLNode, schemaNode: XMLNode = null): void
Passing Data to reports
I am still confused.
I did as Dom said: designed the report using a sample xml data, then saved the report file.
Now I loaded the report using loadDocumentFromString and loaded xml data using regXMLData and it shows an empty report.
I tried using regXMLDataNode and it also shows an empty report.
My complete code is as follows:
Is there a missing step or the order of steps is not correct?
Please help me. Thanks
I did as Dom said: designed the report using a sample xml data, then saved the report file.
Now I loaded the report using loadDocumentFromString and loaded xml data using regXMLData and it shows an empty report.
I tried using regXMLDataNode and it also shows an empty report.
My complete code is as follows:
Code: Select all
var loader: URLLoader = event.target as URLLoader;
documentString = loader.data as String;
var report: StiReport = new StiReport();
var myXML:XML =
ALFKI
Alfreds Futterkiste
Maria Anders
Sales Representative
Obere Str. [size=7]...etc[/size]
var xmlDoc:XMLDocument = new XMLDocument(x1);
report.regDataXMLNode("DataSource1", "DataSource1", xmlDoc.firstChild);
//report.regDataXML("DataSource1", "DataSource1", myXML); // also does not work
report.loadDocumentFromString(documentString);
var rect: Rectangle = new Rectangle(100, 100, 900, 600);
report.showDialog(rect, "Customized ViewerFx", true, true);
Please help me. Thanks