Ticket Q301125
Visible to All Users

Error loading report document

created 14 years ago

I am receiving this error when trying to load a report. The error occurs when I do not cast a datetime to a char in the underlying datasource:
 select getdate() as somedate – GENERATES ERROR
 select convert(char(10), getdate(), 121) as somedate – NO ERROR HERE
If I leave the field as a datetime type, it generates an error. Only when I cast it to a char type does the report load.
The underlying datasource is a view. The date fields are NOT used as foriegn keys when joining tables - they are only referenced like this:
select
   convert(char(10), CloseDate, 121) as CloseDate,
   convert(char(10), CommitDate, 120) as CommitDate,
   convert(char(10), OpenDate, 120) as OpenDate,

Can someone tell me what might generate this error? I'm not sure where it's coming from.
~Caesar

Comments (3)
DevExpress Support Team 14 years ago

    Hi Caesar,
    It is difficult to clearly diagnose this problem without being able to reproduce it locally.
    Could you please provide us with a sample illustrating your issue?
    We will examine it, and do our best to help you.
    Thanks,
    Andrew

    ?
    Unknown 14 years ago

      No problem…

      1. create a simple view from any table in sql with one date field aliased "somedate" like this
        create View [dbo].[vwSampleView]
        as
        select convert(char(10), <yourdatefield> 121) as somedate
        from <yourtable>
      2. create a report with the above view as the datasource.
      3. create a filter on that report where <yourdatefield> is between
        any two dates that will yield values.
      4. run the report.
        There should be no errors.
      5. Now alter the view like this to remove the cast:
        alterView [dbo].[vwSampleView]
        as
        select <yourdatefield> as somedate
        from <yourtable>
      6. run the report
      7. you should see the error.
        If you can't see the error, is there anyway someone could locate where that error is coming from and give a best guess as to why it is showing up?
        Thank you.
      DevExpress Support Team 14 years ago

        Hi Caesar,
        Thank you for your response. Our report builder methods do not interact with a database directly. When the report's DataAdapter property is initialized, the DataAdapter.Fill method is called to populate the data source. So, you should be able to reproduce a similar error by calling the DataAdapter.Fill method prior to generating a report document. Please try the solution suggested in the join tables and disply in report ticket. This should help you resolve the issue.
        Thanks,
        Alex

        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.