Click here to Skip to main content
15,895,799 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Retrieving the Cell value Pin
VenkataRamana.Gali21-Jul-06 2:54
VenkataRamana.Gali21-Jul-06 2:54 
GeneralRe: Retrieving the Cell value Pin
mnaveed21-Jul-06 3:08
mnaveed21-Jul-06 3:08 
AnswerRe: Retrieving the Cell value Pin
Frank Kerrigan21-Jul-06 2:51
Frank Kerrigan21-Jul-06 2:51 
GeneralRe: Retrieving the Cell value *********** Pin
VenkataRamana.Gali21-Jul-06 3:04
VenkataRamana.Gali21-Jul-06 3:04 
AnswerRe: Retrieving the Cell value Pin
minhpc_bk21-Jul-06 17:04
minhpc_bk21-Jul-06 17:04 
GeneralRe: Retrieving the Cell value ******** Pin
VenkataRamana.Gali21-Jul-06 20:56
VenkataRamana.Gali21-Jul-06 20:56 
GeneralRe: Retrieving the Cell value ******** Pin
minhpc_bk22-Jul-06 2:45
minhpc_bk22-Jul-06 2:45 
Questionproblem in Export to Excel Pin
Jeeva Mary Varghese21-Jul-06 1:58
Jeeva Mary Varghese21-Jul-06 1:58 
Hello All,
I'm trying to do a page which exports a table to Excel. But a set of statements gets printed on my page, when i try to export it again. The statements are:-

"Server: Microsoft-IIS/5.1 Date: Fri, 21 Jul 2006 11:32:11 GMT X-Powered-By: ASP.NET X-AspNet-Version: 1.1.4322 Content-Disposition: attachment; filename=FileName.xls Cache-Control: private Content-Type: application/octet-stream; charset=utf-8 Content-Length: 3908 "

At first i used "cache" instead of "viewstate".I thought cachewas making problems but all in vain.
Can anyone tell me what the problem is due to?

Thank you.

Regards,
Jeeva


My Code is:-

ViewState["DataTableExportToExcel"] = (DataTable)grdReportResult.DataSource;

private void ExportToExcel()
{
DataSet ds = new DataSet();
DataTable dt = new DataTable();
dt = (DataTable)ViewState["DataTableExportToExcel"];
ds.Tables.Add(dt.Copy());
clsGeneral objclsGeneral = new clsGeneral(); SaveExcel(objclsGeneral.SaveExcelToServer(ds,MapPath("Excell\\FileName.xls")));
//Procedure for exporting data to excel and save it into the server
//Cache.Remove("DataTableExportToExcel");

}

private void SaveExcelToClientMechine(string fileName)
{
System.IO.FileInfo targetFile = new System.IO.FileInfo(fileName);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + targetFile.Name);
Response.AddHeader("Content-Length", targetFile.Length.ToString()) ;
Response.ContentType = "application/octet-stream" ; Response.WriteFile(targetFile.FullName);
}

AnswerRe: problem in Export to Excel Pin
minhpc_bk21-Jul-06 17:01
minhpc_bk21-Jul-06 17:01 
GeneralRe: problem in Export to Excel Pin
Jeeva Mary Varghese23-Jul-06 19:08
Jeeva Mary Varghese23-Jul-06 19:08 
QuestionHow to Compare two dates Pin
premiseenu21-Jul-06 1:53
premiseenu21-Jul-06 1:53 
AnswerRe: How to Compare two dates Pin
premiseenu21-Jul-06 1:53
premiseenu21-Jul-06 1:53 
AnswerRe: How to Compare two dates [modified] Pin
mnaveed21-Jul-06 2:27
mnaveed21-Jul-06 2:27 
AnswerRe: How to Compare two dates Pin
VenkataRamana.Gali21-Jul-06 2:50
VenkataRamana.Gali21-Jul-06 2:50 
QuestionSelectedIndexChanged event only fired the second time Pin
spoa21-Jul-06 0:22
spoa21-Jul-06 0:22 
AnswerRe: SelectedIndexChanged event only fired the second time Pin
minhpc_bk21-Jul-06 16:59
minhpc_bk21-Jul-06 16:59 
AnswerRe: SelectedIndexChanged event only fired the second time Pin
spoa24-Jul-06 0:47
spoa24-Jul-06 0:47 
GeneralRe: SelectedIndexChanged event only fired the second time Pin
minhpc_bk24-Jul-06 6:06
minhpc_bk24-Jul-06 6:06 
AnswerRe: SelectedIndexChanged event only fired the second time Pin
spoa26-Jul-06 7:25
spoa26-Jul-06 7:25 
GeneralRe: SelectedIndexChanged event only fired the second time [modified] Pin
minhpc_bk26-Jul-06 19:17
minhpc_bk26-Jul-06 19:17 
AnswerRe: SelectedIndexChanged event only fired the second time Pin
spoa27-Jul-06 0:32
spoa27-Jul-06 0:32 
Questionon server no validator control is working,How? Pin
Amit Agarrwal21-Jul-06 0:02
Amit Agarrwal21-Jul-06 0:02 
AnswerRe: on server no validator control is working,How? Pin
mnaveed21-Jul-06 2:38
mnaveed21-Jul-06 2:38 
QuestionSort in gridview? Pin
blurMember20-Jul-06 23:41
blurMember20-Jul-06 23:41 
AnswerRe: Sort in gridview? Pin
Paddy Boyd21-Jul-06 0:02
Paddy Boyd21-Jul-06 0:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.