We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GGC to XML

Hello, Is there any generic way to export GGC data to XML? Assuming the GGC is bound to any single flat (no any primary-foreign realtionship)table, user can grag-grop any columns to group them, add any AVG/MIN/Max/Sum to any numeric columns. the ExportToXML function will export grid''s column headers, nested groups and row/Summary datas belong to each group. any samples? Thanks, lan

6 Replies

AD Administrator Syncfusion Team August 7, 2005 05:23 PM

Hi Lan, We have planned export and import to xml. The idea is to be able to export groups and summaries as xml and also read back those exported values in a different grid and display those values in a grouping grid without the original underlying data being available. But this will take some more time until it is ready. If you only want to export the data without and you are not interested in importing them back this is less work. If export-only is something you are interested in I''ll put together a sample that creates strong typed collections of records with values and summary rows with values and then export the collection to xml using a XmlSerializer. Let me know what you need. Thanks, Stefan >Hello, >Is there any generic way to export GGC data to XML? > >Assuming the GGC is bound to any single flat (no any primary-foreign realtionship)table, >user can grag-grop any columns to group them, add any AVG/MIN/Max/Sum to any numeric columns. > >the ExportToXML function will export grid''s column headers, nested groups and row/Summary datas belong to each group. > >any samples? > >Thanks, >lan > >


LA Lan August 10, 2005 08:43 AM

Hello Stefan, Yes, I only want to export the data without style/formatting, and not interested in importing them back. The real rason I want to export to xml is that I want to apply xlst on the xml to do HTML reporting. It''ll be very helpful if you could put exporting-xml-only to a sample. Thanks, Lan


LA Lan August 15, 2005 01:23 PM

Hello, I want export-only(no read back) function. I''ll appreciate if you could provide me a sample. Thanks, lan >Hi Lan, > >We have planned export and import to xml. The idea is to be able to export groups and summaries as xml and also read back those exported values in a different grid and display those values in a grouping grid without the original underlying data being available. > >But this will take some more time until it is ready. > >If you only want to export the data without and you are not interested in importing them back this is less work. If export-only is something you are interested in I''ll put together a sample that creates strong typed collections of records with values and summary rows with values and then export the collection to xml using a XmlSerializer. > >Let me know what you need. > >Thanks, >Stefan > > >>Hello, >>Is there any generic way to export GGC data to XML? >> >>Assuming the GGC is bound to any single flat (no any primary-foreign realtionship)table, >>user can grag-grop any columns to group them, add any AVG/MIN/Max/Sum to any numeric columns. >> >>the ExportToXML function will export grid''s column headers, nested groups and row/Summary datas belong to each group. >> >>any samples? >> >>Thanks, >>lan >> >>


AD Administrator Syncfusion Team August 15, 2005 05:24 PM

Here is a minimal sample that uses an XmlTextWriter class to write out a well-formed Xml file holdong the visible data in the grid. http://www.syncfusion.com/Support/user/uploads/GGC_XML_7543d81d.zip


LA Lan August 19, 2005 03:21 PM

Hello, My version is 3.2.1.0. When I compile your sample. got following errors: C:\temp\GGC_XML_7543d81d\GGC_XML\Form1.cs(188): ''Syncfusion.Windows.Forms.Grid.Grouping.GridRecordRow'' does not contain a definition for ''GetRecord'' C:\temp\GGC_XML_7543d81d\GGC_XML\Form1.cs(187): ''Syncfusion.Windows.Forms.Grid.Grouping.GridRecordRow'' does not contain a definition for ''GetRecord'' Any idea? >Here is a minimal sample that uses an XmlTextWriter class to write out a well-formed Xml file holdong the visible data in the grid. > >http://www.syncfusion.com/Support/user/uploads/GGC_XML_7543d81d.zip >


AD Administrator Syncfusion Team August 19, 2005 08:37 PM

That sample was done using the 3.3 RC. In 3.2.1, use code like this:
private void WriteGridRecordRow(GridRecordRow grr, XmlTextWriter xw)
{
	xw.WriteStartElement("Record");
	foreach(FieldDescriptor fd in grr.ParentTableDescriptor.Fields)
	{
		GridRecord rec =  grr.ParentGroup.Records[0] as GridRecord;
		if(rec != null)
			xw.WriteElementString(fd.Name, rec.GetValue(fd).ToString());
	}
	xw.WriteEndElement();
}

Loader.
Live Chat Icon For mobile
Up arrow icon