Crystal Report Data source based on function in a Business Logic Layer

I dont know if what I would like to do is possible but&..
I would like to base a Crystal Report on a function in my Business Logic Layer.  The Then function accepts some parameters, does a little business logic and then returns a Data Table.  I am using the Crystal Reports that are built into Visual Studio 2005.
Here are the Steps Im doing
1.      Add New Item(Crystal report)
2.      Chose Data Source:  Im picking .NET Objects
3.      I see a list of every bll that I have, but no functions within
Below is and example of some code from my bll

Public Function GetFeeData(ByVal GroupID As Integer) As DAC.tblFeeMasterDataTable
Dim dt as DAC.tblFeeMasterDataTable
dt = FeeAdapter.GetFeeByGroupID (GroupID)
dt.Fee3 = dt.Fee1 + dt.Fee2
      Return dt
End Function

So& can I base a crystal report on the data table this function returns?  Thanks for your help, John
Who is Participating?
MIKESoftware Solutions ConsultantCommented:
Where is the "data table" located..? ONLY in your LOGIC...or is there a literal table created within your DB on the SERVER..?

huston8481Author Commented:
My example was a pretty poor one.  In its case there is a real table in the db.  I realize I could just use the actuall table as my data source and do this simple logic there.  But what I actually want to do is create a data table in logic and use that. Or at least use the data table returned by a function in the BLL that is based on a table structure in the DB.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

There are ways to feed a report an ADO recordset from an application.  Would that idea work?

huston8481Author Commented:
I looked at the link and  was able to create a schema from the data table in the function, but How do I populate it with data that has just come out of the function?
Éric MoreauSenior .Net ConsultantCommented:
Don't you already have a dataset in your BL that you can pass to CR?
huston8481Author Commented:
Well thats the thing I do but I dont know how to pass it......
If I take the example bll function above.  In another file I have something like:
dim dt as data.datatable
dt = Feebll.GetFeeData(ID)
That writes the schema out.... but I dont know how to get the data that was returned in dt into the report..... sorry im not getting this, but I appreciate your help......
huston8481Author Commented:
I think I posted to soon.  I havent tried it yet, but do I just use this line
to put my data in?
Éric MoreauSenior .Net ConsultantCommented:
if dt is your dataset, yes this is the way to pass data to your report.
huston8481Author Commented:
Works great, Thanks for your help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.