Results 1 to 9 of 9

Thread: Big Time Help Needed...

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    11

    Big Time Help Needed...

    Trying to get a vb app to spit out an XLS file using crystal reports.
    Works fine when I run it, but my user account has access to all tables and databases.

    So I 've created a new user that has same rights as I do and I need to pass these parameters to the Crystal Report.
    Below is how I am doing it and I am getting a '
    Failed to Open the connection' error.

    Any ideas as to what I can do?
    Thanks in advance.

    VB Code:
    1. Public Sub Export2XLS()
    2.  
    3. Dim sDestinationPath As String
    4. sDestinationPath = destination path
    5.  
    6. 'Open the report
    7. Set CrystalReport = CrystalApp.OpenReport(rptpath)
    8.  
    9.  
    10. With CrystalReport.Database
    11. .LogOnServer "PDSODBC.DLL", "SCOPACESQLP1", "crystal", "VBapp_2006", "PACE_VBpw1"
    12. End With
    13.  
    14. Set CrystalExportOptions = CrystalReport.ExportOptions
    15. DoEvents
    16. CrystalExportOptions.ExcelMaintainColumnAlignment = True
    17. DoEvents
    18. CrystalExportOptions.ExcelConstantColumnWidth = 500
    19. DoEvents
    20. CrystalExportOptions.FormatType = crEFTExcel80
    21. DoEvents
    22. CrystalExportOptions.ExcelPageBreaks = False
    23. DoEvents
    24. CrystalExportOptions.DestinationType = crEDTDiskFile
    25. DoEvents
    26. CrystalExportOptions.DiskFileName = sDestinationPath
    27. 'Export the report without prompting the user
    28. DoEvents
    29. CrystalReport.Export False
    30. End Sub
    Last edited by RobDog888; Jul 10th, 2006 at 11:52 AM. Reason: Added [vbcode] tags

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