Hello,
We are using Telerik Grid control and having performance issues with the PDF export.
The details:
- Grid control is used in a webpart under SharePoint 2013
- Datasource is a SQL table, but accessing via ORM (LLBLGen Pro framework)
- It is a Master-Detail view (details are closed by default and not exported to PDF) - source code attached below
- It takes 60 seconds to generate a PDF from ~7000rows (it will be a ~24Mb PDF file, ~700pages)
I did some profiling from the C# webpart side and from the DB side too.
As you can see in the attachments there is only one SQL query which takes less than a second (381ms) to get the data.
1.
EventClass StartTime EndTime Duration (ms) TextData Reads Writes RowCounts
2.
Trace Start 2015-07-14 15:15:33.577
3.
SQL:BatchCompleted 2015-07-14 15:15:33.577 2015-07-14 15:15:33.957 381
SELECT
xx 1023 0 7632
4.
Trace Stop 2015-07-14 15:15:33.957
But the other attachment is about the hot path in the code and it clearly shows that the Grid's internal methods are working hard for 60 seconds (!) to produce the PDF.
- Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode
- Telerik.Web.UI.Grid.Export.TableViewExporter.PrepareForExportInternal
These two methods are running 98% percent of the time.
I've created an excel file with MS Excel 2010 on my local machine with the same data and saved it as a PDF. It took less then 10 seconds to generate and save the file.
Is it possible to increase the export's performance and decrease the necessary time to ~15 seconds?
What can cause this long rendering time? Maybe the master-detail view?
Thanks for your tips in advance!
<
telerik:RadGrid
ID
=
"RadGrid_BoatGrid"
runat
=
"server"
Skin
=
"Metro"
OnNeedDataSource
=
"RadGrid_BoatGrid_OnNeedDataSource"
AllowPaging
=
"True"
OnDetailTableDataBind
=
"RadGrid_BoatGrid_OnDetailTableDataBind"
EnableLinqExpressions
=
"True"
>
<
ExportSettings
IgnorePaging
=
"True"
OpenInNewWindow
=
"True"
HideStructureColumns
=
"True"
>
<
Pdf
DefaultFontFamily
=
"Arial"
PageWidth
=
"297mm"
PageHeight
=
"210mm"
PageTitle
=
"Boats"
PaperSize
=
"A4"
></
Pdf
>
</
ExportSettings
>
<
MasterTableView
AutoGenerateColumns
=
"False"
NoMasterRecordsText
=
"There are no Boats."
AllowSorting
=
"True"
DataKeyNames
=
"Id"
>
<
DetailTables
>
<
telerik:GridTableView
runat
=
"server"
Name
=
"Actions"
DataKeyNames
=
"Id"
Width
=
"100%"
AutoGenerateColumns
=
"False"
NoDetailRecordsText
=
"There are no Actions associated with this Boat."
>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"ActionNumber"
HeaderText
=
"Number"
DataField
=
"Id"
>
<
ItemTemplate
>
................
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
..............
<
telerik:GridBoundColumn
HeaderText
=
"% Complete"
DataField
=
"PercentComplete"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
<
Columns
>
.......
<
telerik:GridBoundColumn
UniqueName
=
"Title"
HeaderText
=
"Title"
DataField
=
"Title"
SortExpression
=
"Title"
>
<
HeaderStyle
Width
=
"160px"
></
HeaderStyle
>
</
telerik:GridBoundColumn
>
.......
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>