Grid Export To Excel and other issues

4 posts, 0 answers
  1. devoas
    devoas avatar
    69 posts
    Member since:
    Dec 2009

    Posted 08 Apr Link to this post

    Hi, 

    We found few issues related to Export to Excel ...

    1. Group Totals are not appearing in Excel output. We have tested both ExcelML and BIff... Group Header and Grand total row appear in Excel but Group totals not appear. We have not set any GroupFooter template and expect simple total should appear.

    2. We are getting Excel Sheets without formatting. Is there any easy way that Excel should get same formatting as it view like Winform grid.

         If not then what is the generic way to format it, as we are creating single Viewer for different grid based report - generated dynamically thru code and placed on Asp form.  

    3.While adding Java script for handling Double click Event, we found a solution to use Client Side Event RowDbClick ... which pass args..
        in that ars._datakeyvalues.Id    (ClientKeyName)  ... now the problem is that we have same asp page used as viewer for different kind of grid based reports.
        each have different fields .... We can set ClientKeyNames thru code but how to make this Java script dynamic... 
        In one Report we have Id field, in Second report we have ProductId .... This makes difficult to pass different key thru clientside event..

     

     

     

     

  2. devoas
    devoas avatar
    69 posts
    Member since:
    Dec 2009

    Posted 08 Apr in reply to devoas Link to this post

    Is there any way to make the Java script dynamic ... Means we can tell which field it has to pass... Or if we can pass the entire datakeyvalues to backend where thru reflection we can extract required fields ... I tried to pass datakeyvalues but could not extract the required columns...

     

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kostadin
    Admin
    Kostadin avatar
    1708 posts

    Posted 13 Apr Link to this post

    Hi,

    Strait to your questions.
    1. I am afraid both export format does not export the footer group item. Nevertheless, you can manually create the Excel file by using the Export Infrastructure and add the footer item as well. Please check out the following code library which demonstrates that.
    2. Please check out the following help article which elaborates more on styling the Excel document.
    3. Regards your second question you can hook the RowDbClick event programmatically and pass the data field name as an additional parameter. Please check out the following code snippet.
      C#:
      protected void Page_Load(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              string fieldValue = "Column1";
              RadGrid1.ClientSettings.ClientEvents.OnRowDblClick = "function(s,a){ OnRowDblClick(s,a, '" + fieldValue + "')}";
          }
      }

      JavaScript:
      <script type="text/javascript">
          function OnRowDblClick(sender, args, fieldValue) {
              var value = args.getDataKeyValue(fieldValue);
          }
      </script>

    Regards,
    Kostadin
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  5. devoas
    devoas avatar
    69 posts
    Member since:
    Dec 2009

    Posted 14 Apr Link to this post

    Thanks ...  Dynamic Java script issue resolved... 

    But Excel Rendering have issue... Tried your code sample.. Having following issues. We are using Q2015.1.25.35

    1. We cannot find xls.XlsxRenderer(structure);  this method.

    2. If using xls.XlsBiffRenderer(structure); ...... Then it has following issues

         It is not allowing leading spaces.

     

     

  6. devoas
    devoas avatar
    69 posts
    Member since:
    Dec 2009

    Posted 14 Apr in reply to devoas Link to this post

    2. If using xls.XlsBiffRenderer(structure); ...... Then it has following issues
         It is not allowing leading spaces.

          And it is not creating Total Rows.... Can you pls share any code sample where Grid with Groupings & Total is exported to Excel properly having some leading spaces columns ... it will be really helpful.

    Thanks.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017