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

RadAjaxManager not Registering

0 Answers 63 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
K W
Top achievements
Rank 1
K W asked on 17 Aug 2017, 09:20 AM

I am trying to export a page to PDF that contains RadHtmlCharts, but I am getting a RadAjaxManager error.

Here is the html:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>

<telerik:RadHtmlChart ChartTitle-Text="Overall" runat="server" ID="rcOverall" Width="600px" Height="400px" Skin="Bootstrap" DataSourceID="sqlOverall" RegisterWithScriptManager="false">
            <PlotArea>
                <Series>
                    <telerik:BarSeries Name="BarSeries1" DataFieldY="points">
                        <LabelsAppearance Visible="false" />
                        <TooltipsAppearance Visible="false" />
                    </telerik:BarSeries>
                </Series>
                <XAxis DataLabelsField="Section" >
                    <TitleAppearance Text="Section">
                        <TextStyle FontSize="12" Bold="true" />
                    </TitleAppearance>
                </XAxis>
                <YAxis Visible="false" MinValue="0" MaxValue="27" Step="3">
                    <TitleAppearance Text="Total Mark">
                        <TextStyle FontSize="12" Bold="true" />
                    </TitleAppearance>
                </YAxis>
            </PlotArea>
            <Legend>
                <Appearance Visible="false" />
            </Legend>
        </telerik:RadHtmlChart>

The code to export is:

 Response.ContentType = "application/pdf"
   
        Response.AddHeader("content-disposition", "attachment;filename=Image.pdf")
        Response.Cache.SetCacheability(HttpCacheability.NoCache)
         Dim sw As New StringWriter()

        Dim hw As New HtmlTextWriter(sw)
        Me.Page.RenderControl(hw)

        Dim srdr As New StringReader(sw.ToString())

        Dim pdfDoc As New Document(PageSize.A4, 15.0F, 15.0F, 75.0F, 0.2F)

        Dim hparse As New HTMLWorker(pdfDoc)
       
        PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
        pdfDoc.Open()

        hparse.Parse(srdr)

        pdfDoc.Close()

        Response.Write(pdfDoc)
        Response.[End]()

When I run it I get an error:

Script control 'RadAjaxManager1' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().

Can anyone please help with this as I have looked everywhere and anything I have tried doesn't work!!!.

Any help would be very welcome. 

Thanks

K

No answers yet. Maybe you can help?

Tags
Ajax
Asked by
K W
Top achievements
Rank 1
Share this question
or