Building Invoice Using CrystalReports

Posted on 2007-11-19
Medium Priority
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!
Question by:anoyes
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
LVL 101

Expert Comment

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 ?

LVL 16

Author Comment

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.
LVL 101

Expert Comment

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


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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
LVL 16

Author Comment

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?
LVL 101

Accepted Solution

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


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month10 days, 17 hours left to enroll

770 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