Click here to Skip to main content
15,908,111 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionValidation Code Pin
ballameharmurali27-Jun-07 0:23
ballameharmurali27-Jun-07 0:23 
AnswerRe: Validation Code Pin
Amit Kumar G27-Jun-07 0:33
Amit Kumar G27-Jun-07 0:33 
GeneralRe: Validation Code Pin
ballameharmurali27-Jun-07 19:51
ballameharmurali27-Jun-07 19:51 
Questioninput form help! Pin
boyindie27-Jun-07 0:17
boyindie27-Jun-07 0:17 
QuestionExport Access Reports Pin
André Stroebel27-Jun-07 0:11
André Stroebel27-Jun-07 0:11 
AnswerRe: Export Access Reports Pin
Pallavi Bhoite27-Jun-07 1:03
Pallavi Bhoite27-Jun-07 1:03 
GeneralRe: Export Access Reports Pin
André Stroebel27-Jun-07 1:24
André Stroebel27-Jun-07 1:24 
GeneralRe: Export Access Reports [modified] Pin
Pallavi Bhoite27-Jun-07 1:44
Pallavi Bhoite27-Jun-07 1:44 
ya both the methods i given worked for me. the getReportData() is custom function wich return me dataset. and first method is useful if u want to export data u are seeing in datagrid (paging =true). but i moved to second because i wanted to export the whole dataset to xls not the page in datagrid.

the third method i am using is not logical but works perfect for my clients requirement. take the data from database in dataset and simple generate the xls using . on 'export to excel' button click with javascript i open blank web form where on page load i write following code. u can pass dataset to this page or get datadet on this pageload.

i hope u will get the useful from below--


Response.Clear();
Response.Buffer= true;
StringBuilder responce_=new StringBuilder();
StringBuilder header=new StringBuilder();
header.Append(""+
"");
header.Append("");
header.Append("");
header.Append("");
header.Append("");
header.Append("");
header.Append("");
header.Append("");
header.Append("");
header.Append("");
header.Append("");
header.Append("");

if(!(tempds2.Tables[0].Rows.Count<=0))
{
for(int i=0;i<tempds2.tables[0].rows.count;i++)
{
responce_.append("<tr>");
for(int j=0;j<tempds2.tables[0].columns.count-1;j++)
{
if(j==0 )
{
responce_.append("<td="" width="70" align="center">"+tempds2.Tables[0].Rows[i].ItemArray[j].ToString()+"");
}
else if(j==1 || j==2 )
{
responce_.Append("");
}
else if(j==3)
{
responce_.Append("");
}
else
{
responce_.Append("");
}
}
responce_.Append("");
}
}
responce_.Append("");
responce_.Append("
"+
""+
"
 
 "+
"
 
" +
"Customer Details Report "+ "
Customer IDCustomer NameAddressCityCountryPhone NumberMobile NumberFax NumberEmailEntry Date
"+tempds2.Tables[0].Rows[i].ItemArray[j].ToString()+""+tempds2.Tables[0].Rows[i].ItemArray[j].ToString()+""+tempds2.Tables[0].Rows[i].ItemArray[j].ToString()+"
" +tempds2.Tables[0].Rows.Count+ " Records Found. "+ "
");
Response.ContentType = "application/vnd.ms-excel";
Response.Write(header.ToString()+responce_.ToString());
Response.Charset="";
Response.End();



dnt forget to write last statement.

---


-- modified at 7:55 Wednesday 27th June, 2007

pallavi

GeneralRe: Export Access Reports Pin
André Stroebel27-Jun-07 1:57
André Stroebel27-Jun-07 1:57 
GeneralRe: Export Access Reports Pin
Pallavi Bhoite27-Jun-07 2:12
Pallavi Bhoite27-Jun-07 2:12 
GeneralRe: Export Access Reports Pin
André Stroebel27-Jun-07 2:37
André Stroebel27-Jun-07 2:37 
QuestionMid function.......... Pin
n_gchaitra27-Jun-07 0:03
n_gchaitra27-Jun-07 0:03 
AnswerRe: Mid function.......... Pin
SHatchard27-Jun-07 0:14
SHatchard27-Jun-07 0:14 
GeneralRe: Mid function.......... Pin
n_gchaitra27-Jun-07 2:22
n_gchaitra27-Jun-07 2:22 
AnswerRe: Mid function.......... Pin
Craster27-Jun-07 1:35
Craster27-Jun-07 1:35 
QuestionHow to sort data in datagrid? Pin
Amit Sk Sharma26-Jun-07 23:58
Amit Sk Sharma26-Jun-07 23:58 
AnswerRe: How to sort data in datagrid? Pin
rahul.net1127-Jun-07 0:31
rahul.net1127-Jun-07 0:31 
QuestionIFrames in ASP.NET Pin
J Liang26-Jun-07 23:31
J Liang26-Jun-07 23:31 
AnswerRe: IFrames in ASP.NET Pin
SHatchard27-Jun-07 0:06
SHatchard27-Jun-07 0:06 
GeneralRe: IFrames in ASP.NET Pin
J Liang28-Jun-07 17:58
J Liang28-Jun-07 17:58 
QuestionValidating TextBox with Javascript generated value Pin
ZeedijkMike26-Jun-07 22:37
ZeedijkMike26-Jun-07 22:37 
AnswerRe: Validating TextBox with Javascript generated value Pin
Eduard Keilholz26-Jun-07 22:42
Eduard Keilholz26-Jun-07 22:42 
GeneralRe: Validating TextBox with Javascript generated value Pin
ZeedijkMike26-Jun-07 22:48
ZeedijkMike26-Jun-07 22:48 
AnswerRe: Validating TextBox with Javascript generated value Pin
ZeedijkMike26-Jun-07 23:14
ZeedijkMike26-Jun-07 23:14 
GeneralRe: Validating TextBox with Javascript generated value Pin
Eduard Keilholz26-Jun-07 23:18
Eduard Keilholz26-Jun-07 23:18 

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.