CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Posts
    4

    Problems while porting

    Dim StrServerPath
    Dim lIndex

    StrServerPath = "\\compaq\ash\file1.mdb"
    CrystalReport2.ReportFileName = App.Path & "testing.rpt"
    For lIndex = 0 To 16
    CrystalReport2.DataFiles(lIndex) = StrServerPath
    Next
    CrystalReport2.SelectionFormula = VAR3
    CrystalReport2.Action = 1


    this is the code i've used to print a report. when i make an installable and try to run this on an other client, it doesn't recognize the report, giving an error "report not found" error number being 20504. but the values are getting updated in the respective tables. what cud be the problem ?



  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Problems while porting

    Try this: It may work:
    change the line

    CrystalReport2.ReportFileName = App.Path & "testing.rpt"



    to

    if right$(App.path,1) = "\" then
    CrystalReport2.ReportFileName = App.Path & "testing.rpt"
    else
    CrystalReport2.ReportFileName = App.Path & "\testing.rpt"
    end if



    Some times the App.Path will not have the last back-slash. (like then current working dir is not same as app.path or something like that!)



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