Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on How to export data to excel using C# within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi I'm trying to using the function export to excel in C# programming but I don't know how to proceed. ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Re: How to export data to excel using C# protectedvoid IM_ToExcel_Click(object sender, ImageClickEventArgs e) { try { DataTable AllParticipant = ((DataView)AllParticipants().Select(newDataSourceSelectArguments())).Table; DataTable AllParticipantdT = newDataTable(); int RIndex = 0; foreach (DataRow ParticipantRow in AllParticipant.Rows) { DataRow ParticipantdTRow = AllParticipantdT.NewRow(); foreach (DataColumn ParticipantCoulmn in AllParticipant.Columns) { if (RIndex == 0) { if (ParticipantCoulmn.DataType == typeof(bool)) AllParticipantdT.Columns.Add(ParticipantCoulmn.Col umnName, typeof(string)); elseif (ParticipantCoulmn.ColumnName == "Approve") AllParticipantdT.Columns.Add(ParticipantCoulmn.Col umnName, typeof(string)); else AllParticipantdT.Columns.Add(ParticipantCoulmn.Col umnName, ParticipantCoulmn.DataType); } if (ParticipantCoulmn.DataType == typeof(bool)) { if (ParticipantCoulmn.ColumnName == "Reg_Gender") { if (ParticipantRow["Reg_Gender"].ToString() == bool.TrueString) { ParticipantdTRow["Reg_Gender"] = "Male"; } else { ParticipantdTRow["Reg_Gender"] = "Female"; } } elseif (ParticipantCoulmn.ColumnName == "Kimedar") { if (ParticipantRow["Kimedar"].ToString() == bool.TrueString) { ParticipantdTRow["Kimedar"] = "Through Kimedar"; } else { ParticipantdTRow["Kimedar"] = ""; } } } else { if (ParticipantCoulmn.ColumnName == "Approve") { if (ParticipantRow["Approve"].ToString() == "0") { ParticipantdTRow["Approve"] = "New"; } elseif (ParticipantRow["Approve"].ToString() == "1") { ParticipantdTRow["Approve"] = "Approved"; } else { ParticipantdTRow["Approve"] = "Rejected"; } } else { ParticipantdTRow[ParticipantCoulmn.ColumnName.ToString()] = ParticipantRow[ParticipantCoulmn.ColumnName]; } } } AllParticipantdT.Rows.Add(ParticipantdTRow); RIndex++; } int[] iColumns = { 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }; RKLib.ExportData.Export objExport = new RKLib.ExportData.Export(); objExport.ExportDetails(AllParticipantdT, iColumns, Export.ExportFormat.Excel, "Registered.xls"); } catch { return; } } I hope this help you Its work with me |
![]() |
| Tags |
| data, excel, export |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Export of Pushpin Data to Excel | Anonymous | MapPoint 2006/2009 Discussion | 5 | 06-25-2008 09:13 AM |
| What it is the command to export data in excel format ? | Elbarto | MapPoint 2006/2009 Discussion | 1 | 03-15-2006 04:38 AM |
| Export Map Point Data to Excel | Anonymous | Wish List | 0 | 12-09-2004 03:30 PM |
| how to export the data of an Excel table on a chart mappoint | Anonymous | MapPoint 2006/2009 Discussion | 0 | 02-17-2004 04:37 AM |
| Export to excel | Dazzer | MapPoint 2006/2009 Discussion | 0 | 10-23-2003 04:29 AM |
Madeira Holiday
Why not book a Madeira holiday through UlookUbook and enjoy this warm Portuguese island at a bargain price!