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

[Solved] Problem exporting to pdf

8 Answers 155 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Erin
Top achievements
Rank 1
Erin asked on 01 Mar 2011, 07:46 PM
Hello, I've been working with the export to .pdf sample referenced here http://blogs.telerik.com/vladimirenchev/posts/10-11-11/pdf_export_with_radgridview_for_silverlight_q3_2010.aspx and I can't get it to work.  The export operation works fine, but it always throws the following exception:

{System.Security.SecurityException: File operation not permitted. Access to path '' is denied.
   at System.IO.FileSecurityState.EnsureState()}

Any idea why this is the case?

8 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 02 Mar 2011, 08:59 AM
Hello Erin,

 Can you check the inner exception to see what is going on?

Kind regards,
Vlad
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Erin
Top achievements
Rank 1
answered on 02 Mar 2011, 08:42 PM
Vlad, 

The inner exception is null.
0
Vlad
Telerik team
answered on 08 Mar 2011, 12:38 PM
Hi,

 Can you trace the code using the debugger to see the exact line with the exception? Can you export normally from our demos?

Best wishes,
Vlad
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Sébastien
Top achievements
Rank 1
answered on 05 Jul 2011, 04:38 PM
Hello Telerik,

I am using this code but get an OutOfMemoryException because of the large amount of data I want to export to the PDF... Is there something I can try in order to avoid this exception?

I am attaching the result of the .pdf file I was able to export after filtering some data, you will see it is not really pretty because of the large amount of column.

Regards
0
Sébastien
Top achievements
Rank 1
answered on 05 Jul 2011, 04:46 PM
Hello again,

I figured it out, there is a grouping on my gridview and when I remove it the pdf prints out correctly.

How should I handle the grouping when I want to export to a .pdf file??

Regards
0
Vlad
Telerik team
answered on 06 Jul 2011, 07:39 AM
Hi,

 Can you post the exception stack trace?

All the best,
Vlad
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Sébastien
Top achievements
Rank 1
answered on 06 Jul 2011, 01:13 PM
Hello,

Here's the StackTrace from the OutOfMemoryException I get.

à Telerik.Windows.Documents.Model.Table.RecalculateGridIndexes()
à Telerik.Windows.Documents.Model.Table.RecalculateTableGrid(Single measureWidth)
à Telerik.Windows.Documents.Layout.TableLayoutBox.MeasureOverride(SizeF availableSize)
à Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
à Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
à Telerik.Windows.Documents.Layout.SectionLayoutBox.MeasureOverride(SizeF availableSize)
à Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
à Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
à Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverride(SizeF availableSize)
à Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
à Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
à Telerik.Windows.Documents.Model.RadDocument.Measure(SizeF measureSize)
à ExceldorERP.Helpers.TelerikHlp.GridViewMenu.Export(RadGridView gridView, String format)

Hope it helps.

Regards
0
Iva Toteva
Telerik team
answered on 07 Jul 2011, 10:42 AM
Hello Sébastien,

This issue is caused when too large tables are inserted in the document.
We have fixed it in the Q2 Beta and if you upgrade to 2011.2 623, the issue should not be present any more. However, we highly recommend that you split the data into several tables, as you will be able to achieve better performance with few changes in the code and the resulting file. 

Regards,
Iva
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
GridView
Asked by
Erin
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Erin
Top achievements
Rank 1
Sébastien
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or