Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 18th, 2004, 10:24 PM
Registered User
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Subreport for CR9 giving empty fields in reports

I have a report containing 1 subreport :
subrep1.rpt. The subreport is linked to the
main report using 3 fields, namely fld1,
fld2 and fld3. I used ADO to bind the
records to the report during
runtime.However, only the main report is
printed correctly and the subreport only
have fld1, fld2, fld3 displayed and all the
other fields are empty. I then run
subrpt1.rpt as a main report on its own to
make sure that it is not my ADO that has
problem, and the report is correct. I have
been trying to solve this problem for a few
days without avail. Can anyone help please?
Thanks in advance.

The codes are as follow (CR9 and VB.Net):

Dim rsBor As ADODB.Recordset
rsBor = New ADODB.Recordset
Dim cmd As ADODB.Command
cmd = New ADODB.Command
cmd.let_ActiveConnection(cnn)
With cmd
.CommandText = "Select fld1, fld2,
fld3, ...from Table1"
.CommandType =
ADODB.CommandTypeEnum.adCmdText
.CommandTimeout = 15
End With

End If
rsBor = cmd.Execute



Dim rsBor1 As ADODB.Recordset
rsBor1 = New ADODB.Recordset
Dim cmd1 As ADODB.Command
cmd1 = New ADODB.Command
cmd1.let_ActiveConnection(cnn)
With cmd1
.CommandText = "Select fld1, fld2,
fld3, ...from Table1 join Table2"
.CommandType =
ADODB.CommandTypeEnum.adCmdText
.CommandTimeout = 15
End With

End If
rsBor1 = cmd1.Execute

Dim PrintOne As New CRMainReport
PrintOne.SetDataSource(rsBor)

Dim crxSubreport1 As
CrystalDecisions.CrystalReports.Engine.Repor
tDocument
crxSubreport1 = PrintOne.OpenSubreport
("subrep1.rpt")
crxSubreport1.SetDataSource(rsBor1)

PrintOne.PrintToPrinter(1, False, 0, 0)







Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Reports SubReport rln Crystal Reports 3 March 17th, 2006 11:55 AM
AJAX and Empty Fields rvanandel Javascript How-To 1 December 29th, 2005 05:16 PM
How to check for empty fields in a form. crmpicco Javascript How-To 7 February 15th, 2005 10:38 AM
Empty Fields priority05 Access ASP 3 January 10th, 2005 04:40 PM
Transferring CR9 reports from vb.NET to CR8 jeev_v Crystal Reports 0 September 8th, 2003 08:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.