Solved

crystal reports 8, subreports, visual basic 6

Posted on 2004-10-07
7
1,615 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

18 Experts available now in Live!

Get 1:1 Help Now