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

Radgrid export is not working after column reorder

6 Answers 220 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roshan
Top achievements
Rank 1
Roshan asked on 24 Jun 2011, 08:29 PM
Hii

i have added column reorder and export to excel and pdf.
when i dont reorder any columns , the export works fine
but when i re order the column and try to export its failing
anybody know why?

 <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True" >
                      
                            <Resizing AllowColumnResize="True" AllowRowResize="false" ResizeGridOnColumnResize="false"
                              EnableRealTimeResize="false" AllowResizeToFit="true" />
                  </ClientSettings>
<ExportSettings  FileName = "Scheduled Report Metrics" IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData = "true">
                         <pdf PageWidth="297mm" PageHeight="210mm" PageTitle = "Scheduled Report Metrics " />
                 </ExportSettings>

Server Error in '/Web' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.Grid.Export.TableViewExporter.PdfExportRenderForm(HtmlTextWriter nullWriter, Control form) +347
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +8689033
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   Telerik.Web.UI.Grid.Export.TableViewExporter.PdfExportRenderPage(HtmlTextWriter nullWriter, Control page) +145
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

6 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 01 Jul 2011, 11:44 AM
Hello Roshan,

Please download the attached demo and let me know how to modify it in order to reproduce the issue.
Thank you for your cooperation.

Regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Peter
Top achievements
Rank 1
answered on 17 Oct 2012, 07:17 PM
Hi, 

Did you manage to solve this problem ? I am experiencing the same issue, that when I reorder columns and then export to excel, it wil crash with the same error as mentioned above... 

Thanks for any help... 
0
Kostadin
Telerik team
answered on 22 Oct 2012, 01:14 PM
Hello Peter,

Did you try the sample provided from my colleague Daniel? If you did not, then could you check it and let me know how it differs from your real setup?

All the best,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Peter
Top achievements
Rank 1
answered on 22 Oct 2012, 01:17 PM
Hi, 

I will try that within few days, because I have another problem with master-detail grid, so I am creating small page with only that grid, so I can test the functionality and then implement it into our huge project, where are hundreds lines of source code... 

I will let you know, how was my progress... 

Thanks anyway
0
Nileshkumar
Top achievements
Rank 1
answered on 21 Feb 2014, 02:28 PM
Hi Daniel,

I am also facing the same issue and the attached Demo (Export-Reorder.rar) is not working as expected.
Note: After reorder if I click on 'Save Position' and then do export, it is wokring properly.

Kindly provide the solution or other demo for this issue.
0
Kostadin
Telerik team
answered on 26 Feb 2014, 11:55 AM
Hello Nileshkumar,

I prepared a video which demonstrates how the Export-Reorder sample work on my side. On the sample has only one button which exports the grid. Could you please let me know what kind of control is "Save Position" as I was unable to find it in the sample?

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Roshan
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Peter
Top achievements
Rank 1
Kostadin
Telerik team
Nileshkumar
Top achievements
Rank 1
Share this question
or