473,395 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

prob forms authentication while generating excel report

hi,

we r using forms authetication.

problem :- i am using the below code to generate excel report
but since we r using forms authetication.. after generating excel report the
browser directs to login.apsx which is specified in web.config file.

this code is in one file.aspx

In web.config , i specified <identity impersonate = true />
public void Convert(DataSet ds , HttpResponse response )

{

//first let's clean up the response.object

response.Clear();

response.Charset = "";

//set the response mime type for excel

response.ContentType = "application/vnd.ms-excel";

//create a string writer

System.IO.StringWriter stringWrite = new System.IO.StringWriter();

//create an htmltextwriter which uses the stringwriter

HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);

DataGrid dg = new DataGrid();

dg.DataSource = ds.Tables[0];

dg.DataBind();

dg.RenderControl(htmlWrite);
//all that's left is to output the html

response.Write(stringWrite.ToString());

response.End();

}

Raghavendra
Nov 18 '05 #1
0 1416

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rimantas Žukaitis | last post by:
Hi, we are developing server side report generation application with .NET. The problem is, that we have to present same data in diferent formats (HTML, PDF, WORD, EXCEL). This has to be done...
5
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The...
1
by: ibeetb | last post by:
If I develop reports with an application that the user does not have.....for example, Excel or more specifically, if I develop a report with Excel 2003 and the user is still using Excel 97 (2003 is...
4
by: Lewis Edward Moten III | last post by:
I have a file that users can download through a web page protected by forms authentication: Download.aspx?ID=45 and within that file ... FileInfo fileToDownload = new FileInfo(fileName);
9
by: hari krishna | last post by:
hi, I want to send the data from dataset information to Excel through ASP.Net. there will be no XL installed on web server. web server is win 2000 server machine. I am using visual basic code in...
0
by: Vaibhav Shah | last post by:
Hi, Of late, we have been facing a very strange problem in working with crystal report in asp.net the code executes without any exception but as soon as the reportviewer is initialized with...
3
by: GaryDean | last post by:
I'm trying to use 2.0 forms authentication in a new web site. My book shows how to set this up with the ASP.Net Web Site Administration Tool by going to the Security tab and following the...
6
by: Gibble | last post by:
Hi, We have a javascript on a page that calls a .NET web service. Oddly, in our web servers event logs the following errors kept repeating every minute (that made sense since the web service...
2
by: AnitaFitz | last post by:
Hi I'm trying to generate an excel document using visual basic? I can preview the report fine but the users want me to generate the report to mirror an excel sheet and export. I was browsing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.