Solved

crystal reports 8, subreports, visual basic 6

Posted on 2004-10-07
7
1,638 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
  • 2
  • 2
7 Comments
 
LVL 10

Accepted Solution

by:
ebolek earned 125 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 125 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

861 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now