Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel to .Response
Message
De
16/05/2005 12:58:35
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Excel to .Response
Divers
Thread ID:
01014612
Message ID:
01014612
Vues:
62
Hi,

I have the following code to return a Crystal report to the browser in XLS format:
oStream = oReport.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.Excel)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.BinaryWrite(oStream.ToArray())
Response.End()
oStream.Close()
The form containing this code requires Windows authentication (so at this point the browser is authenticated). Changing the above to use PDF format works fine but when returning the XLS version the user is prompted to authenticate again.

Oddly enough if the login screen is cancelled the XLS is received and displayed as expected .....

FWIW it's the .ExportToStream() type parameter that causes the problem - if I just change this to PDF the login prompt goes away (but of course the client falls over trying to load a PDF document as a speadsheet)

UPDATE: The XLS doesn't work when authentication is removed either - Excel fires up but the content is the rendered ASPX page. The ONLY way this works at the moment is with Authentication on and cancelling the browser login ???

Anyone know how to fix this ?
Regards,
Viv
Répondre
Fil
Voir

Click here to load this message in the networking platform