VB.NET-INFORMATIONS.COM


Home  

VB.NET Crystal Reports Tutorials

VB.NET Crystal Reports Load Dynamically

Vb.Net Help      Crystal Reports      Excel


All Crystal Reports programming samples in this tutorials is based on the following database (crystaldb) . Please take a look at the database structure before you start this tutorial - Click here to see Database Structure .

In this section we are passing User ID , Password , Server Name and Database Name dynamically to Crystal Reports from vb.net .

SITUATIONS :

In many situations this is useful , for example if you develop a database project in a test server and later you have to migrate it , in such situations you have to give these information dynamically to Crystal Reports.

In this program we are using our earlier program and pass the values dynamically to Crystal Reports. Before we start this section take a look at the step by step Crystal Report in VB.NET .

In the step by step Crystal Report we created a report selecting all data from the Product table . There is no chance to change the server on runtime in that case because it is a static report . Here we are passing Server Name , UserID and Password dynamically to the Crystal Reports.

Here we use Crystal Reports ConnectionInfo .

Dim crConnectionInfo As New ConnectionInfo , and pass these arguments to ConnectionInfo

Select the default form (Form1.vb) you created in VB.NET and drag a button and CrystalReportViewer control to your form.

Select Form's source code view and import the following :

Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.Shared

Put the following source code in the button click event

VB.NET Source Code

NOTES:

cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt")

The Crystal Report is in your project location, there you can see CrystalReport1.rpt . So give the full path name of report here.

You have to replace the source code values of "YOUR SERVER NAME" , "YOUR DATABASE NAME" , "YOUR DATABASE USERNAME" , "YOUR DATABASE PASSWORD" with your correct values .

When you run this program you will get the following screen.

vb.net_crystal_report_dynamic_database.GIF


VB.NET Crystal Reports Related Contents
Sample Database and tables for Crystal Reports tutorials
Step by Step help for creating a simple Crystal Reports in VB.NET
VB.NET Crystal Reports from multiple tables
VB.NET Crystal Reports String parameter
VB.NET Crystal Reports Integer parameter
VB.NET Crystal Reports Date parameter
VB.NET Crystal Reports Formula Fields
VB.NET Crystal Reports Summary Fields
VB.NET Crystal Reports Export to PDF
VB.NET Crystal Reports Export to Excel
Email a Crystal Reports from VB.NET
Crystal Reports Without Database
Crystal Report from SQL Query String
Dynamic Crystal Reports from SQL Query String
Crystal Reports from XML File
Create a Subreport in Crystal Reports
Create a Subreport in Crystal Reports with Link

VB.NET Related Tpoics
Microsoft .Net Framework Tutorials
VB.NET Language Basics Tutorials
VB.NET Program Flow Control Tutorials
VB.NET Collections Tutorials
VB.NET String Tutorials
VB.NET Files Tutorials
VB.NET Excel 2007 Tutorials
VB.NET Crystal Reports Tutorials
VB.NET Communications Tutorial

Search here for more Vb.Net Source Code :



    Categories

    HOME
    VB.NET

 
 
 
   













  |  Home   |  SiteMap   |  About   |
net-informations.com (C) 2008 All Rights Reserved