By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,625 Members | 1,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,625 IT Pros & Developers. It's quick & easy.

Crystal Report

P: n/a
Greetings:
Please
This is the first time i'm using crystal report i'm passing Parameters like
code belowe but what i'm getting alwayes just the last record
pleeeeeeeeeeeeeeeease any help

Dim report As New ReportDocument
Dim I As Int16
mycon.ConnectionString = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA
SOURCE=" & Server.MapPath("App_Data/TRN.mdb") & ""
mycon.Open()

'Dim sql As String = "SELECT Users.CPR,Users.Name,
courses.CourseTitel, courses.SDate, courses.Edate, Registration.SupApp,
Registration.Status FROM Users INNER JOIN (courses INNER JOIN Registration ON
courses.Code = Registration.Code) ON Users.CPR = Registration.CPR WHERE
Users.CPR='711220956'"

Dim sql As String = "SELECT Users.CPR, Users.Name,
Users.Directorate, courses.CourseTitel, courses.SDate, courses.Edate,
courses.location, courses.fees, Registration.SupApp, Registration.Status FROM
Users INNER JOIN (courses INNER JOIN Registration ON courses.Code =
Registration.Code) ON Users.CPR = Registration.CPR"
sql = sql & " WHERE Registration.SupApp='APP' AND
Registration.Status='APP' AND Users.CPR='711220956'"


da = New OleDbDataAdapter(sql, mycon)
da.Fill(ds)
report.Load(Server.MapPath("emrpt.rpt"))

report.SetDataSource(ds)

CRV.ReportSource = report
CRV.DataBind()

For I = 0 To ds.Tables(0).Rows.Count - 1
report.SetParameterValue("CPR", ds.Tables(0).Rows(I)(0).ToString)
report.SetParameterValue("test", ds.Tables(0).Rows(I)(1).ToString)
report.SetParameterValue("dir", ds.Tables(0).Rows(I)(2).ToString)
report.SetParameterValue("CourseName",
ds.Tables(0).Rows(I)(3).ToString)
report.SetParameterValue(2, CType(ds.Tables(0).Rows(I)(4),
Date).ToShortDateString)
report.SetParameterValue(3, CType(ds.Tables(0).Rows(I)(5),
Date).ToShortDateString)
report.SetParameterValue("loc", ds.Tables(0).Rows(I)(6).ToString)
report.SetParameterValue("fee", ds.Tables(0).Rows(I)(7).ToString)
report.SetParameterValue("SupAPP",
ds.Tables(0).Rows(I)(8).ToString)
report.SetParameterValue("AdAPP",
ds.Tables(0).Rows(I)(9).ToString)

Next
May 26 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"drabee" <dr****@discussions.microsoft.comwrote in message
news:3C**********************************@microsof t.com...
Greetings:
Please
This is the first time i'm using crystal report i'm passing Parameters
like
code belowe but what i'm getting alwayes just the last record
pleeeeeeeeeeeeeeeease any help
>
'Dim sql As String = "SELECT Users.CPR,Users.Name,
courses.CourseTitel, courses.SDate, courses.Edate, Registration.SupApp,
Registration.Status FROM Users INNER JOIN (courses INNER JOIN Registration
ON
courses.Code = Registration.Code) ON Users.CPR = Registration.CPR WHERE
Users.CPR='711220956'"

Dim sql As String = "SELECT Users.CPR, Users.Name,
Users.Directorate, courses.CourseTitel, courses.SDate, courses.Edate,
courses.location, courses.fees, Registration.SupApp, Registration.Status
FROM
Users INNER JOIN (courses INNER JOIN Registration ON courses.Code =
Registration.Code) ON Users.CPR = Registration.CPR"
sql = sql & " WHERE Registration.SupApp='APP' AND
Registration.Status='APP' AND Users.CPR='711220956'"
Well, you need to verify that your Select statements are pulling back the
data you want.

There should be a way in Access to take those Selects and run them gainst
the database to see if they work before moving on to Crystal.
May 26 '07 #2

P: n/a

Thank you for your replay actually i did it is OK giving me 4 records
"Mr. Arnold" wrote:
>
"drabee" <dr****@discussions.microsoft.comwrote in message
news:3C**********************************@microsof t.com...
Greetings:
Please
This is the first time i'm using crystal report i'm passing Parameters
like
code belowe but what i'm getting alwayes just the last record
pleeeeeeeeeeeeeeeease any help

'Dim sql As String = "SELECT Users.CPR,Users.Name,
courses.CourseTitel, courses.SDate, courses.Edate, Registration.SupApp,
Registration.Status FROM Users INNER JOIN (courses INNER JOIN Registration
ON
courses.Code = Registration.Code) ON Users.CPR = Registration.CPR WHERE
Users.CPR='711220956'"

Dim sql As String = "SELECT Users.CPR, Users.Name,
Users.Directorate, courses.CourseTitel, courses.SDate, courses.Edate,
courses.location, courses.fees, Registration.SupApp, Registration.Status
FROM
Users INNER JOIN (courses INNER JOIN Registration ON courses.Code =
Registration.Code) ON Users.CPR = Registration.CPR"
sql = sql & " WHERE Registration.SupApp='APP' AND
Registration.Status='APP' AND Users.CPR='711220956'"

Well, you need to verify that your Select statements are pulling back the
data you want.

There should be a way in Access to take those Selects and run them gainst
the database to see if they work before moving on to Crystal.
May 26 '07 #3

P: n/a

"drabee" <dr****@discussions.microsoft.comwrote in message
news:AB**********************************@microsof t.com...
>
Thank you for your replay actually i did it is OK giving me 4 records
So, how many records are in ds.Tables(0).Rows.Count, when you use the
Immediate Pane in Dubug mode?

May 26 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.