ExportToExcel worksheet name

5 posts, 0 answers
  1. Rene de Vries
    Rene de Vries avatar
    8 posts
    Member since:
    May 2003

    Posted 17 Jun 2009 Link to this post

    Simple question  :)

    Is it possible to assign a name to the Excel file worksheet created via RadGrid.MasterTableView.ExportToExcel() ?  I've noticed that the sheet automatically gets the same name as the given filename, but I would like to be able to change that.


  2. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 17 Jun 2009 Link to this post

    Hello Rene,

    It depends on the Export engine you use. It is possible to change the worksheet name for ExcelML only. Microsoft Excel automatically sets the worksheet name (equal to the file name) when using the HTML format.

    Best regards,
    Daniel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 09 Jul 2009 Link to this post

    Hello all,

    I was asked about how to change the name of the worksheet when exporting to ExcelML.
    protected void RadGrid1_ExcelMLExportRowCreated(object source, GridExportExcelMLRowCreatedArgs e) 
        ... 
        e.Worksheet.Name = "my worksheet"

    Regards,
    Daniel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Srujan
    Srujan avatar
    18 posts
    Member since:
    Oct 2010

    Posted 19 Sep 2013 Link to this post

    Hi Daniel ,

    When I try to include RadGrid1_ExcelMLExportRowCreated() event sheet name changes but no data is exported to excel .Below is the code I am using ,can you please suggest how to proceed further .

     

    RadGrd1.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
    RadGrd1.PageSize = RadGrd1.MasterTableView.VirtualItemCount;
    RadGrd1.ExportSettings.IgnorePaging = true;
    RadGrd1.ExportSettings.OpenInNewWindow = true;
    RadGrd1.ExportSettings.ExportOnlyData = true;
    RadGrd1.ExportSettings.FileName = "FileName";
    RadGrd1.MasterTableView.ExportToExcel();

    Thanks

  6. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 24 Sep 2013 Link to this post

    Hi Srujan,

    Try setting the UseAllDataFields to true as shown below:
    <MasterTableView UseAllDataFields="true" .....>
           ....
    </MasterTableView>

    Regards,
    Daniel
    Telerik
    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 the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017