Link to home
Start Free TrialLog in
Avatar of anoyes
anoyesFlag for United States of America

asked on

Building Invoice Using CrystalReports

I've never worked with CrystalReports (2005) before, but I've done quite a bit of work with ASP/ASP.Net.  Here's my situation.  I've got an application almost completely developed using a 3-tier structure (interface, business layer, data layer).  I need to now integrate CrystalReports for the purpose of printing an invoice.  Basically, when the user views an invoice on the screen two functions are invoked from my BLL - GetInvoiceDetails and GetLineItems.  The first one gets details such as who the customer is, the job it's for, the date, etc.  GetLineItems, interestingly enough, gets all the line items for the invoice.  Both take a parameter for the invoice ID from the query string.  What I can't for the life of me figure out however is how to build a report using these two functions as the data sources.  To provide a little more info, GetInvoiceDetails returns a custom 'Invoice' object, and GetLineItems returns a DataTable.  I would love it if someone can give me some insight into how to do this, preferably with references and/or code samples.  Thanks in advance!
Avatar of Mike McCracken
Mike McCracken

Crystal wants either a dataset (the result of your functions) or to link directly to teh database.  I don't believe that it can use your functions.

Can you connect Crystal to the database ?

mlmcc
Avatar of anoyes

ASKER

Sorry it's taken me so long to respond - haven't had time to get back to this.  Can I dynamically build a dataset from the data from those two functions and bind the report to that?  I'd prefer not to bind the report directly to the database if at all possible.  Thanks.
You should be able to.  Idon't know how to do it.

mlmcc
SOLUTION
Avatar of Ido Millet
Ido Millet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anoyes

ASKER

Again, sorry for the delay.  I'd really prefer to not directly connect to the database if I can avoid it. mlmcc has indicated that it's possible to bind to a dataset that I've dynamically built - does anyone know how to build the dataset and bind to it?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial