Bug Report B133437
Visible to All Users

"Unable to cast object of type 'System.DBNull' to type 'System.String'" exception when clicking on the filter button

created 16 years ago

Hi,
We have the problem that PivotGrid crashes when I click on the Filter button of an attribute in a hierarchy. We have a Product dimension that has an attribute hierarchy of Years, Quarters, Months, Days stating the products introduction date. Now for some products the datetime field in the database is empty since we do not have that information available.
Unfortunately, for the years, the PivotGrid converts the year null to 0 (instead of blank) and filtering on quarters or months crashes with a "Unable to cast object of type 'System.DBNull' to type 'System.String'" Exception.
Attached you'll find a backup of the demo cube.
Steps to Reproduce:

  1. Restore the Cube
  2. Drag the Amounts measure to the data area
  3. Drag the 'Date of Origin' attribute of the Products dimension to the rows area
    --> year 'null' shows as 0
  4. Click on the quarters filter.
    --> Exception
    Actual Results:
    "Unable to cast object of type 'System.DBNull' to type 'System.String'" Exception
    Expected Results:
  5. Null should show up blank or as the definition of property 'UnknownMemberName' as set on the dimension, but not 0
  6. There should not be an exception when trying to filter for quarters or months.
Comments (3)
KM KM
Konstantinos Manthos 16 years ago

    Here's the SQL 2005 database

    KM KM
    Konstantinos Manthos 16 years ago

      And here's a screenshot of the problem

      DevExpress Support Team 16 years ago

        Hello Marcel,
        As for the member captions, currently, you should handle the FieldValueDisplayText event to provide required display text. I've created a suggestion ID S31768 (OLAP - Add the capability to load member captions from the OLAP datasource and show them by default) that asks for the capability to retrieve member captions by default.
        This bug is currently fixed.
        Thanks,
        Ivan

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.