Re: Fails to open Excel
From: Dan Bass (danielbass)
Date: 01/05/05
- Next message: Dan Bass: "Re: Fails to open Excel"
- Previous message: Shiva: "Re: opening a new browser"
- In reply to: ZW: "Re: Fails to open Excel"
- Next in thread: ZW: "Re: Fails to open Excel"
- Reply: ZW: "Re: Fails to open Excel"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 5 Jan 2005 15:11:44 -0000
and I know it works with IE 5.01 + with Office 97, and also with IE 6.0+
with Office 2003...
Hmm. Do you have any controls in your grid? (buttons, drop downs etc?)
Have you seen this?
http://www.c-sharpcorner.com/Code/2003/Sept/ExportASPNetDataGridToExcel.asp
"ZW" <anonymous@discussions.microsoft.com> wrote in message
news:167d01c4f335$01f92d20$a301280a@phx.gbl...
> IE 6 (sp1) and Office 2000.
>
> BTW I tried IE in one computer with Office 97, it seems OK.
>
>>-----Original Message-----
>>What version of IE, and what version of Office do you
> have installed?
>>
>>"ZW" <anonymous@discussions.microsoft.com> wrote in
> message
>>news:132a01c4f295$99be9730$a301280a@phx.gbl...
>>> Hi Don,
>>>
>>> Thanks for the reply.
>>>
>>> However, it doesn't work.
>>>
>>> Although I didn't mention, I already use
>>> datagrid.RenderControl(HtmlTextWriter) put data to
>>> StringWriter in DataGrid page and save the data in
>>> Session, then in the excel report page retrieve the data
>>> and write to Response. As I mentioned, the weird thing
> is
>>> it works fine in Netscape, but not work for IE.
>>>
>>> ZW
>>>>-----Original Message-----
>>>>remove the line ClearControls from my method.
>>>>
>>>>"ZW" <anonymous@discussions.microsoft.com> wrote in
>>> message
>>>>news:046101c4f279$b8d5f210$a601280a@phx.gbl...
>>>>> Hi there,
>>>>>
>>>>> I use following code to convert a datagrid data to
>>> Excel.
>>>>> However, if I use IE to access the page, it opens an
>>> empty
>>>>> excel page. If I access it by Netscape, it can open it
>>>>> with excel (or save it). Does any one have experience
> to
>>>>> fix the problem?
>>>>>
>>>>> //
>>>>> Response.ClearContent();
>>>>> Response.ClearHeaders();
>>>>> Response.ContentType = "application/vnd.ms-excel";
>>>>> //Response.ContentType = "application/x-msexcel"; //
>>> Same
>>>>> result
>>>>> Response.Charset = string.Empty ;
>>>>> this.EnableViewState = false;
>>>>> object content = Session["datagrid"];
>>>>> if (content != null)
>>>>> {
>>>>> Response.Write(content.ToString());
>>>>> Response.End();
>>>>> }
>>>>>
>>>>>
>>>>> TIA
>>>>>
>>>>> ZW
>>>>
>>>>
>>>>.
>>>>
>>
>>
>>.
>>
- Next message: Dan Bass: "Re: Fails to open Excel"
- Previous message: Shiva: "Re: opening a new browser"
- In reply to: ZW: "Re: Fails to open Excel"
- Next in thread: ZW: "Re: Fails to open Excel"
- Reply: ZW: "Re: Fails to open Excel"
- Messages sorted by: [ date ] [ thread ]