Excel export , column header and Null date field

  1. #1

    Excel export , column header and Null date field

    Good morning all

    I have been working on this example (https://examples1.ext.net/#/GridPane...Data_PostBack/) to export store into an Excel file.
    I found out that when the first row of a datecolumn is empty, the column header is not exported.

    For example, if you replace the datastore of the example above by this one:
    this.Store1.DataSource = new object[]
                {
                    new object[] { 1, "3m Co", 71.72, 0.02, 0.03, "" },
                    new object[] { 2, "Alcoa Inc", 29.01, 0.42, 1.47, "9/1 12:00am" },
                    new object[] { 3, "Altria Group Inc", 83.81, 0.28, 0.34, "9/1 12:00am" },
                    new object[] { 4, "American Express Company", 52.55, 0.01, 0.02, "" },
                    new object[] { 5, "American International Group, Inc.", 64.13, 0.31, 0.49, "9/1 12:00am" },               
                    new object[] { 10, "E.I. du Pont de Nemours and Company", 40.48, 0.51, 1.28, "9/1 12:00am" },                
                    new object[] { 29, "Wal-Mart Stores, Inc.", 45.45, 0.73, 1.63, "9/1 12:00am" }
                };
    with the first now not having a date value, the column header 'lastChange' won't be exported in the excel output file.

    In this case, it is the last column so the structure is kept but when the date column is placed somewhereelse, it can screw the whole export structure.

    I am working with version 1.1.0.

    Thanks in advance for your feedback.

    Sylvain
  2. #2
    Hi,

    Please set up SubmitEmptyValue="EmptyString" or "Null".

    <ext:RecordField 
        Name="lastChange" 
        Type="Date" 
        DateFormat="M/d hh:mmtt" 
        SubmitEmptyValue="EmptyString" />

Similar Threads

  1. Replies: 0
    Last Post: Apr 05, 2012, 5:28 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. Replies: 5
    Last Post: May 23, 2011, 12:13 PM
  4. Replies: 2
    Last Post: May 22, 2011, 1:12 AM
  5. Replies: 1
    Last Post: Apr 19, 2010, 2:44 PM

Posting Permissions