Click here to Skip to main content
15,915,160 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Need a solution for my problem Pin
indian14311-Apr-14 6:36
indian14311-Apr-14 6:36 
GeneralRe: Need a solution for my problem Pin
Nico Haegens11-Apr-14 7:28
professionalNico Haegens11-Apr-14 7:28 
GeneralRe: Need a solution for my problem Pin
indian14311-Apr-14 13:27
indian14311-Apr-14 13:27 
GeneralRe: Need a solution for my problem Pin
Nico Haegens12-Apr-14 14:11
professionalNico Haegens12-Apr-14 14:11 
GeneralRe: Need a solution for my problem Pin
indian14313-Apr-14 20:09
indian14313-Apr-14 20:09 
GeneralRe: Need a solution for my problem Pin
indian14314-Apr-14 6:01
indian14314-Apr-14 6:01 
GeneralRe: Need a solution for my problem Pin
Nico Haegens14-Apr-14 11:56
professionalNico Haegens14-Apr-14 11:56 
Questionapply styles in excel with Openxml Pin
byka10-Apr-14 6:18
byka10-Apr-14 6:18 
QuestionConverting aspx pages into ascx pages Pin
indian1439-Apr-14 14:08
indian1439-Apr-14 14:08 
AnswerRe: Converting aspx pages into ascx pages Pin
Blikkies9-Apr-14 22:55
professionalBlikkies9-Apr-14 22:55 
GeneralRe: Converting aspx pages into ascx pages Pin
indian14310-Apr-14 6:08
indian14310-Apr-14 6:08 
GeneralRe: Converting aspx pages into ascx pages Pin
Blikkies10-Apr-14 23:25
professionalBlikkies10-Apr-14 23:25 
QuestionGridviews and hyperlinks help please Pin
Tumtum219-Apr-14 1:21
Tumtum219-Apr-14 1:21 
Questioni am not able to insert images to word document created through C# Pin
sonu jnnce8-Apr-14 22:42
sonu jnnce8-Apr-14 22:42 
AnswerRe: i am not able to insert images to word document created through C# Pin
Schatak10-Apr-14 2:06
professionalSchatak10-Apr-14 2:06 
Questionhow to drag usercontrol to page Pin
Nico Haegens8-Apr-14 5:51
professionalNico Haegens8-Apr-14 5:51 
Questionweb api query - 401 error Pin
miss7868-Apr-14 4:57
miss7868-Apr-14 4:57 
AnswerRe: web api query - 401 error Pin
Bernhard Hiller8-Apr-14 22:18
Bernhard Hiller8-Apr-14 22:18 
GeneralRe: web api query - 401 error Pin
miss7868-Apr-14 23:57
miss7868-Apr-14 23:57 
GeneralRe: web api query - 401 error Pin
Bernhard Hiller9-Apr-14 2:19
Bernhard Hiller9-Apr-14 2:19 
GeneralRe: web api query - 401 error Pin
miss78614-Apr-14 6:24
miss78614-Apr-14 6:24 
QuestionHow to save secured password for individual users Pin
antony beula8-Apr-14 2:32
antony beula8-Apr-14 2:32 
AnswerRe: How to save secured password for individual users Pin
Peter Leow8-Apr-14 2:44
professionalPeter Leow8-Apr-14 2:44 
AnswerRe: How to save secured password for individual users Pin
Richard Deeming8-Apr-14 3:07
mveRichard Deeming8-Apr-14 3:07 
QuestionExporting Repeater values in to Excel Pin
indian1437-Apr-14 14:39
indian1437-Apr-14 14:39 
Hi All,

I am trying to write repeater values in to Excel file, it is writing something but it not writing clearly. Can anybody please help where am I doing mistake. Another problem is repeater control has text boxes and td values. Initially I couldn't write into excel because of text boxes then I did this work around but didn't give me the solution I want.
Here is my code:
protected void ExportToExcel(object sender, EventArgs e)
{
     Response.Clear();
     Response.Buffer = true;
     Response.ContentType = "application/vnd.ms-excel";
    Response.ContentEncoding = System.Text.Encoding.UTF7;
     Response.AddHeader("Content-Disposition", "attachment;filename=" + ConfigurationManager.AppSettings["ExcelFilePath"].ToString() +
       ddlProductId.Text + "_" + ddlProcessor.Text + ".xls");
     Response.Charset = "";
     this.EnableViewState = false;

     System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
     System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);

     HtmlForm frm = new HtmlForm();
     this.Page.Controls.Add(frm);
     frm.Attributes["runat"] = "server";
     frm.Controls.Add(this.rptMonthlyReport);
     frm.RenderControl(oHtmlTextWriter);
     rptMonthlyReport.RenderControl(oHtmlTextWriter);
     Response.Write(oStringWriter.ToString());
     Response.End();
}

public override void VerifyRenderingInServerForm(Control control)
{ /* Do nothing */ }

public override bool EnableEventValidation
{
    get { return false; }
    set { /* Do nothing */}
}

Then I have out put displayed as below. Please help me in this regard. Any help link or code snippet or a suggestion would help me a bit. Thanks in advance.

input type+AD0AIg-hidden+ACI- name+AD0AIgBfAF8-VIEWSTATE+ACI- id+AD0AIgBfAF8-VIEWSTATE+ACI- value+AD0AIgAi- /+AD4- +ADw-/div+AD4- +ADw-header+AD4- +ADw-span id+AD0AIg-rptMonthlyReport+AF8-Label3+ACI- class+AD0AIg-FormHead2+ACIAPg-Monthly Performance Report Tracking+ADw-/span+AD4- +ADw-/header+AD4- +ADw-table width+AD0AIg-100+ACUAIg- id+AD0AIg-tblMonthlyReport+ACI- cellspacing+AD0AIg-2+ACI- border+AD0AIg-1+ACIAPg- +ADw-tr+AD4- +ADw-td class+AD0AIg-ColHeading+ACIAPg-Recipient Agency+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-false+ACI- style+AD0AIg-width: 4+ACUAOwAiAD4- +ADw-span id+AD0AIg-rptMonthlyReport+AF8-lblCarryOverQty+ACI- class+AD0AIg-ColHeading+ACI- style+AD0AIg-display:inline-block+ADs-width:99+ACUAOwAiAD4-SY 2012-13+ADw-br /+AD4- Carry +ADw-br /+AD4-Over Pounds+ADw-/span+AD4APA-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-false+ACI- style+AD0AIg-width: 4+ACUAOwAiAD4- +ADw-span id+AD0AIg-rptMonthlyReport+AF8-lblDivertedQty+ACI- class+AD0AIg-ColHeading+ACI- style+AD0AIg-display:inline-block+ADs-width:99+ACUAOwAiAD4-Pounds +ADw-br /+AD4-Diverted for+ADw-br /+AD4-SY 2013-14+ADw-/span+AD4APA-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-Jul+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-Aug+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-Sep+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-Oct+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-Nov+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-Dec+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-Jan+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-Feb+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-Mar+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-Apr+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-May+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-true+ACI- style+AD0AIg-width: 4+ACUAIgA+-Jun+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- style+AD0AIg-width: 6+ACUAOw- flex-wrap: wrap+ADsAIgA+-Qty Trans Frm Sponr To State+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- style+AD0AIg-width: 6+ACUAOw- flex-wrap: wrap+ADsAIgA+-Qty Trans Frm State To Sponr+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- style+AD0AIg-width: 6+ACUAOw- flex-wrap: wrap+ADsAIgA+-Qty Trans Frm Sponr To Sponr+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- nowrap+AD0AIg-false+ACI- style+AD0AIg-width: 4+ACUAIgA+-Total+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- style+AD0AIg-width: 4+ACUAOw- flex-wrap: wrap+ADsAIgA+-Prior Yr Left Over+ADw-/td+AD4- +ADw-td class+AD0AIg-ColHeading+ACI- style+AD0AIg-width: 2+ACUAOw- flex-wrap: wrap+ADsAIgA+-Ext Ind+ADw-/td+AD4- +ADw-/tr+AD4- +ADw-tr class+AD0AIg-OddRow+ACI- width+AD0AIg-95+ACUAIgA+- +ADw-td align+AD0AIg-left+ACI- style+AD0AIg-border: none+ADsAIgA+- +ADw-input name+AD0AIg-rptMonthlyReport+ACQ-ctl16+ACQ-Hidden1+ACI- type+AD0AIg-hidden+ACI- id+AD0AIg-rptMonthlyReport+AF8-Hidden1+AF8-0+ACI- value+AD0AIg-10001+ACI- /+AD4- Baker SD 5J +ADw-/td+AD4- +ADw-td id+AD0AIg-rptMonthlyReport+AF8-tdCarryOverQty+AF8-0+ACI- align+AD0AIg-right+ACI- style+AD0AIg-width: 4+ACUAIgA+- +ADw-input name+AD0AIg-rptMonthlyReport+ACQ-ctl16+ACQ-txtCarryOverQty+ACI- type+AD0AIg-text+ACI- value+AD0AIg-0.00+ACI- id+AD0AIg-

Thanks & Regards,

Abdul Aleem Mohammad
St Louis MO - USA

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.