This is a migrated thread and some comments may be shown as answers.

On exporting to excel

3 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shiva
Top achievements
Rank 1
shiva asked on 17 Aug 2010, 05:47 AM
Hi,
Export data to Excel Problem:
In ExportToExcel() method,i am facing the problem when huge amount of data is there, in excel it is showing "########",
When we double click on that cell it is showing the content.
        ............................
       binded datatable data to gridview
        .................................
       //int wid = 120;
        // //GridView1.Columns["Description"].ItemStyle.Width=wid;
        //GridView1.Columns[3].ItemStyle.Width = Unit.Percentage(40);
        // GridView1.Columns[3].ItemStyle.Width = Unit.Pixel(40);
      GridView1.RenderControl(hw);
        //style to format numbers to string
        string style = @"<style> .textmode { mso-number-format:\@; } </style>";
        Response.Write(style);
        Response.Output.Write(sw.ToString());
        Response.Flush();
        Response.Close();
        Response.End();
}

Help me in this problem,or let me know if there is any alternative..
Thanking you..

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 17 Aug 2010, 11:33 AM
Hello Shiva,

As far as I can see you do not use the built-in RadGrid export.
Basically, you can increase the column width to avoid this behavior.
Word/Excel export (HTML-based)

Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
shiva
Top achievements
Rank 1
answered on 18 Aug 2010, 04:15 AM
In ExportToExcel() method,i tried with this
 "GridView1.Rows[i].Cells[3].Width = 1000;".but in excel sheet it is increasing the column width, but not displaying the content.displaying ######.

        ............................
       binded datatable data to gridview
        .................................
for (int i = 0; i < GridView1.Rows.Count; i++)

{

 

//Apply text style to each Row

 

GridView1.Rows[i].Cells[3].Width = 1000;

GridView1.Rows[i].Attributes.Add(
"class", "textmode");

}

          GridView1.RenderControl(hw);
        //style to format numbers to string
        string style = @"<style> .textmode { mso-number-format:\@; } </style>";
        Response.Write(style);
        Response.Output.Write(sw.ToString());
        Response.Flush();
        Response.Close();
        Response.End();
}

Is there any way to this.to get the content.
Thanks
0
Daniel
Telerik team
answered on 20 Aug 2010, 09:57 PM
Hello Shiva,

Please post your questions about the GridView control in the following forum:
ASP.NET Forums

For more information about Telerik RadControls for ASP.NET AJAX and RadGrid, please visit the links below:
Overview of Telerik RadGrid structure
Accessing cells and rows
Word/Excel export (HTML-based)

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
shiva
Top achievements
Rank 1
Answers by
Daniel
Telerik team
shiva
Top achievements
Rank 1
Share this question
or