Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

crystal reports 8, subreports, visual basic 6

Posted on 2004-10-07
7
Medium Priority
?
1,794 Views
Last Modified: 2012-06-27
Hello,

I have a Visual Basic 6 application calling a crystal report version 8 with a subreport. When attempting to invoke the crystal report it errors with "can not open SQL server - 20599." I have other crystal reports without subreports that work fine in the same application. The code is as follows:

Private Sub cmdSummary_Click()
Dim ODBC_String As String

On Error GoTo ErrorHandler
ODBC_String = "DSN=btireports.dsn;DSQ=" & pubstrDatabase & ";UID=bti;PWD=zoe"

crpReports.Connect = ODBC_String

If Me.cboDepartment <> "All" Then
    crpReports.StoredProcParam(0) = Mid(Me.cboDepartment, 1, 7)
Else
    crpReports.StoredProcParam(0) = Me.cboDepartment
End If
crpReports.ReportFileName = pubstrReportLocation & "ConsolidatedDeptDivLevelQuarterly.rpt"
crpReports.Action = 1

GoTo ExitSub

ErrorHandler:
    MsgBox "Printing Summary Report:  " & Err.Description & " Error # " & Err.Number
ExitSub:

End Sub

Any help on why subreports do not work correctly in this context would be greatly appreciated.

Thanks,

Joe
0
Comment
Question by:jcmyers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 10

Accepted Solution

by:
ebolek earned 500 total points
ID: 12253645
You are not setting login info and parameter of the subreports . Check these dicuments out. Thye will solve your problem

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr8_vb_rdc_parameter.exe.asp 
http://support.businessobjects.com/library/kbase/articles/c2003098.asp 

Regards
Emre
0
 
LVL 13

Assisted Solution

by:vidru
vidru earned 500 total points
ID: 12254070
Looks like you're using the OCX, eh?

Try adding this before "crpReports.Action = 1":

crpReports.SubreportToChange("YourSubreportName")
crpReports.Connect = ODBC_String
crpReports.SubreportToChange("")

If you don't have the Help files for the OCX, you can get them here:
http://support.businessobjects.com/communityCS/FilesAndUpdates/SCR_OCX_Help.exe.asp?recDnlReq=Record&dnlPath=SCR_OCX_Help.exe

-dave
0
 
LVL 13

Expert Comment

by:vidru
ID: 12454819
Suggest points to vidru.

-dave
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12462760
Comment from ebolek
Date: 10/07/2004 02:07PM PDT
 explains how to make the runtime customizations that the user asked in vb6 there fore suggest points to ebolek

Thanks
Emre
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question