Page 1 of 1

Can we bind XML Data Generated by Query

Posted: Tue Feb 15, 2011 1:35 am
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.

Can we bind XML Data Generated by Query

Posted: Tue Feb 15, 2011 3:17 am
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.

Can we bind XML Data Generated by Query

Posted: Tue Feb 15, 2011 3:54 am
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.



Can we bind XML Data Generated by Query

Posted: Tue Feb 15, 2011 7:26 am
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.

Can we bind XML Data Generated by Query

Posted: Wed Feb 16, 2011 7:07 pm
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

Can we bind XML Data Generated by Query

Posted: Thu Feb 17, 2011 8:39 am
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.

Can we bind XML Data Generated by Query

Posted: Wed Feb 23, 2011 11:15 pm
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.

Can we bind XML Data Generated by Query

Posted: Thu Feb 24, 2011 3:24 am
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.