in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Is anyone monitoring this forum?

Last post 05-12-2008 11:14 AM by C1_IrinaP. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-12-2008 7:31 AM

    Is anyone monitoring this forum?

    I posted a problem a week ago and no one has answered my post. My project is on hold until someone from C1 can answer my question regarding using a business object created in .net as a record source. Crystal Reports can handle this situation easily. Why can't C1 reports?

     

    Here is my original post:

     

    I am trying to create a c1Report based on a business object.

    I have tried the following:

    dim open_timesheets as list(of Open_Timesheets) = Open_TimesheetsDB.GetList    'populates a list of timesheets

    dim rs as IC1ReportRecordset = ctype(open_timesheets,IC1ReportRecordset)

    c1report1.datasource.recordset = rs

    I receive the following error at the dim statement:

    Unable to cast object of type system.collections.generic.list 'ST_Classes.Open_Timesheets' to type 'C1.Win.C1Report.UCreportRecordset'

    How can I base my report on a dataobject like this? I have tried everything I could think of to make this work... Examples would be fantastic! Thanks in advance! Ken

  • 05-12-2008 11:14 AM In reply to

    Re: Is anyone monitoring this forum?

    >I posted a problem a week ago and no one has answered my post. My project is on hold
    >until someone from C1 can answer my question regarding using a business object created in
    >.net as a record source. Crystal Reports can handle this situation easily. Why can't C1
    >reports?

    IC1ReportRecordset is interface. You can't convert object to interface if object doesn't
    implement this interface.
    Try to change your code, it might look like that:

    dim open_timesheets as list(of Open_Timesheets) = Open_TimesheetsDB.GetList 'populates
    a list of timesheets
    c1report1.datasource.recordset = open_timesheets

    open_timesheets can be one of the next:

    - DataView instance;
    - DataTable instance;
    - object implementing IC1ReportRecordset;
    - object implementing ITypedList and IBindingList interfaces;
    - object implementing IListSource interface.
Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.