XML as a data source
-
- Posts: 30
- Joined: Tue Dec 01, 2015 6:19 pm
XML as a data source
Hello!
I would like to create a report using as a data source xml this attached. Today use as a data source connection to SQL, how do I use the xml? They can give me a sample report returning an xml field attached?
Thank you very much.
I would like to create a report using as a data source xml this attached. Today use as a data source connection to SQL, how do I use the xml? They can give me a sample report returning an xml field attached?
Thank you very much.
- Attachments
-
- NFe0000148889.xml
- (11.81 KiB) Downloaded 206 times
Re: XML as a data source
Hello,
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
You can add the XML connection in the designer and select your .xml file.
In code your code you can use the following code:
report.RegData("Data", dataSet);
report.Dictionary.Synchronize();
Thank you.
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
You can add the XML connection in the designer and select your .xml file.
In code your code you can use the following code:
report.RegData("Data", dataSet);
report.Dictionary.Synchronize();
Thank you.
- Attachments
-
- Capture.PNG (24.51 KiB) Viewed 2520 times
-
- Posts: 30
- Joined: Tue Dec 01, 2015 6:19 pm
Re: XML as a data source
Good Morning!
This image was exactly as I'd like, each tag xml a field.
Let me explain better, in fact I do not have an .xml file, I do a select in the database in an XML field and would like the xml returned this foce field used in the report as the picture you sent.
Is there a way to do this?
Thank you very much.
This image was exactly as I'd like, each tag xml a field.
Let me explain better, in fact I do not have an .xml file, I do a select in the database in an XML field and would like the xml returned this foce field used in the report as the picture you sent.
Is there a way to do this?
Thank you very much.
Re: XML as a data source
Hello,
You can use the following code for load xml from database:
Thank you.
You can use the following code for load xml from database:
Code: Select all
DataSet dataSet = new DataSet("Data");
XmlDocument xdoc = new XmlDocument();
using (SqlConnection connection = new SqlConnection(@"Data Source=LSK;Initial Catalog=Northwind;Integrated Security=True;User ID=;Password="))
{
connection.Open();
string strSQL = @"select XMLData from _00004 where ID = 2";
SqlCommand command = new SqlCommand(strSQL, connection);
System.Xml.XmlReader reader = command.ExecuteXmlReader();
if (reader.Read())
xdoc.Load(reader);
}
var xmlReader = new XmlNodeReader(xdoc);
dataSet.ReadXml(xmlReader);
var report = new StiReport();
report.RegData(dataSet);
report.Dictionary.Synchronize();
report.Design();
- Attachments
-
- ReadXMLStringFromDataBase.PNG (62.46 KiB) Viewed 2512 times
-
- Posts: 30
- Joined: Tue Dec 01, 2015 6:19 pm
Re: XML as a data source
Hello,
Perfect thank you.
Perfect thank you.
Re: XML as a data source
Hello
We are always glad to help you!
Let us know if you need any additional help.
Thank you.
We are always glad to help you!
Let us know if you need any additional help.
Thank you.