Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
80 views

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

K W
Top achievements
Rank 1
 asked on 17 Aug 2017
0 answers
85 views

I am trying to export a page to PDF and when the code reaches the page render section, I am getting an error for the RadAjaxManager. 

I have several RadHtmlCharts on the page and am trying to export them to a PDF. Here is a snippet of the control:

 <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:

Protected Sub ExportButton_OnClick(sender As Object, e As EventArgs) Handles ExportButton.Click

        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]()

    End Sub

 

 

 

K W
Top achievements
Rank 1
 asked on 17 Aug 2017
0 answers
90 views

Hi,

I have a situation where we're wanting to use a Gantt in an ASP.NET repeater (so the user can look at individual project meta data and progress etc). However the Rad Gantt doesn't appear to play nicely in a repeater.

As soon as I add the gantt control (whether straight into the repeaters item template, or in a user control) it tries to do it;s binding and rendering while the repeater's header is being processed. 

Any suggestions?

 

Cheers

-Roger

Roger
Top achievements
Rank 1
 asked on 17 Aug 2017
1 answer
144 views

I've tried everything I can think of to get the export working but I keep getting:

System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentOutOfRangeException: Width must be non negative. Parameter name: value at System.Web.UI.WebControls.Style.set_Width(Unit value) at Telerik.Web.UI.RadDataBoundControl.set_Width(Unit value) at Telerik.Web.UI.Scheduler.SchedulerExporter.RenderControl(Page page) at Telerik.Web.UI.Scheduler.SchedulerExporter.PdfExportRenderForm(HtmlTextWriter nullWriter, Control form)

 

I do not know which control(s) this is referring to.....

Christopher
Top achievements
Rank 1
 answered on 16 Aug 2017
1 answer
77 views

I am trying to get an image to upload into sql from inside Listview. I can select the image, and it make it to the server, but when i click update i get the below error. I am able to get it working from a normal aspx page.

 

Operand type clash: tinyint is incompatible with imageDescription: 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. 

Cannot insert the value NULL into column 'Logo', table 'FUNERALMANAGEMENTONLINE.dbo.Funeralhomes'; column does not allow nulls. UPDATE fails.
The statement has been terminated.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.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'Logo', table 'FUNERALMANAGEMENTONLINE.dbo.Funeralhomes'; column does not allow nulls. UPDATE fails.
The statement has been terminated.

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: 

[SqlException (0x80131904): Cannot insert the value NULL into column 'Logo', table 'FUNERALMANAGEMENTONLINE.dbo.Funeralhomes'; column does not allow nulls. UPDATE fails. The statement has been terminated.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2434922 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5736592 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +3731 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +225 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2026 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +375 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +337 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +280 System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +392 System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +670 System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +106 Telerik.Web.UI.RadListView.PerformUpdate(RadListViewDataItem editedItem, Boolean suppressRebind) +289 Telerik.Web.UI.RadListViewCommandEventArgs.ExecuteCommand(Object source) +350 Telerik.Web.UI.RadListView.OnBubbleEvent(Object source, EventArgs args) +95 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 Telerik.Web.UI.RadListViewItem.OnBubbleEvent(Object source, EventArgs args) +66 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +114 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +260 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639

 

Here is the code part which is giving me the issue:

Protected Sub ruCustomerImage_FileUploaded(sender As Object, e As FileUploadedEventArgs)
        'MsgBox("ruCustomerImage_FileUploaded", MsgBoxStyle.Information, "Murasalat")
        Dim updateImage As String = ", [Logo] = @Logo"
        Dim parameter As New Parameter("Logo", System.Data.DbType.Binary)
        SqlDataSource1.UpdateParameters.Add(parameter)
        SqlDataSource1.UpdateCommand = [String].Format("UPDATE FuneralHomes SET Logo = @Logo WHERE FuneralHomeId = '1000000'", updateImage)

    End Sub

 

Evelio
Top achievements
Rank 1
 answered on 16 Aug 2017
0 answers
80 views
We are using v4.0.30319 and viewing on the chrome browser v60.0.3112.90. The inline style being generated with the RadDatePicker is display:inline-block and width:160px;, although the width is 160px, the box and calendar icon take up more space, so some items are overlapping on top of the  date picker. There is a workaround to specify the width within the control, but this seems like a bug. Can anyone shed some insight?
Zachary
Top achievements
Rank 1
 asked on 16 Aug 2017
4 answers
5.2K+ views
Hi,

Is there any way to set the SelectedIndex of a RadComboBox via javascript?

I've managed to set the text to blank via this code:

var combo = $$('.wherecombotown')[0];
combo.getElementsBySelector('input')[0].value = '';

However this still keeps the selected index the same; I can't seem to find any way of setting the index back to -1;

Many thanks,

Ben
Robert
Top achievements
Rank 1
 answered on 16 Aug 2017
0 answers
70 views
01.<telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="BlackMetroTouch" DataEndField="EndTime"
02.    DataKeyField="id" DataSourceID="SqlDataSource1" DataStartField="StartTime" Height="517px"
03.    RowHeight="32px" StartEditingInAdvancedForm="False" DataSubjectField="event"
04.    DataDescriptionField="Description" DataRecurrenceField="RecData" DataRecurrenceParentKeyField="RecParent"
05.    DayStartTime="07:00:00" TimeZoneID="Eastern Standard Time" TimeZoneOffset="-04:00:00"
06.    ResolvedRenderMode="Classic">
07.    <InlineInsertTemplate>
08.        <div id="InlineInsertTemplate" class="rsCustomAppointmentContainer ">
09.            <telerik:RadDropDownList RenderMode="Auto" runat="server" ID="RadDropDownList2" DataSourceID="SqlDataSource2"
10.                Width="300px" DefaultMessage="Select Job:" DropDownHeight="200px" DataValueField="JobNumber"
11.                DataTextField="JobDes" AutoPostBack="True" OnItemSelected="JobNumSelected">
12.        </telerik:RadDropDownList>
13.            <telerik:RadDropDownList ID="RadDropDownList1" RenderMode="Auto" runat="server" AutoPostBack="true"      DefaultMessage="Select a Phase..."
14.            DropDownHeight="200px" Width="150px"  DataSourceID="SqlDataSource3" DataTextField="PhaseString" DataValueField="PhaseCode" EnableAriaSupport="False">
15.            </telerik:RadDropDownList>
16.        </div>
17.    </InlineInsertTemplate>
18.    <AdvancedForm Modal="true" />
19.</telerik:RadScheduler>
In C# within the "JobNumSelected" method I can type RadScheduler1 and it will be a valid reference to the object. I cannot type RadDropDownList1 and have it be a valid reference I can only see the base object not the instance I created. If I move the RadDropDownList object outside of the RadScheduler I can reference it just fine. 

I'm trying to make a scheduler where a user can select a job and a phase and that would show them being busy for whatever time period they selected. 
Derek Goeller
Top achievements
Rank 1
 asked on 16 Aug 2017
12 answers
953 views

Hi,

I cannot get any kind of information out of spreadsheet. sheet count is zero, I could not figured out how to access cells...

I load demo xlsx files but I cannot access any information. also there's not much in help section.

 

Does this control serves just lo load and show xls files ? what I'm missing ?
Fay
Top achievements
Rank 1
 answered on 16 Aug 2017
1 answer
128 views

I am trying to get the value of a Radeditor field in a User Control when updating to store it in my database table

In the update command of my grid I have tried using both of these commands

 

Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)

Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)

 

Dim editorcomment As RadEditor
editorcomment = CType(MyUserControl.FindControl("Comment"), RadEditor)
editorcomment = editedItem.FindControl("Comment")

Neither of these commands brings back any data in editorcomment.Content

Please can you give me some code which will retrieve the Content of the RadEditor field

 

 

Suzan
Top achievements
Rank 1
 answered on 16 Aug 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?