//Create the rows foreach (Graphic data in graphics) { lstValues.Clear(); foreach (string field in fields) { string strValue = string.Empty; if ((data.Attributes[field]) != null) { strValue = data.Attributes[field].ToString(); } lstValues.Add(FormatField(strValue, strFormat)); //strValue = data.Attributes[field].ToString(); //lstValues.Add(FormatField(strValue, strFormat)); } //Build the row BuildStringOfRow(strBuilder, lstValues, strFormat); } WriteExcelFile(objSFD, strFormat, strBuilder);
//Build the column headers row BuildStringOfRow(strBuilder, lstFields, strFormat); //Create the rows foreach (Graphic data in graphics) { lstValues.Clear(); foreach (DataGridColumn field in columns) { string strValue = string.Empty; if ((data.Attributes[field.Header.ToString()]) != null) { strValue = data.Attributes[field.Header.ToString()].ToString(); } lstValues.Add(FormatField(strValue, strFormat)); } //Build the row BuildStringOfRow(strBuilder, lstValues, strFormat); } WriteExcelFile(objSFD, strFormat, strBuilder); }
Hi Dominique,Your ArcGIS API for silverlight expertise are really help me to get starting on this new learning smoothly. Thanks for your details to walk through my problems. Best wishes to you on Happy New Year.
strBuilder.AppendLine(String.Join(",", lstFields.ToArray()));
strBuilder.AppendLine(String.Join(",", lstFields.Select(f => "\"" + f + "\"")));
strBuilder.AppendLine(String.Join(",", lstFields.Select(f => "\"" + f.Replace("\"", "\"\"") + "\"")));
Did you look at these threads:- http://forums.arcgis.com/threads/24558-FeatureDataGrid-Excel-Exportor - http://forums.arcgis.com/threads/13460-Export-to-Excel... ?
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.