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
huston8481Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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..?

MIkeV
0
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

mlmccCommented:
There are ways to feed a report an ADO recordset from an application.  Would that idea work?
http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx

mlmcc
0
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?
0
Éric MoreauSenior .Net ConsultantCommented:
Don't you already have a dataset in your BL that you can pass to CR?
0
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)
dt.WriteXmlSchema("c:\Temp\DemoSchema.xsd")
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......
0
huston8481Author Commented:
I think I posted to soon.  I havent tried it yet, but do I just use this line
mrptDoc.SetDataSource(dt)
to put my data in?
0
Éric MoreauSenior .Net ConsultantCommented:
if dt is your dataset, yes this is the way to pass data to your report.
0
huston8481Author Commented:
Works great, Thanks for your help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.