none
Formula error when i export report into excel RRS feed

  • Question

  • In WinForms ReportViewer,there is a formula error when I export the report into excel.

    The reason for the formula error is , we have some alphanumeric values example "Invoice Number"

    which also accept pure numeric value .

     

    When these alphanumeric values in numeric format , are exported to excel from ReportViewer, we get this formula error.

     

    I have a solution

    1)Bind the numeric values as integer or decimal to reportviewer which solves the problem.

     

    Does anyone has any other alternate solution??

     

    Code Snippet

    -------------------------------------------------------------------------------------------

    The property is declared as string.The sample code is specified below


            public string TransactionNumber
             {
                     get
                     {
                          return transactionNumber;
                     }
                     set
                     {
                         transactionNumber = value;
                      }
                  }

     

    at the time of binding into DataList(Declared as an array), the input  integer value(i.e Reference) is assign to the string variable      "TransactionNumber "
         
              protected override void Bind()
              {
                CustomerTransactionHistoryBinder helperItem = new CustomerTransactionHistoryBinder();
             

       helperItem.TransactionNumber = (string)(row["Reference"]);

    }

     

    at the time of adding Column to the Table in DLO.cs files

    iii)  table.Columns.Add(new DataColumn("Reference", Type.GetType("System.String")));

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
     

    How to avoid this error without changing the property as Integer?

     

    Please help me !

     

    Thanks

     

    Thursday, March 27, 2008 8:48 AM