It shows that you are unregistered. Please register with us by clicking Here
![]() |
|
![]() |
![]() | Register - FAQ - Today's Posts - New Posts - Support - Search | ![]() |
![]() |
![]() |
|
LinkBack | Thread Tools | Display Modes | ![]() |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Jul 2006
Age: 28
Posts: 4
|
Hi ALL,
I have a problem with a VB script below, which is opening .rpt report ( data from MS Access DB ) and exporting it to XLS (Excel) file. It works perfectly when it runs in MFC EXE app without any prompts. If we run it in Web App where it is executed by vb engine it come to the “Report.Export False” and hangs the application. It prints “Start” and never come to “Finish”. No errors, no exceptions, no logs in System Even Viewer even if I intentionally change the output file path to some non exiting one. It means it is happened before attempting to open .xls file. Do you have an idea why it is happening? Thank you in advance for your help, Bbr Private Sub Command1_Click() On Error GoTo Login_Error Dim objApplicat As Object Set objApplication = CreateObject("CrystalRuntime.Application") Dim strPath As String strPath = "c:\\InvoiceReport.rpt" Dim objReport As Object Set objReport = objApplication.OpenReport(strPath, 1) objReport.EnableParameterPrompting = False objReport.ExportOptions.UseReportDateFormat = 1 objReport.ExportOptions.UseReportNumberFormat = 1 objReport.DisplayProgressDialog = False objReport.ExportOptions.FormatType = 21 'crEFTExcel50 objReport.ExportOptions.DiskFileName = "c:\temp\Crystal.xls" objReport.ExportOptions.DestinationType = 1 'crEDTDiskFile objReport.ExportOptions.ExcelAreaType = 4 'crDetail objReport.ExportOptions.ExcelConvertDateToString = False objReport.ExportOptions.ExcelUseWorksheetFunctions = False If False = ReportConnectExternalDatabase(objReport, "InvoiceDemo1", "", "") Then Debug.Print "err" End If Debug.Print "Start" objReport.Export False Debug.Print "Finish" Exit Sub Login_Error: Debug.Print "Description: " & Err.Description & " " & "Number: " & Err.Number & " " & "LastDllError: " & Err.LastDllError & " " & "Source: " & Err.Source End Sub Function ReportConnectExternalDatabase(ByRef objReport As Object, _ ByVal strDSN As String, _ ByVal strU As String, _ ByVal strP As String) As Boolean ReportConnectExternalDatabase = True strU = strU strP = strP If (strDSN = "") Then strDSN = "InvoiceDemo1" If (strU = "") Then strU = "User" End If If (strP = "") Then strP = "password" End If End If Dim i As Integer 'Logons Dim nTablesCount As Integer nTablesCount = objReport.Database.Tables.Count Debug.Print "objReport.Database.Tables.Count " & Str(objReport.Database.Tables.Count) For i = 1 To nTablesCount objReport.Database.Tables(i).SetLogOnInfo strDSN, strDSN, strU, strP Debug.Print "strDSN " & strDSN Debug.Print "strU " & strU Debug.Print "strP " & strP 'Test connection ReportConnectExternalDatabase = objReport.Database.Tables(i).TestConnectivity If ReportConnectExternalDatabase = False Then Exit For End If Next i End Function error to the client control center Good Afternoon Error To The Client Control Center.... Error Cli Driver Sql30061n No Se Ha Encontado El Alias De La Base O Nombre De Base De Datos En El Nodo Remoto Sqlstate=08004 Thank You Elizabeth |
|
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| One Page Report? | GuyKels | Site and Server Administration | 0 | 10-18-2006 10:40 AM |
| Inbound link report questions | justin | PPC Search Engines | 1 | 10-11-2006 05:10 AM |
| Report | chloe | ASP | 0 | 07-13-2006 05:05 PM |
| US report on kfed | erics | All Things General | 31 | 06-07-2006 04:38 PM |
| The Sports Report | seeman | Marketing | 0 | 03-28-2006 04:13 PM |