Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Building Invoice Using CrystalReports

Posted on 2007-11-19
6
Medium Priority
?
667 Views
Last Modified: 2008-02-01
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!
0
Comment
Question by:anoyes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 20317773
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
0
 
LVL 16

Author Comment

by:anoyes
ID: 20344879
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.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 20346415
You should be able to.  Idon't know how to do it.

mlmcc
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Assisted Solution

by:Ido Millet
Ido Millet earned 600 total points
ID: 20391348
Just create two stored procedures that accept the Invoice ID as a parameter.  Then, create the invoice as a main report (customer info) and a linked subreport (detail).

You can even denormalize the whole thing into a single stored procedure (repeating the customer info for each detail line.  That woulkd allow you to do this in a main report without a subreport.

- Ido
0
 
LVL 16

Author Comment

by:anoyes
ID: 20469324
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?
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 900 total points
ID: 20472654
I don't know how to do it in ASP.  Creating the dataset is specific to your database.

Here is code to pass a dataset to Crystal.  It is not in ASP
http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx

mlmcc
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question