Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView to Excel - but with header??

Reply
Thread Tools

GridView to Excel - but with header??

 
 
Daves
Guest
Posts: n/a
 
      09-11-2006
hi,
exporting GridView data to Excel is no problem but in the first data row I
would like to put some descriptive information for the table. I cannot see
any way to add this directly to the GridView so is there any way to add it
to the final html table (guess I need to insert a <tr><td colspan=x ...)
before sending it to Response?

thx


 
Reply With Quote
 
 
 
 
=?Utf-8?B?T3Bh?=
Guest
Posts: n/a
 
      09-11-2006
You answered your own question.
Prior to your Response.Write([Your Excel Data])

just add standard HTML to the Response.

string headerText = "Header Here";
ie Response.Write ("<B>" + headerText + "</B>");

or whatever you want.





"Daves" wrote:

> hi,
> exporting GridView data to Excel is no problem but in the first data row I
> would like to put some descriptive information for the table. I cannot see
> any way to add this directly to the GridView so is there any way to add it
> to the final html table (guess I need to insert a <tr><td colspan=x ...)
> before sending it to Response?
>
> thx
>
>
>

 
Reply With Quote
 
 
 
 
Daves
Guest
Posts: n/a
 
      09-11-2006
well it's not possible since Excel will only accept and pars html that
begins with a <table>

So I need to dig into that html string and insert a tr with td colspan=...

and before doing a complicated string function I'd like to know if there was
an easier way?


"Opa" <> wrote in message
news:1443ABD6-8FA4-497C-9BAE-...
> You answered your own question.
> Prior to your Response.Write([Your Excel Data])
>
> just add standard HTML to the Response.
>
> string headerText = "Header Here";
> ie Response.Write ("<B>" + headerText + "</B>");
>
> or whatever you want.
>
>
>
>
>
> "Daves" wrote:
>
>> hi,
>> exporting GridView data to Excel is no problem but in the first data row
>> I
>> would like to put some descriptive information for the table. I cannot
>> see
>> any way to add this directly to the GridView so is there any way to add
>> it
>> to the final html table (guess I need to insert a <tr><td colspan=x ...)
>> before sending it to Response?
>>
>> thx
>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?T3Bh?=
Guest
Posts: n/a
 
      09-11-2006
Hi Daves,

Perhaps, I am not sure how you are exporting to Excel. Are you using a
DataGrid?
If you are then what I described will work, because I am already doing the
same thing.


"Daves" wrote:

> well it's not possible since Excel will only accept and pars html that
> begins with a <table>
>
> So I need to dig into that html string and insert a tr with td colspan=...
>
> and before doing a complicated string function I'd like to know if there was
> an easier way?
>
>
> "Opa" <> wrote in message
> news:1443ABD6-8FA4-497C-9BAE-...
> > You answered your own question.
> > Prior to your Response.Write([Your Excel Data])
> >
> > just add standard HTML to the Response.
> >
> > string headerText = "Header Here";
> > ie Response.Write ("<B>" + headerText + "</B>");
> >
> > or whatever you want.
> >
> >
> >
> >
> >
> > "Daves" wrote:
> >
> >> hi,
> >> exporting GridView data to Excel is no problem but in the first data row
> >> I
> >> would like to put some descriptive information for the table. I cannot
> >> see
> >> any way to add this directly to the GridView so is there any way to add
> >> it
> >> to the final html table (guess I need to insert a <tr><td colspan=x ...)
> >> before sending it to Response?
> >>
> >> thx
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: "But..but...but...I can see Russia from my porch!" mrLookout@sewage.com Computer Support 0 04-15-2010 12:02 AM
GridView to Excel then Excel to database table. mohaaron@gmail.com ASP .Net 0 11-06-2007 06:40 PM
Problem with Excel reports ::::Excel 2003 Migration To Excel 2007 =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= ASP .Net 15 10-24-2007 01:34 PM
ExtenXLS loads data into Excel 2002 file but damages the Excel file. kp2900@gmail.com Java 1 11-21-2006 05:48 PM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM



Advertisments
 



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