Expor to Excel Ajax

6 posts, 0 answers
  1. SANNIDHI
    SANNIDHI avatar
    24 posts
    Member since:
    May 2009

    Posted 27 Dec 2011 Link to this post

    Hi,

           I want to export radgrid to excel..
         
          In that i have one column with hyperlink and i want to that hyperlink with href should be present in Excel also..

          Please give me Reply ASAp.

    Thanks,
    SANNIDHI
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 27 Dec 2011 Link to this post

    Hello,

    Try the following.
    ASPX:
    <telerik:RadGrid ID="grid1" runat="server" CellSpacing="0" DataSourceID="SqlDataSource1" AllowPaging="true" OnItemCreated="grid1_ItemCreated" OnExcelExportCellFormatting="grid1_ExcelExportCellFormatting">
      <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
      </ExportSettings>
        <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="EmployeeID">
           <CommandItemSettings ShowExportToPdfButton="true" />
           <Columns>
                        .... ... ...
               <telerik:GridHyperLinkColumn DataTextFormatString="Search Google for '{0}'" DataNavigateUrlFields="FirstName" UniqueName="FirstName" DataNavigateUrlFormatString="http://www.google.com/search?hl=en&q={0} btnG=Google+Search" DataTextField="FirstName">
              </telerik:GridHyperLinkColumn>
         </Columns>
       </MasterTableView>
    </telerik:RadGrid>

    Thanks,
    Princy.
  3. SANNIDHI
    SANNIDHI avatar
    24 posts
    Member since:
    May 2009

    Posted 27 Dec 2011 Link to this post

    Hi,


              I tried this..hyeprlink is working fine in grid..
      
                when grid is exported to excel..hyeprlink is not working..means it is not showing any link for the respective text.


    Thanks,
    PANDU
  4. SANNIDHI
    SANNIDHI avatar
    24 posts
    Member since:
    May 2009

    Posted 27 Dec 2011 Link to this post

    I am using

     

    <ExportSettings FileName="SearchResult" Excel-Format="ExcelML" HideStructureColumns="false" ></ExportSettings>

    .

    Please tell me the solution....


    i dont want to use html format...just excelML

    cellelement.href is also not working for meeeee
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 28 Dec 2011 Link to this post

    Hello,

    I have tried the same code I have given in the above post and it shows link for respective text. I am using the version 2011, 2, 915, 35. Here is the screenshot.

    Thanks,
    Princy.
  6. Andrey
    Admin
    Andrey avatar
    836 posts

    Posted 28 Dec 2011 Link to this post

    Hello Sannidhi,

    RadGrid will export only the text specified in the DataTextFormatString property. So if you want to get some information in the exported file you should make sure to include it in this property.

    Other than that the approach that Princy showed should work for you. Give this approach a try and check whether this is the desired behavior.


    All the best,
    Andrey
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top