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

[Solved] Export to Excel + Footer

3 Answers 156 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Katte
Top achievements
Rank 1
Katte asked on 12 Sep 2009, 11:34 AM
Hi,

I have a grid with last column containing RadNumericTextBox. And I have footer for that last column with RadNumericTextBox.

When I exporting to excel, the footer value was not exported. 

Can you please whats the problem and how to solve this issue.

Regards,
Katte

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 17 Sep 2009, 08:57 AM
Hello Katte,

Currently, to export the desired content, you should set the ExportOnlyData="false". Our developers will remove this limitation in the next version of RadControls for ASP.NET AJAX.

Let me know if you need further assistance.

Kind regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Gijo
Top achievements
Rank 1
answered on 09 Dec 2009, 09:49 PM

Hi,

  I set ExportOnlyData="false". In the excel, footer row is there but without text.

  I set the footer text in ItemDataBound event and the code is below.

  Please help.

Thanks,
Gijo Joseph.

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
        { 
            string sourceNote = ""
            string filterText = ""
            if (e.Item is GridFooterItem) 
            {         
                DataTable dtSourceNote = GetSourceNote(chart.SourceNoteReferencePath, chart.ClientId.ToString(), chart.ViewOption, "0"); 
                if (dtSourceNote.Columns.Count != 0 && dtSourceNote.Rows.Count >= 1) 
                { 
                    sourceNote = dtSourceNote.Rows[0][0].ToString(); 
                }                 
 
                filterText = GetSelectedFiltersAsString(); 
 
                GridFooterItem footer = (GridFooterItem)e.Item; 
                footer.BackColor = System.Drawing.Color.FromArgb(221, 221, 221); 
                footer.Cells[2].ColumnSpan = footer.Cells.Count - 2; 
                footer.Cells[2].HorizontalAlign = HorizontalAlign.Left; 
 
                for (int i = 3; i < footer.Cells.Count; i++) 
                { 
                    footer.Cells[i].Visible = false
                } 
                footer.Cells[2].Controls.Add(new LiteralControl("<span>" + sourceNote + "<br/>" + filterText + "<br/>" +  System.DateTime.Now.ToString() + "</span> "));                 
            } 
        } 

0
Gijo
Top achievements
Rank 1
answered on 10 Dec 2009, 10:34 PM
I got it resolved.

I changed the last line in RadGrid1_ItemDataBound to
footer.Cells[2].Text = sourceNote + "<br/>" + filterText + "<br/>" + System.DateTime.Now.ToString();   

Tags
Grid
Asked by
Katte
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Gijo
Top achievements
Rank 1
Share this question
or