cancel
Showing results for 
Search instead for 
Did you mean: 

Sub reports not showing data in Vusual Basic 6

Former Member
0 Kudos

I have created a report in CR XI and added it to my Visual Basic 6 application. The report in CR and VB work correctly.

Recently, however, I added 3 sub reports to the existing report. When I run it in the CR development environment, it shows all four reports (main and 3 sub reports) correctly, but when I add it to my VB 6 applicaiton and run it, only the main report shows the data and the 3 sub reports are blank - only lines, boxes, text fields show.

The main report is just an invoice for one customer. The 3 sub reports are exact copies of the main report but with a different page identifiers printed at the bottom. (main report = "Invoice", sub report 1 = "Accounting", sub report 2 = "File", sub report 3 = "Packing List").

There is only one parameter being passed which is the Customer Key field and all four reports link to that key.

Thank you for any help.

Also, I purchased the Crystal Single Case several hours ago and sent in the required email to activate the case. Now several hours have passed by and I have still not been contacted. I called Customer Service and they said to just wait and I would be contacted. Any idea how long the wait is?

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

What database you are using?

What is the database connection type (OLE DB, ODBC, etc) for both the main and the subreports (please check this carefully)?

What is the exact version of Crystal Reports you are using?

What Crystal reports Service Pack are you on?

What is the database logon code you are using?

Ludek

Former Member
0 Kudos

MS SQL Server 2000

ODBC (RDO)

Same for the 3 sub reports

Using CR XI Product Version 11.0.0.1282

Using CR XI Release 2

The database logon code is part of the DSN I created

I have used these methods for many reports with no changes and no problems - until I used my first sub report. So if it worked before and still works in the CR Development environment, I don't see why it would not work in VB6. Very confusing. Thank you for the help.

Also, am I suppose to just wait until SAP gets back to me on my purchase and activation of the Crystal Single Case?

former_member183750
Active Contributor
0 Kudos

- Re. Crystal Single Case. I have no help for you there. I simply don't know, nor do i have any way of finding out for you. Calling customer service may be an option (1-800-677-7271).

Using CR XI Product Version 11.0.0.1282

Using CR XI Release 2

- The two above do not make sense. CR XI is 11.0.x, CR XI release 2 is 11.5.x. The latest SP for CR XI release 1 (11.0.x) can be downloaded from here:

https://smpdl.sap-ag.de/~sapidp/012002523100006008952008E/crXIwin_sp4.zip

If you are using CR XI release 1, please download the latest SP, see if that helps.

The database logon code is part of the DSN I created

- Please provide more detail on the above

A test to try; Save out one of the subreports and see if it will run from a VB app on it's own...

Ludek

Former Member
0 Kudos

I am using Crystal Reports XI, not Release 2. Sorry about that mix-up.

I downloaded the latest sp (4) per your url and installed it. Now the product version is 11.0.0.2495

SP4 did not solve the problem.

Here is my reference to the DSN in the VB code: cnSQL.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=DSN-SQL"

(This DSN and VB code have worked for years. Nothing is different now other than the fact that I am now using a Subreport for the first time.) When I created the DSN two years ago, I used the "SQL Server" driver found in the XP Administrative Tools (ODBC) section, and it has worked fine since then.

I saved out one of the sub reports and it did not run initially from the VB app, but after I removed the "Change Subreport Links" to not have any links, it ran correctly in the VB app. Then I went back to the full report (main and 3 subreports) and removed all links in the subreports. Then I re-added the full report back into the VB app and still no data shows on the 3 subreports. Data only shows on the main report. I have experimented with both using and not using Subreport Links in the report and nothing I do seems to make any difference.

In the VB code, I pass two parameters to the report. The first is the customer key that is used in the main report and three subreports to print the customer's invoice. The second parm is a flag to print or not print special instructions on the invoice.

I suspect the problem with not printing data on the subreports is somehow due to the subreports not connecting to the SQL database or possibly not receiving the two parms which would cause them to not select a SQL record from the Invoice table. But here I am just guessing.

Thank you for your continued help

Edited by: Eric Young on Oct 7, 2008 2:28 AM

Edited by: Eric Young on Oct 7, 2008 2:28 AM

Former Member
0 Kudos

I paid SAP/Business Object/Crystal Reports for a Crystal Single Case. They solved the problem as follows.

The problem is that when passing parms to the main and subreports, the subreports must have their parms linked to the passed parms. This is accomplished as follows:

Right click on the subreport.

Left click on the Change Subreport Links.

Select each parm in the Report Fields section in the top, left window and move it to the right, top window.

For each passed parm in the subreports, click on the subreport parm in the bottom, left window.

Save the report and that fixed the problem.

Pretty simple. In short, passed parms to a subreport need to be linked.

Answers (0)