Click here to Skip to main content
11,928,569 members (48,762 online)
Rate this:
Please Sign up or sign in to vote.

i need help on this

i'm trying to use a select query to assign records to both a main report and a subreport with two unlinked tables

this is my code

comm.Connection = conn
comm.CommandText = "Select * from ReceievedStock where month(DateReceived) = '" & dd1 & "' and Year(DateReceived) = '" & dd2 & "'"
da.SelectCommand = comm
da.Fill(das, "ReceievedStock")

comm1.Connection = conn
comm1.CommandText = "Select * from IssuedStock where month(DateIssued) = '" & dd1 & "' and Year(DateIssued) = '" & dd2 & "'"
da.SelectCommand = comm1
da.Fill(das, "IssuedStock")

But when i display the report, the record comes in double(each set of record get duplicated)

Need help on this.. Thank you
Posted 15-Aug-12 23:45pm
Adersh Ram 16-Aug-12 9:20am
How did u set the report data source ?
kwamebounty 17-Aug-12 5:17am
I set the report datasource this way

CrystalReportViewer1.ReportSource = rpt

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi kwamebounty,

1. First u set the Main report and sub report link(right click the sub reoport and
select Sub Report link , link the master report id and sub report id)
2. Set the report data source

Let me know if it is not worked.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151126.1 | Last Updated 18 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100