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 July 10th, 2008, 01:28 PM
Registered User
Join Date: Jun 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with cystal report sub reports

My crystal report should be dispalyed like this

startdate enddate ....etc

 --------------------------------------------------------------------------- main reports -detail section

01/01/1999 01/01/2000 ... etc

           ---------------------------------------------- sub report

            // based on the above startdate and enddate you need to display some columns here...



I have written a code to get the dataset to bind the sub report .i.e., in the code behind window.. i need to fetch these startdate and enddate value in each row.. so that I can get the data set for the sub report.

The code taht i have written for the sub report binding is pated here below, please kindly let me know what I should do?

Dim crSections As Sections = oRD.ReportDefinition.Sections
Dim crReportObjects As ReportObjects

Dim crSubreportObject As SubreportObject
Dim crSubReportDoc As ReportDocument

Dim subReportCount As Integer = 0For Each crSection As Section In crSections
crReportObjects = crSection.ReportObjects

'loop through all the report objects to find all the subreports

For Each crReportObject As ReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject Then

'you will need to typecast the reportobject to a subreport

'object once you find it

subReportCount += 1

crSubreportObject = DirectCast(crReportObject, SubreportObject)
'open the subreport object

crSubReportDoc = crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)

'Once the correct subreport has been located pass it the

'appropriate dataset

crSection.ReportObjects.Item("Startdate1").ObjectF ormat.EnableSuppress = True

crSection.ReportObjects.Item("Enddate1").ObjectFor mat.EnableSuppress = True 'crSection.ReportObjects("startdate1").ObjectForma t.ToString

Dim startdate As String = "1/1/2008" '.................................................. ...here i am unable to figure it out how to fecth the mainreports field values.
oGettrainingdata.StartDate = startdate

oGettrainingdata.EndDate = "1/31/2008" 'crSection.ReportObjects("enddate1").ToString

Dim ds1 As DataSet = oGettrainingdata.ETT_GETTRAININGDATA_GetDataset(1)

End If



Similar Threads
Thread Thread Starter Forum Replies Last Post
VB 2005 and Cystal Report snufse Crystal Reports 1 December 4th, 2007 10:52 AM
connect VB6 with Cystal report9 nishab345 VB How-To 1 May 30th, 2007 11:51 PM
Printing reports/report templates ivnurse2001 VB How-To 0 April 25th, 2007 11:21 PM
Binding a DataSet to Cystal Report snufse Crystal Reports 0 March 30th, 2007 07:06 AM
Hosting for cystal reports girishhn ASP.NET 2.0 Basics 1 February 19th, 2007 02:53 AM

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