Can we bind XML Data Generated by Query

Stimulsoft Reports.NET discussion
Post Reply
shantilal
Posts: 22
Joined: Tue Jan 11, 2011 4:22 am
Location: Udaipur

Can we bind XML Data Generated by Query

Post by shantilal »

Can we bind XML data generated by query to the report . Actually I am generating an xml in the form of string which I want To assign to the report . Is It Possible?
I dont have any physical XML File. XML is generated in the form of string at runtime by query or i can convert data from dataset to XML string data.
It will be very helpful if u can provide me demo project for this.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Can we bind XML Data Generated by Query

Post by Alex K. »

Hello,

You can use the following code:

Code: Select all

            StiReport report = new StiReport();

            DataSet dataSet = new DataSet();
            DataTable dataTable = new DataTable("table1");
            dataTable.Columns.Add("col1", typeof(string));
            dataSet.Tables.Add(dataTable);

            string xmlData = "Value1Value2";
            System.IO.StringReader xmlSR = new System.IO.StringReader(xmlData);
            dataSet.ReadXml(xmlSR, XmlReadMode.IgnoreSchema);

            report.RegData(dataSet);
            report.Dictionary.Synchronize();
            report.Design();
Thank you.
shantilal
Posts: 22
Joined: Tue Jan 11, 2011 4:22 am
Location: Udaipur

Can we bind XML Data Generated by Query

Post by shantilal »

How can i design the report i.e I don't want to make physical dataset....
My dataset will only generated by code.


Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Can we bind XML Data Generated by Query

Post by Alex K. »

Hello,

We cannot understand your question. Please clarify your issue.
In previous code the dataset is created from code, not physical dataset.

Thank you.
Naveen Aggarwal
Posts: 70
Joined: Wed Feb 24, 2010 11:08 am
Location: India

Can we bind XML Data Generated by Query

Post by Naveen Aggarwal »

Hi

I also have the same query. Dont know I would be able to explain it or not !
My query is "How to design a report for data coming from xml or dynamic data" because I am not aware of the data (number, name and type of columns) at the time of designing the report. You have explained how to create dataset from the code but how would it correspond to columns in the report is not clear .

Regards
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Can we bind XML Data Generated by Query

Post by Alex K. »

Hello,

If you, in the designer, will create a report with one data set (table names, columns), and then pass into it an entirely different data set, you must again correct it in the designer, or when trying to build it, will get error messages.

Thank you.
shantilal
Posts: 22
Joined: Tue Jan 11, 2011 4:22 am
Location: Udaipur

Can we bind XML Data Generated by Query

Post by shantilal »

Hi,
I don't want to create a physical dataset to design the report. Is it possible.
If Yes then how will i make connection and drag drop the fields on report at designer.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Can we bind XML Data Generated by Query

Post by Alex K. »

Hello,

Please explain in detail how do you get the data using a query, and in what form? If you can send an example of getting data.

Thank you.
Post Reply