This is a migrated thread and some comments may be shown as answers.

Using an LLBLGen Collection as DataSource

1 Answer 206 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jerry Gray
Top achievements
Rank 1
Jerry Gray asked on 06 Jun 2008, 05:52 PM
Has anyone use an LLBLGen Collection as a Reporting DataSource?

Here's what I tried:
I added a reference to my generated LLBL dll and the LLBL runtime dlls.  Then I started the New Report Wizard...Create Data Source...Business Object...My LLBL DLL...

I can drill into my dll and pick the collection I am interested in.  I see the fields in the layout dialog and add them to the report.

Since this part went smoothly, I am assuming I am on the correct path so far.  The problem I am having is getting the report to return any data.  It displays without error, but is blank aside from field titles.  I added the connection string to the app.config file.  Is that where it belongs?  Any pointers?

Thanks!




1 Answer, 1 is accepted

Sort by
0
Hrisi
Telerik team
answered on 09 Jun 2008, 01:28 PM
Hi Jeff,

You can find how Reporting serializes your Business object by looking in the Designer generated code. During processing stage of the report, your DataSource is instantiated by invoking  Activator.CreateInstance((Type)YourBusinessObject). If your BusinessObject does not contain data initialization in its default constructor, no data will be supplied to the report.

In order to fill your BusinessObject with data you can write something like this in the constructor of the report:

Class YouReport: Report
{
    public YouReport()
    {
        InitializeComponent();
       
        YourBusinessObject bo = new YourBusinessObject();
        <fill the bo with data>
        this.DataSource = bo;
    }
}


You can find in our examples how we use Bussiness objects to provide data to the ListBoundReport report.

Best wishes,
Hrisi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Jerry Gray
Top achievements
Rank 1
Answers by
Hrisi
Telerik team
Share this question
or