|
-
Mar 6th, 2005, 11:09 PM
#1
Thread Starter
Addicted Member
vb.net & crystal reports
hi,
i'm doing vb.net with crystal reports. i want to connect the report to differnet databases, that is during the runtime using the coding i want to change the database name according to the user's selection of database.
how can i do that? any idea?
Last edited by haihems; Mar 9th, 2005 at 12:35 AM.
Think Before Ink
Visual Studio .NET 2002/.NET Framework 1.0
-
Mar 8th, 2005, 01:46 AM
#2
Thread Starter
Addicted Member
Re: vb.net & crystal reports
Hi,
I've created the Crystal report by connecting a data base(Excel file) and able to view this from Crviewer(vb.net). But i want to change the data base names from vb.net. Is there any way to change the data base name?
Regards,
Hems.
Think Before Ink
Visual Studio .NET 2002/.NET Framework 1.0
-
Mar 9th, 2005, 12:33 AM
#3
Thread Starter
Addicted Member
Re: vb.net & crystal reports
Hi all,
I got the solution for my problem. But i dont know whether it is the correct way or not? Anyway it is working now. I used the follwing coding to change the database name dynamically.
VB Code:
Dim CrTables As Tables
Dim CrTable As Table
Dim crReportDocument As New ReportDocument
crReportDocument.Load("C:\cr1.rpt")
CrTables = crReportDocument.Database.Tables
For Each CrTable In CrTables
CrTable.Location = "C:\test2.xls"
Next
CrystalReportViewer1.ReportSource = crReportDocument
While creating the report I used test1.xls as my database, now from vb.net i changed it to text2.xls
If anything wrong on this, Please advice me..thanks
Regards,
Hems.
Think Before Ink
Visual Studio .NET 2002/.NET Framework 1.0
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|