MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




How to export data to excel using C#

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. ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-24-2005
Junior Member
White Belt
 
Join Date: Feb 2005
Posts: 1
Send a message via MSN to xortam Send a message via Yahoo to xortam
How to export data to excel using C#

Hi
I'm trying to using the function export to excel in C# programming but I don't know how to proceed. If someone could help me it would be very usefull
Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 10-21-2008
Junior Member
White Belt
 
Join Date: Oct 2008
Posts: 1
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
data, excel, export


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

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


All times are GMT -5. The time now is 03:08 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Madeira Holiday
Why not book a Madeira holiday through UlookUbook and enjoy this warm Portuguese island at a bargain price!



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59