Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
192 views
hope you can help me, I have the following problem:

I need to export a GRID but sends me the following error

Error de servidor en la aplicación '/SCNUARP'.
--------------------------------------------------------------------------------
 
 
 Referencia a objeto no establecida como instancia de un objeto.
Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código.
 
Detalles de la excepción: System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
 
Error de código fuente:
 
 
 
 
Se ha generado una excepción no controlada durante la ejecución de la solicitud Web actual. La información sobre el origen y la ubicación de la excepción pueden identificarse utilizando la excepción del seguimiento de la pila siguiente.
 
 
Seguimiento de la pila:
 
 
 
 
 
[NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.]
   Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderForm(HtmlTextWriter nullWriter, Control form) +2186
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +268
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +102
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderPage(HtmlTextWriter nullWriter, Control page) +179
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +268
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1386
  
 
 
--------------------------------------------------------------------------------
Información de versión: Versión de Microsoft .NET Framework:4.0.30319; Versión ASP.NET:4.0.30319.18055

when exporting ExcelML

this is the code I use:

Protected Sub BTExportar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTExportar.Click
       If Hoja.Items.Count > 0 Then
           Hoja.ExportSettings.ExportOnlyData = True
           Hoja.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML
           Hoja.MasterTableView.ExportToExcel()
       End If
   End Sub

Dim Tabla As New DataTable
        Tabla.Columns.Add("CVE")
        Tabla.Columns.Add("seccion")
        Tabla.Columns.Add("indicador")
        Tabla.Columns.Add("criterio")
        Tabla.Columns.Add("si")
        Tabla.Columns.Add("no")
        Tabla.Columns.Add("na")
        Tabla.Columns.Add("avance")
        Tabla.Columns.Add("accion")
        Tabla.Columns.Add("responsable")
 
 Fila(0) = "Clave"
 Fila(1) = Seccion
 Fila(2) = ""
 Fila(3) = ""
 Fila(4) = ""
.
.etc.
 
 Tabla.Rows.Add(Fila)
  Hoja.DataSource = Tabla
  Hoja.DataBind()

this is how I link and exported

I can not export to ExcelML only excel

appreciate your help



Faustino
Top achievements
Rank 1
 answered on 19 Mar 2014
5 answers
125 views
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication2.WebForm1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
 
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
 
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
 
     <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
 
     <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
 
          <telerik:RadTreeList ID="RadTreeList1" runat="server"
              DataSourceID="SqlDataSource1" ParentDataKeyNames="REPORTS_TO"
              DataKeyNames="EMP_ID" AutoGenerateColumns="False" Width="617px">
 
               <Columns>
 
                    <telerik:TreeListBoundColumn DataField="EMP_ID" UniqueName="EMP_ID" HeaderText="EMP_ID"></telerik:TreeListBoundColumn>
 
                    <telerik:TreeListBoundColumn DataField="REPORTS_TO" UniqueName="REPORTS_TO" HeaderText="REPORTS_TO"></telerik:TreeListBoundColumn>
 
                    <telerik:TreeListBoundColumn DataField="SALES" UniqueName="SALES" HeaderText="SALES"></telerik:TreeListBoundColumn>
 
                     
 
               </Columns>
 
          </telerik:RadTreeList>
 
     </telerik:RadAjaxPanel>
 
     <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT "EMP_ID", "REPORTS_TO", "SALES" FROM "TREE_LIST_TEST""
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"></asp:SqlDataSource>
    </div>
    </form>
</body>
</html>

Logan Marshall
Top achievements
Rank 2
Iron
 answered on 19 Mar 2014
4 answers
104 views
I would like to add a column in excel generated with the day's date, plus the name of the report. I found no matter how to do, could someone help?
Murilo Savi
Top achievements
Rank 1
 answered on 19 Mar 2014
4 answers
89 views
Hello

On our scheduler, we'd like to set Minutes per row to 120, but the rendering is wrong.
The problem appears when you set presion higher then 30.

I can reproduce the problem on your online demos :
http://demos.telerik.com/aspnet-ajax/scheduler/examples/day-week-multi-day-views/defaultcs.aspx

Minutes per row : 60
Show All Day Row : true
Row Height : 25 px or 16 px (more visible)
Group By : Calendar
Groupng Direction : Vertical

Thanks
Boyan Dimitrov
Telerik team
 answered on 19 Mar 2014
1 answer
106 views
i'm using the radmenu and the 3rd nested menu is not showing.... can someone help?

 <radM:RadMenu
                ID="rmUserMenu"
                AppendDataBoundItems="True"
                Skin="Intranet"
                runat="server"
                Width="100%"
                DefaultGroupSettings-OffsetX="20">
                <Items>
                    <radM:RadMenuItem
                        runat="server"
                        Text="Referral"
                         NavigateUrl="~/Referral.aspx">                        
                    </radM:RadMenuItem>
                    <radM:RadMenuItem ID="RadMenuItem5"
                        runat="server"
                        Text="New"
                            NavigateUrl="~/new.aspx?i=0">
                    </radM:RadMenuItem>
                    <radM:RadMenuItem ID="RadMenuItem6"
                        runat="server"
                        Text="Document"
                            NavigateUrl="~/Document.aspx">
                    </radM:RadMenuItem>
                    <radM:RadMenuItem ID="RadMenuItem16"
                        runat="server"
                        Text="Admin">
                            <Items >
                                <radM:RadMenuItem ID="RadMenuItem3"
                                    runat="server"
                                    Text="Staff"
                                    NavigateUrl="~/Staff.aspx">
                                </radM:RadMenuItem>
                                <radM:RadMenuItem ID="RadMenuItem7"
                                    runat="server"
                                    Text="Data">
                                        <Items>
                                            <radM:RadMenuItem ID="RadMenuItem8"
                                                runat="server"
                                                Text="Reason"
                                                 NavigateUrl="~/Data.aspx?i=1">                        
                                            </radM:RadMenuItem>
                                            <radM:RadMenuItem ID="RadMenuItem9"
                                                runat="server"
                                                Text="Form"
                                                 NavigateUrl="~/DataMgmt.aspx?i=2">                        
                                            </radM:RadMenuItem>
                                            <radM:RadMenuItem ID="RadMenuItem10"
                                                runat="server"
                                                Text="Notified"
                                                 NavigateUrl="~/DataMgmt.aspx?i=3">                        
                                            </radM:RadMenuItem>
                                           
                                        </Items>
                                </radM:RadMenuItem>
                            </Items>
                    </radM:RadMenuItem>                                         
                </Items>
            </radM:RadMenu>
Chris Du
Top achievements
Rank 1
 answered on 19 Mar 2014
2 answers
343 views
Hi to all,
I'm facing an annoying problem with RadGrid OnInsertCommand + RadEditor, more specifically (following this demo on Telerik examples portal: http://demos.telerik.com/aspnet-ajax/editor/examples/edittemplate/defaultcs.aspx) I'm trying to handle the insert command from code behind and the problem is that I'm not able to get the 'Content' of the RadEditor after the Insert calls the code behind.

Some code will be more explicative:

.aspx (my RadGrid with RadEditor inside)
<telerik:RadGrid ID="Content_RadGrid" runat="server"
    AutoGenerateColumns="false"
    AutoGenerateInsertColumn="true"
    AutoGenerateEditColumn="true"
    AutoGenerateDeleteColumn="true"
    OnInsertCommand="Content_RadGrid_InsertCommand"
    OnUpdateCommand="Content_RadGrid_UpdateCommand">
    <MasterTableView DataKeyNames="pID" CommandItemDisplay="Bottom">
        <Columns>
            <telerik:GridTemplateColumn UniqueName="ID" Display="true">
                    <ItemTemplate>
                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("pID") %>'></asp:Label>
                    </ItemTemplate>
            </telerik:GridTemplateColumn>
 
            <telerik:GridTemplateColumn UniqueName="Content" ItemStyle-HorizontalAlign="Justify">
                    <ItemTemplate>
                        <asp:Label ID="lblField1" CssClass="text" runat="server" Text='<%# Eval("Content") %>'></asp:Label>
                    </ItemTemplate>
 
                    <InsertItemTemplate>
                        <telerik:RadEditor ID="Insert_RadEditor" runat="server" Content='<%# Bind("Content") %>' Language="it-IT" EnableResize="false" Width="1000px" Height="300px">
                            <Tools>
                                <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="Cut"></telerik:EditorTool>
                                        <telerik:EditorTool Name="Copy"></telerik:EditorTool>
                                        <telerik:EditorTool Name="Paste"></telerik:EditorTool>
                                </telerik:EditorToolGroup>
                            </Tools>
                        </telerik:RadEditor>
                    </InsertItemTemplate>
 
                    <EditItemTemplate>
                        <telerik:RadEditor ID="Update_RadEditor" runat="server" Content='<%# Bind("Content") %>' Language="it-IT" EnableResize="false" Width="1000px" Height="300px">
                            <Tools>
                                <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="Cut"></telerik:EditorTool>
                                        <telerik:EditorTool Name="Copy"></telerik:EditorTool>
                                        <telerik:EditorTool Name="Paste"></telerik:EditorTool>
                                </telerik:EditorToolGroup>
                            </Tools>
                        </telerik:RadEditor>
                    </EditItemTemplate>
 
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

.aspx.cs
#region Test Methods
 
    protected void Content_RadGrid_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        RadEditor rd = e.Item.FindControl("Insert_RadEditor") as RadEditor;
 
        string content = rd.Content;
        string text = rd.Text;
 
        Response.Write("Breakpoint1");
    }
 
    protected void Content_RadGrid_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        RadEditor rd = e.Item.FindControl("Update_RadEditor") as RadEditor;
 
        string content = rd.Content;
        string text = rd.Text;
 
        Response.Write("Breakpoint2");
    }

The problem is that when i hit the Insert and the debugger make me jump at 'Breakpoint1' my Content and Text are empty ("") instead of what I wrote before.  When I hit Update in Edit mode (obviously debugger jump on 'Breakpoint2') Content and Text have the right values from the DataSource.

I'm sure that I get the right RadEditor Control both in Insert that in Update because if I change the properties of one of that I can use the debugger to obtain evidence that I'm taking the right control.

I'm saying that is a strange issue because if you try providing Datasource directly in the .aspx, like in the Telerik Demo, all works perfectly.
I have tried many approaches found on the internet and in many forums but no one fits with my problem and I can't find a working example of handling the Insert command.
Am I missing something?

Thanks in advance
M
Marco
Top achievements
Rank 1
 answered on 19 Mar 2014
1 answer
87 views
HTMLChart is automatically formatting the ranges of some of my range categories to dates.  I tried changing the XAxis type to 'Category' and put in a dataformatstring in the labelsappearance tag to {0} but it didn't fix the issue.  It auto-formats it for ranges it thinks are dates (e.g. '5 - 9' and '10 - 14').   How can I fix this problem?
Danail Vasilev
Telerik team
 answered on 19 Mar 2014
2 answers
59 views
Hello

I'd like to add page break inside Scheduler, AgendaView, between each ressource
My configuration is GroupingDirection/vertical and GroupBy/ressource

I try this ...
.RadScheduler_Web20 .rsSubHeader
{
page-break-after : always !important;
}
...but it doesn't work...

I read that it's difficult to add page break inside table (you have to be display: block, float:none ... but it broke the sqheduler...)

Is there a trick I can add tto achieve this ?

Thanks in advance for your help
MI87
Top achievements
Rank 1
 answered on 19 Mar 2014
1 answer
111 views
Hi,
      I Want to do a on button Click Grid AllowScroll Property Enable/Disable using Java-script. How can do it .Please Provide Help Full Solutions with Example.

Thanks,
Rahul
Viktor Tachev
Telerik team
 answered on 19 Mar 2014
6 answers
143 views
Hi,

I am exporting a RadGrid and directing the output to a server file in the OnGridExporting event.
The file is successfully created and if I open it with NotePad the file does in fact begin with %PDF-.
But when I attempt to open it in my browser, I get the error you see in the title of this thread.
I cannot open it directly with Adobe Reader either.

I used the technique identified in this thread to create the file (although it was for an xls file):

Here are the relevant code pieces:

Declaration:
<telerik:RadGrid ID="grdRACI" Skin="Outlook" GridLines="Both" runat="server" AutoGenerateColumns="true" OnGridExporting="grdRACI_Exporting"
                            OnItemDataBound="grdRACI_ItemDataBound" OnColumnCreated="grdRACI_ColumnCreated" >
                            <MasterTableView NoMasterRecordsText="No responsibilities defined" NoDetailRecordsText="No responsibilities defined">
                            </MasterTableView>
                            <ClientSettings>
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                <Resizing AllowColumnResize="true" AllowResizeToFit="true" ResizeGridOnColumnResize="true" />
                            </ClientSettings>
                            <ExportSettings OpenInNewWindow="false" HideStructureColumns="true">
                            </ExportSettings>
                        </telerik:RadGrid>

Code that performs the export:
...
grdRACI.ExportSettings.Pdf.PageTitle = "RACI Chart For - " + Session["currentProcessName"].ToString();
        grdRACI.ExportSettings.Pdf.DefaultFontFamily = "Arial Narrow";
        grdRACI.ExportSettings.Pdf.PageLeftMargin = Unit.Parse("0.25in");
        grdRACI.ExportSettings.Pdf.PageRightMargin = Unit.Parse("0.25in");
        Session["RACI_PDF_Filename"] = "ExternalDocs/" + "RACI_Chart_ For_" + Session["currentProcessName"].ToString() + " - " + DateTime.Now.ToString("ddMMMyyyy-HHmm") + ".pdf";
        grdRACI.MasterTableView.ExportToPdf();
...

Code that creates the file:
protected void grdRACI_Exporting(object source, GridExportingArgs e)
    {
        string path = Server.MapPath("~/" + Session["RACI_PDF_Filename"].ToString());
        using (FileStream fs = File.Create(path))
        {
            Byte[] info = System.Text.Encoding.Unicode.GetBytes(e.ExportOutput);
            fs.Write(info, 0, info.Length);
        }
        Response.Redirect(Request.Url.ToString());
    }


What am I doing wrong?

Thanks in advance for any suggestions.

Jim
jlj30
Top achievements
Rank 2
 answered on 19 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?