|
Hi,,
I have a C#.net windows application with a datagridview.I need to export datagrid's data to Excel sheet.
How to export from DatagridView to Excel Sheet in C# Windows Forms?
Anybody has sample code in C#?
Please Help!!!!!!
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
Google not working for you? a simple search with your post's title points to many useful resources.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
You don't export the DtaGridView, you export the data that is used to construct the Grid. A simple, though not 1005 reliable, method would be to write the data to an xml (DataSet.WriteXml)file and change the extension to xls, or transform the xml. http://www.codeproject.com/KB/office/Excel_Export.aspx[^]
Otherwise, you will need to create a Workbook instance and add the columns and rows to it.
only two letters away from being an asset
|
|
|
|
|
|
Hi Man
Please check in this url
www.csharp-corner.com
thanks
|
|
|
|
|
private void Exl_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
string strTitle = " any Name u give" + DateTime.Now;
new DataGridExcelExporter(this.gridname , this.Page).Export(strTitle);
}
dhans
|
|
|
|
|
I am doing a Windows application. Is there code for a Windows application to do this?
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
Hi All,
I am developing an application in C# where i am using localization.
It works fine with "text" propewrties of the controls but i want to localize the properties , i mean i have a property grid where i am showing my properties but when i change the language the name of the property is not changed.
If anyone has any idea , please help me...
Praveen Sharma
|
|
|
|
|
AFAIK, you'd need to write code to change the names of the properties, probably by storing names in XML files for different languages.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi sir , thanks for the reply but can you please explain with example so that i can get a hint , actually i am new to C#.
Praveen Sharma
|
|
|
|
|
It depresses me how many people are taking on real world tasks, then say 'I am new to C#'. Why on earth is someone paying for your code then ?
It's really easy - you create XML files that contain the labels you want in different langauges, choose a file based on the lanugage, read the XML and set the property labels from there.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: It depresses me how many people are taking on real world tasks, then say 'I am new to C#'.
I hear you.
Christian Graus wrote: Why on earth is someone paying for your code then ?
i m praveen sharma from India...guess that answers your question.
only two letters away from being an asset
|
|
|
|
|
I have the following code to create an xml file, that is returned by a web service
<br />
XmlDocument doc = new XmlDocument();<br />
doc.LoadXml(xml);<br />
the xml vairable is a raw sting with xml in it
I would like to add the headers for the XLST file and DTD
I've not been able to find any code examples for this. Atm the web service just returns the xml which is fine, but I can't work out how to get it to put the headers in that will point to the .xsl file.
Anyone know how to do this?
|
|
|
|
|
AppendNode doesn't work?
only two letters away from being an asset
|
|
|
|
|
As a software tester, I'm assigned a task to log UI loading times of a very large application, which is written in C#/.NET Framework. I really don't want to do this manually whereby I use a stopwatch and my slow fingers to record the loading times. So I thought of writing a macro-based program that can approximate the location of certain form elements.
Is it possible to write a C# application that can retrieve .NET form object properties from a parent application WITHOUT having to modify the parent application's code? Maybe something like COM (don't know too much about it) could help me out?
|
|
|
|
|
|
That's an interesting technique, Mark. Do you think the same can be applied to Windows binaries which use .NET?
Thanks.
|
|
|
|
|
Haven't tried it. If it works I get 10% of the profits
only two letters away from being an asset
|
|
|
|
|
You have to be a little more considerate , Mark! I'm only a software tester...
|
|
|
|
|
Hi...,
I've added to my code the following MouseWheel event to a Forms panel.
this.panel1.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseWheel);
This is the event:
private void panel1_MouseWheel(object sender, MouseEventArgs e)<br />
{<br />
MessageBox.Show("MouseWheel event now activated", "MouseWheel", MessageBoxButtons.OK, MessageBoxIcon.Information);<br />
}
When I rotate the mouse wheel nothing happens. What I am doing wrong?
Thank you,
Michael
|
|
|
|
|
Hi,
a Control such as your Panel will react to keyboard and mouse events only
when it has focus. Has your Panel focus? Click inside it (but not inside one
of its internal Controls assuming you added some).
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi Luc,
you are totally right. Thank you and sorry for this beginner question,
Michael
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi,
I have tried out several samples for scanning bluetooth devices from a c# application but notting seems to work for me.
I keep getting build errors.
Can someone mail or post me a working sample/vs project ?
thanks a lot in advance for your help.
Blue Doorman. ( bluedoorman@live.be )
|
|
|
|
|
BlueDoorman,
What are the build errors?
Regards,
Gareth.
|
|
|
|