Advertisement

07.02.2008 at 01:47AM PDT, ID: 23532829
[x]
Attachment Details

Datagridview export to excel with formatting

Asked by drgorsia in Visual Studio .NET 2005, Microsoft Visual Basic.Net

Tags: VB.net

Hello Experts,

I have a question regarding the export of data on a DataGridView onto an excel file with the formatting.

Basically I am a beginner at VB.net (visual studio 2005) and have been assigned to make an enhancement to an existing tool that has a datagridview on a form which has about 15 columns of info and certain rows and columns are coloured differently as per relevant criteria specified by the client.

I want to export the information displayed on the datagrid to excel ensuring that the formatting is also the same(or as close as possible) to the datagridview formatting. I.e the different colours on the rows/cells as well as ensuring that the cell sizes in excel automatically resize in the same way as the colunns in the datagridview.

I know i can design an excel template with macros etc that can do this but the requirement is that the tool has to be able to export the data to excel along with the same formatting. I have also found a solution here (http://www.timvw.be/datagridview-to-excel/ )but this would require using the dll file that the creator of this excel generator has built. I can't go via that route due to company policy etc etc...

Any help would be highly appreciated. Thanks.

DStart Free Trial
[+][-]07.02.2008 at 06:38AM PDT, ID: 21916207

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 07:45AM PDT, ID: 21916955

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 08:05AM PDT, ID: 21917135

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 08:08AM PDT, ID: 21917162

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 08:24AM PDT, ID: 21917337

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 08:31AM PDT, ID: 21917431

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio .NET 2005, Microsoft Visual Basic.Net
Tags: VB.net
Sign Up Now!
Solution Provided By: Rog
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628