Add additional header or data into excel after exporting - asp.net application

S

stephen

Hi,

I am exporting data from datagrid into excel. lets says that the grid has 3
sets of information in columns like (billing address, shipping address and
order info). If I export it, it creates an excel document but I want to
write additional header like "Billing Infomation", "Shipping address",
"Orders" above the columns on the excel generated. Basically I want to add
additional info into the excel after or before the excel is generated.

Any suggestions on how this can be done? Can it be done via asp.net
application or should it be done after the excel is created?
Any sample or article will be great.

Thanks,
Stephen
 
G

Gregory A. Beamer

Any suggestions on how this can be done?
Yes

Can it be done via asp.net
application or should it be done after the excel is created?

Yes.

You have two options:

1. Take over the Excel creation process.
2. Add to the document.

Now, as far as how, I have no clue how you are creating the Excel
document. I know from a DataGrid, but is this the MS dataGrid control,
or a third party? Are you using a standard built in "export" button or
is the export something you dinked with?

For simple excel, an HTML table can create the document. You merely need
to change the MIME type in the response header. If you need full Excel,
then someone or something is creating the export.

With more info, I might be able to help more.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
M

Mark Stevens

There is a library on Codeplex which will allow you to generate Excel
2007 documents. It has an option to paste data tables into the
spreadsheet. I have used it to do he sort of this you are attempting
to do from data tables and single entries rather than grids.

Library can be found at: http://simpleooxml.codeplex.com/

Cheers,
Mark

Hi,

I am exporting data from datagrid into excel. lets says that the grid has 3
sets of information in columns like (billing address, shipping address and
order info). If I export it, it creates an excel document but I want to
write additional header like "Billing Infomation", "Shipping address",
"Orders" above the columns on the excel generated. Basically I want to add
additional info into the excel after or before the excel is generated.

Any suggestions on how this can be done? Can it be done via asp.net
application or should it be done after the excel is created?
Any sample or article will be great.

Thanks,
Stephen
--
|\ _,,,---,,_ A picture used to be worth a
ZZZzzz /,`.-'`' -. ;-;;, thousand words - then along
|,4- ) )-,_. ,\ ( `'-' came television!
'---''(_/--' `-'\_)

Mark Stevens (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top