Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
860
Exception using Infragistics.Olap.Excel.ExcelDataConnectionSettings
posted

Hello

I am using the XamPivotGrid with a FlatDataSource build from Excel. I followed your example on the sample browser:

FlatDataSource flatDataSource = new FlatDataSource();

            ExcelDataConnectionSettings excelDataSettings = new ExcelDataConnectionSettings

            {

                FileStream = pStream,

                GeneratedTypeName = pName,

                WorksheetName = pWorksheetName

            };

 

            ExcelDataConnectionSettings.AddExcelCellFormatMapping(

                "\"$\"#,##0.00_);[Red]\\(\"$\"#,##0.00\\)",

                "{0:C3}"

            );

 

            ExcelDataConnectionSettings.AddExcelDateTimeCellFormatMapping("d/m/yy;@", "M/d/yy");

 

            flatDataSource.ConnectionSettings = excelDataSettings;

 

            CubeMetadata cubeMetadata = new CubeMetadata()

            {

                DataTypeFullName = "ExcelData",

                DisplayName = "Data",

            };

 

 

            flatDataSource.CubesSettings.Add(cubeMetadata);

 

When I use an Excel sheet with formulas that return "" in a number field I get an exception. I cannot attach any sheet so I will try to explain it here :) Create this in Excel:

Column A

Column B

Result

1

2

3

3

 

 

4

6

10

8

0

8

In the Result column use the following formula: "=IF(B2<>"";SUM(A2:B2))" (replace A2;B2 with A3; B3 and so on). The idea is that row 2 result will be empty and cuase this exception:

System.ArgumentException: Object of type 'System.String' cannot be converted to type 'System.Double'.

   at Infragistics.Olap.Excel.ExcelDataConnectionSettings.RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e)

   at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)

   at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)

 

Do you have any workaround/solution for this error?

Parents
No Data
Reply
  • 16495
    Offline posted

    Hello,

    I have reviewed the details you have provided and unfortunately it seems that the XamPivotGrid does not support mixed data type in same column.  After  doing some research and contacting with our development team  the mixed type data  has been determined to be a product idea. You can suggest new product ideas for future versions (or vote for existing ones) at

    http://ideas.infragistics.com

    Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
    Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it.  You can also link back to this thread for additional details.

    Thank you in advance to submitting your product idea.

    Sincerely,
    Zhivko
    Entry Level Software Developer

Children
No Data