GridPanel export to excel/csv - missing date column formatting

  1. #1

    GridPanel export to excel/csv - missing date column formatting

    Hi All

    I have a GridPanel that databinds to a store as below

    <ext:Store ID="Store1" runat="server" OnRefreshData="Store1_RefreshData" >
            <Reader>
                <ext:JsonReader>
                    <Fields>
                        <ext:RecordField Name="report_week" Type="Date"/>                    
    <ext:RecordField Name="count_report_week" Type="Int" />                   
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store> 
            <ext:GridPanel ID="grdChartReport" runat="server" Title="Work Completed By week" StoreID="Store1"  Frame="true" AnimCollapse="true"
                StripeRows="true" Border="true" TrackMouseOver="true" Height="800"  Width="740" AutoExpandColumn="report_week" >
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                        <ext:Column DataIndex="report_week" Sortable="true" Header="Week Beginning" Width="120">
                            <Renderer Fn="Ext.util.Format.dateRenderer('m/d/Y')" />
                        </ext:Column>                    
    <ext:Column DataIndex="count_report_week" Sortable="true" Header="Activity Count">
                        </ext:Column>                  
                    </Columns>
                </ColumnModel>
              ....
            </ext:GridPanel>
    When I export to Excel, I use the function getRowsValues to get the gridpanel values as

    grdChartReport.getRowsValues(false,false,false);

    And in the codebehind use a XSL to export to XLS

    string json = GridData.Value.ToString();
            StoreSubmitDataEventArgs eSubmit = new StoreSubmitDataEventArgs(json, null);
            XmlNode xml = eSubmit.Xml;
    But getRowsValues() fails to retain the dateformat as mm/dd/YYY and outputs as mm/dd/YYYT00:00:00.000.

    Is there a way to retain the formatting of the row values from the gridpanel while being exported?

    Would appreciate any help on this.Thanks
    Last edited by geoffrey.mcgill; May 21, 2011 at 6:03 PM.
  2. #2
    Hi,

    I've got the same issue. Has anyone from Ext.NET provide the solution for this problem?

    Thanks.
    Daniel
  3. #3

Similar Threads

  1. [CLOSED] Gridpanel export Excel HeaderText
    By CPA1158139 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 10, 2012, 9:36 AM
  2. Data Export Excel Column Names
    By BLOZZY in forum 1.x Help
    Replies: 0
    Last Post: Feb 02, 2012, 2:02 PM
  3. Excel export , column header and Null date field
    By springrider in forum 1.x Help
    Replies: 1
    Last Post: Oct 13, 2011, 5:12 PM
  4. Replies: 5
    Last Post: May 23, 2011, 12:13 PM
  5. How to export GridPanel to the Excel?
    By jachnicky in forum 1.x Help
    Replies: 3
    Last Post: Dec 01, 2008, 4:57 PM

Tags for this Thread

Posting Permissions