Results 1 to 3 of 3

Thread: vb.net & crystal reports

  1. #1

    Thread Starter
    Addicted Member haihems's Avatar
    Join Date
    Oct 2004
    Posts
    150

    Resolved 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

  2. #2

    Thread Starter
    Addicted Member haihems's Avatar
    Join Date
    Oct 2004
    Posts
    150

    Question 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

  3. #3

    Thread Starter
    Addicted Member haihems's Avatar
    Join Date
    Oct 2004
    Posts
    150

    Smile 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:
    1. Dim CrTables As Tables
    2.         Dim CrTable As Table
    3.         Dim crReportDocument As New ReportDocument
    4.  
    5.         crReportDocument.Load("C:\cr1.rpt")
    6.         CrTables = crReportDocument.Database.Tables
    7.         For Each CrTable In CrTables
    8.             CrTable.Location = "C:\test2.xls"  
    9.         Next
    10.         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
  •  



Click Here to Expand Forum to Full Width