Using Variables Within Crystal Report Formulas
page 3 of 6
by Vince Varallo
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 87113/ 92

Step 2: Create the Web Site, Add a Report, and Connect to the Database

1.    Launch Visual Studio 2008 and select FileàNew Web Site… from the menu.

2.    Select the ASP.NET Web Site template.  Set the Location to File System and set the path to c:\Documents and Settings\YOURNAME\My Documents\Visual Studio 2008\Projects\CrystalFormulas.  Set the Language to C# and then click the OK button.  This will create the web site with the Default.aspx page and the web.config file.

3.    Right click on the project in the Solution Explorer and select Add New Item… from the pop-up menu.

4.    Select the Crystal Reports template and change the name of the file to QuarterlySales.rpt.  Click the Add button.

5.    The Crystal Reports Gallery dialog will appear.  Select the "As a Blank Report" option and click the OK button.  This will add the Crystal Report file to your project and open up the Crystal Reports designer.

6.    Now you need to connect to the database.  Right click on the Database Fields node in the Field Explorer and select Database Expert… from the pop-up menu.

7.    The Database Expert dialog will appear.  Click the plus sign next to Create New Connection.  Click the plus sign next to OLE DB (ADO).  The OLE DB (ADO) dialog box should appear.

8.    Select SQL Native Client from the list of providers and click the Next button.

9.    Enter your server name.  You then have the option to either use a SQL Login account to connect to the database of use integrated security.  For this example I'll use Integrated Security by checking the Integrated Security checkbox.

10. Enter the name of the database that was created in step 1, CrystalFormulas.  Click the Finish button.

11. You should see the database listed under the OLE DB (ADO) node.  Click the plus sign next to the database to view the schemas.  Click the plus sign next to dbo to view the tables.

12. Click on the SalesHeader table and then click the > button to move this table to the list of selected tables for this report.

13. Click the OK button.

View Entire Article

User Comments

Title: Very goo   
Name: Shivayogi
Date: 2011-09-08 11:26:19 PM
This code is helped me a lot
Title: Formula fields in Crystal Reports   
Name: Esha
Date: 2010-07-01 3:11:46 AM
Very Good and useful example
Title: Surge Consulting Group   
Name: Surge Consulting Group
Date: 2010-05-07 4:14:41 PM
Very very cool! Thanks for the example!
Title: Using Variables Within Crystal Report Formulas   
Name: pavani
Date: 2010-04-28 3:22:02 AM
simple and easy to understand article.When i tried to add crystal report template in my vs2008 i could not find it so do i need to restall my vs 2008 ?

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2023  |  Page Processed at 2023-12-06 2:02:17 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search