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

Script control "controlName" is not registered when I try to export to pdf

2 Answers 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 22 Feb 2017, 08:42 PM

All,

I have a pretty simple grid setup (see grid code below). When I try to export to PDF I get the exception below. I can't register the controls because I only have reference to them during "ItemDataBound" event.

What's the work around on this one?

Script control 'lblDealer' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Parameter name: scriptControl

 

Here is my RadGrid Markup

01.<telerik:RadGrid runat="server" ID="gvDealerTunes" RenderMode="Lightweight" AllowPaging="False" AllowSorting="True" AllowFilteringByColumn="False">
02.            <ExportSettings IgnorePaging="True" OpenInNewWindow="True">
03.                <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="45mm"
04.                     BorderStyle="Medium" BorderColor="#666666"/>
05.            </ExportSettings>
06.            <MasterTableView AutoGenerateColumns="False">
07.                <Columns>
08.                    <telerik:GridBoundColumn HeaderText="Tune Order Id" DataField="TuneOrderId"/>
09.                    <telerik:GridTemplateColumn HeaderText="Dealer">
10.                        <ItemTemplate>
11.                            <telerik:RadLabel runat="server" ID="lblDealer"/>
12.                        </ItemTemplate>
13.                    </telerik:GridTemplateColumn>
14.                    <telerik:GridTemplateColumn HeaderText="Customer">
15.                        <ItemTemplate>
16.                            <telerik:RadLabel runat="server" ID="lblCustomer"/>
17.                        </ItemTemplate>
18.                    </telerik:GridTemplateColumn>
19.                    <telerik:GridBoundColumn HeaderText="Zen Ticket #" DataField="ZenDeskTicketNumber"/>
20.                    <telerik:GridBoundColumn HeaderText="Vendor Order #" DataField="VendorOrderNumber"/>
21.                    <telerik:GridBoundColumn DataField="OrderedVerified" HeaderText="Verified"/>
22.                    <telerik:GridBoundColumn DataField="OrderVerfificationSource" HeaderText="Verification"/>
23.                    <telerik:GridBoundColumn DataField="IsTuneUpdate" HeaderText="Tune Update?"/>
24.                    <telerik:GridBoundColumn DataField="TuneCanBeAutoGenerated" HeaderText="AG?"/>
25.                    <telerik:GridBoundColumn DataField="TuneGenerated" HeaderText="Generated?"/>
26.                    <telerik:GridBoundColumn DataField="TuneOrderCreationDateTime" HeaderText="Created"/>
27.                    <telerik:GridBoundColumn DataField="SubmittedToZenDeskDateTime" HeaderText="Submitted"/>
28.                </Columns>
29.            </MasterTableView>
30.        </telerik:RadGrid>

 

Export button code

1.private void BtnExport_Click(object sender, EventArgs e)
2.        {
3.            gvDealerTunes.MasterTableView.ExportToPdf();
4.        }

 

Thanks in advance!! 

 

2 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 27 Feb 2017, 07:21 AM
Hi Matt,

Try setting the following property:
<ExportSettings ExportOnlyData="true">

You can also check the attached web site sample for a basic reference.
I hope this will prove helpful.

Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Matt
Top achievements
Rank 1
answered on 27 Feb 2017, 02:25 PM

That did it! Thank you!

 

Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Matt
Top achievements
Rank 1
Share this question
or