Solved

Building Invoice Using CrystalReports

Posted on 2007-11-19
6
631 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
  • 3
  • 2
6 Comments
 
LVL 100

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 100

Expert Comment

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

mlmcc
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Assisted Solution

by:Ido Millet
Ido Millet earned 200 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 100

Accepted Solution

by:
mlmcc earned 300 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now