Click here to Skip to main content
15,914,452 members
Home / Discussions / C#
   

C#

 
GeneralRe: Book For Three tier Architecture Pin
help as an alias1-Nov-07 20:28
help as an alias1-Nov-07 20:28 
QuestionHow to add multiple web service in single desktop application...? Pin
Pankaj - Joshi1-Nov-07 19:33
Pankaj - Joshi1-Nov-07 19:33 
QuestionHow to prevent the DLL ...? Pin
Pankaj - Joshi1-Nov-07 19:27
Pankaj - Joshi1-Nov-07 19:27 
AnswerRe: How to prevent the DLL ...? Pin
Mark Churchill1-Nov-07 19:46
Mark Churchill1-Nov-07 19:46 
GeneralRe: How to prevent the DLL ...? Pin
Pankaj - Joshi1-Nov-07 19:51
Pankaj - Joshi1-Nov-07 19:51 
GeneralRe: How to prevent the DLL ...? Pin
Mark Churchill2-Nov-07 3:19
Mark Churchill2-Nov-07 3:19 
GeneralRe: How to prevent the DLL ...? Pin
Pankaj - Joshi2-Nov-07 20:16
Pankaj - Joshi2-Nov-07 20:16 
QuestionExport datagrid(with inner repeater) to csv Pin
kushanshah1-Nov-07 18:57
kushanshah1-Nov-07 18:57 
Hi All,

I have to implement export to csv & excel functionality for my datagrid. (The project is in asp.net 1.1 with scripting language C#).

The datagrid has a repeater in one of its template columns. While export, the export works perfect for xls but not for csv.

In xls, the inner repeater data is shown well-structured as in the page.

But for csv, the html of the repeater (tr/td/table) is also printed in csv and so the data is not exported perfectly for csv.

The code used is:

string attachment = "attachment; filename=Tasklist.xls";
//string attachment = "attachment; filename=Tasklist.csv";

Response.ClearContent();

Response.AddHeader("content-disposition", attachment);

Response.ContentType = "application/ms-excel";
//Response.ContentType = "text/csv";

StringWriter sw = new StringWriter();

HtmlTextWriter htw = new HtmlTextWriter(sw);

output_Reportmy.Columns[0].Visible=false;
output_Reportmy.Columns[1].Visible=true;
output_Reportmy.RenderControl(htw);
output_Reportmy.Columns[0].Visible=true;
output_Reportmy.Columns[1].Visible=false;
Response.Write(sw.ToString());

Response.End();

The two commented lines are used to check for the export functionality for xls and csv.

Can anyone please suggest a solution for it as I am badly stuck up with it?Frown | :(

Thanx a lot in advance

Kushan Shah,
Web Developer.
Questionhow to display dynamically created controls data in c# Pin
veereshIndia1-Nov-07 18:44
veereshIndia1-Nov-07 18:44 
AnswerRe: how to display dynamically created controls data in c# Pin
il_masacratore1-Nov-07 22:36
il_masacratore1-Nov-07 22:36 
Questioninputstring is not in a correct manner Pin
christefer1-Nov-07 18:21
christefer1-Nov-07 18:21 
AnswerRe: inputstring is not in a correct manner Pin
Pankaj - Joshi1-Nov-07 20:01
Pankaj - Joshi1-Nov-07 20:01 
QuestionRichTextBox Marquee Pin
jacklynn_mei1-Nov-07 16:47
jacklynn_mei1-Nov-07 16:47 
AnswerRe: RichTextBox Marquee Pin
Abhijit Jana1-Nov-07 18:35
professionalAbhijit Jana1-Nov-07 18:35 
GeneralRe: RichTextBox Marquee Pin
jacklynn_mei1-Nov-07 20:19
jacklynn_mei1-Nov-07 20:19 
GeneralRe: RichTextBox Marquee Pin
Abhijit Jana1-Nov-07 22:14
professionalAbhijit Jana1-Nov-07 22:14 
QuestionRuntime .NET library loading Pin
sabrown1001-Nov-07 14:59
sabrown1001-Nov-07 14:59 
AnswerRe: Runtime .NET library loading Pin
Paul Conrad1-Nov-07 15:46
professionalPaul Conrad1-Nov-07 15:46 
GeneralRe: Runtime .NET library loading Pin
sabrown1002-Nov-07 13:56
sabrown1002-Nov-07 13:56 
AnswerRe: Runtime .NET library loading Pin
Judah Gabriel Himango1-Nov-07 15:52
sponsorJudah Gabriel Himango1-Nov-07 15:52 
QuestionCan I get the "RGB" of one pixel in one image?? Pin
Yinfall1-Nov-07 14:21
Yinfall1-Nov-07 14:21 
AnswerRe: Can I get the "RGB" of one pixel in one image?? Pin
Luc Pattyn1-Nov-07 14:46
sitebuilderLuc Pattyn1-Nov-07 14:46 
GeneralRe: Can I get the "RGB" of one pixel in one image?? Pin
Yinfall1-Nov-07 15:49
Yinfall1-Nov-07 15:49 
GeneralRe: Can I get the "RGB" of one pixel in one image?? Pin
Luc Pattyn1-Nov-07 15:56
sitebuilderLuc Pattyn1-Nov-07 15:56 
QuestionChaging Contents in a text box [modified] Pin
C# Beginner Nick1-Nov-07 13:05
C# Beginner Nick1-Nov-07 13:05 

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.