Groups | Blog | Home
all groups > asp.net datagrid control > november 2003 >

asp.net datagrid control : Datagrid to Excel Question


Bart Lynn
11/24/2003 6:37:11 PM
I have it working by the following code:

Response.Clear()

Response.Buffer = True

Response.ContentType = "application/vnd.ms-excel"

Response.Charset = ""

EnableViewState = False

Dim oStringWriter As System.IO.StringWriter

oStringWriter = New System.IO.StringWriter

Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter

oHtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter)

dataGrid1.RenderControl(oHtmlTextWriter)

Response.Write(oStringWriter.ToString())

Response.End()

When I click the button, a prompt to Open or save the file. Either is fine.

The problem is when a user on our domain tries to access the file. The
websever is not on the domain. When they click the button, a popup for the
"network password" is displayed. I can't find which user is being used on
the webserver (I was thinking it was the IISASPNET one, but I guess not).
I'd rather not put the server on the domain, for several reasons. I'd rather
set the correct permission for the correct user (the guest account, or
whatever) .

Any ideas?

Bart

Milan Todorovic
11/25/2003 12:19:31 PM
Bart,

Your solution works GREAT. Thanks!
So, let me try to help you. If I understand your problem correctly, your
users are required to provide a correct logon when they execute the routine,
but validation does not work because the web server in not a DC. If this is
the case, only thing you need to do is to disable Authenticated access
feature in the ISS Security settings for the web site. That way the users
always uses the anonymous IUSR_Servername user.
I hope this helps

Milan Todorovic



[quoted text, click to view]

Bart Lynn
11/26/2003 12:56:24 PM
Thanks. I found out that Office 2000 has a bug. If SR-1 or SR-2 is not
applied on the client, a popup asking for the Network password is displayed.

once at least SR-1 is applied to the client's Office 2000, it does not
prompt anymore.

Office 97 and Office 2003 does not have that effect.

Bart
[quoted text, click to view]

AddThis Social Bookmark Button