CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2002
    Location
    tamilnadu, india
    Posts
    8

    how to get dynamic path in crystal reports

    hai guys,

    i doing vb.net. i am facing a problem in crystal reports. i want to set a dynamic path for the report. is it possible. if possible let me know.

    thanks allot.

    bye
    ganesh.



  2. #2
    Join Date
    Aug 2000
    Location
    NY, USA
    Posts
    632

    Re: how to get dynamic path in crystal reports

    What do you call dynamic path? Do you want to change database or you want to change ReportSource property of CrystalReportViewer?
    I'm doing this:

    Dim logonInfo as new CrystalDecisions.Shared.TableLogOnInfo()
    Dim objTable as CrystalDecisions.CrystalReports.Engine.Table
    Dim objReport as new ReportDocument()

    Application.DoEvents()
    objReport.Load(strFileName)'you assign full path with file name here

    ' set the logon information for each table.
    for Each objTable In objReport.Database.Tables
    ' get the TableLogOnInfo object.
    logonInfo = objTable.LogOnInfo
    ' set the server or ODBC data source name, database name,
    ' user ID, and password.
    logonInfo.ConnectionInfo.ServerName = "myServer"
    logonInfo.ConnectionInfo.DatabaseName = "myDB"
    logonInfo.ConnectionInfo.UserID = "myID"
    logonInfo.ConnectionInfo.Password = "myPass"
    ' Apply the connection information to the table.
    objTable.ApplyLogOnInfo(logonInfo)
    next objTable

    CrystalReportViewer1.ReportSource = objReport






    If you are using Access as DB, I think (I did not try) you can change Database property of the report object the same way.

    Have you already made any installation of your application on User machine? If yes, could you share your experience, please.

    Vlad



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

Featured