Crystal Report

G

Guest

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
 
M

Mr. Arnold

drabee said:
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.
 
M

Mr. Arnold

drabee said:
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top