Results 1 to 4 of 4

Thread: Crystal 8 [Changing Report Location]

  1. #1

    Thread Starter
    Addicted Member Rohan_Powle's Avatar
    Join Date
    Mar 2000
    Location
    Mumbai,maharashtra.India
    Posts
    173

    Crystal 8 [Changing Report Location]

    Hello There,
    I have used OLEDB Provider for connecting to MS-Access XP Data Source while making Reports for my Application.

    If the client installs Application on another Location than specified while making the report, App throws error "Server cannot be found", I am using RDC & Report Viewer to view reports from VB6.

    How do I dynamically change the Report location using RDC Code.
    If u can give me some sample code I will be really grateful.

    Help will be appreciated
    "Trouble Gives Experience & Experience Gives Wisdom."
    (accept troubles as they come to become more wise in life)
    - Regards Rohan

  2. #2

    Thread Starter
    Addicted Member Rohan_Powle's Avatar
    Join Date
    Mar 2000
    Location
    Mumbai,maharashtra.India
    Posts
    173

    Angry Pls Help

    Is there anyone who can help ... client is unhappy as he says why do I install Application in a particular Drive only. I hv asked him to wait for a while to solve the problem.
    Last edited by Rohan_Powle; Mar 16th, 2004 at 05:19 AM.
    "Trouble Gives Experience & Experience Gives Wisdom."
    (accept troubles as they come to become more wise in life)
    - Regards Rohan

  3. #3

    Thread Starter
    Addicted Member Rohan_Powle's Avatar
    Join Date
    Mar 2000
    Location
    Mumbai,maharashtra.India
    Posts
    173

    Pls Help

    This is the Code I am trying to change the Location but it is not doing the needful

    VB Code:
    1. Dim crxDatabaseTable As CRAXDRT.DatabaseTable
    2. 'Set instances
    3. Set puReport = crxApp.OpenReport(sReportPathName, 1)
    4. 'Change Database Location
    5.  
    6. Dim sdbPath As String
    7. sdbPath = App.PATH & "\_Data\DailyAcc.mdb"
    8.  
    9. For Each crxDatabaseTable In puReport.Database.Tables
    10.      crxDatabaseTable.SetTableLocation sdbPath, crxDatabaseTable.Name, ""
    11.      MsgBox crxDatabaseTable.TestConnectivity
    12. Next crxDatabaseTable
    13.  
    14. 'TRIED THIS TOO BUT DID NOT WORK
    15.  
    16. 'For lCtr = 1 To puReport.Database.Tables.Count
    17. '    puReport.Database.Tables(lCtr).SetTableLocation sdbPath, puReport.Database.Tables(lCtr).Name, ""
    18. '    MsgBox puReport.Database.Tables(lCtr).TestConnectivity
    19. 'Next


    is there no one who can handle this problem?
    "Trouble Gives Experience & Experience Gives Wisdom."
    (accept troubles as they come to become more wise in life)
    - Regards Rohan

  4. #4
    Hyperactive Member D12Bit's Avatar
    Join Date
    Oct 2000
    Location
    Guatemala
    Posts
    373
    You need to set the access to the data in your Report to Active Data in order for you to set a different source for your report...

    then ...(I recommend the use of ADO) you create a recordset exactly as you have it set in the report ... so the report can find the fields exactly as you used it when designing it...

    after that you just need to se in the for that opens the report the following:
    VB Code:
    1. 'just showing the part that really matters...
    2.     Report.Database.SetDataSource rsADO 'this is where you assign the recordset
    3.     'contining the data that you want to print ...
    4.     'obtained from wherever you like
    5.     Report.DiscardSavedData
    6.  
    7.     CRViewer1.ReportSource = Report
    "Who Dares Wins" - "Quien se Arriesga Gana"
    Mail me at:

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