display record by retrieving parameter value in module

ssfftt

Well-known member
Joined
Oct 27, 2005
Messages
163
Programming Experience
1-3
in my report, i have user name, test name, start time, end time, full marks and grade. when user click on "report this test" after finishing a certain test, i want the report displays this record which contains current user, test and result details. my sql query is:

SELECT CYMUSER.UNAME, TEST.TNAME, RESULT.STARTTIME, RESULT.ENDTIME, RESULT.TOTALMARKS, RESULT.GRADE
FROM CYMUSER INNER JOIN
TEST ON CYMUSER.UID = TEST.UID INNER JOIN
RESULT ON CYMUSER.UID = RESULT.UID AND TEST.TID = RESULT.TID
WHERE (RESULT.RID = @RID)


the @RID parameter is held in my moduleUser.curRID.
How can i pass the @RID value to report and let it display the only one record that i want?
 
Last edited:
I created a sqldataadapter and a dataset, set the select command as the query mentioned above, and get the dataset from CrystalReportCurResult.rpt

it seems working. However, when i open the form that contains the report viewer at run time, it asks for server and database name, user name and password for the database. In fact my database is local and no username and password at all.

can anyone help with the problem plz? being waiting for reply for past 5 hrs.
 
if i get the field data from the database straight way, it wont ask for anything, but will display all the data in the requried column. If i get field data from Project Data ---> ADO.NET Datasets, no matter which dataset i use, it asks for database login details (i.e. server, db, name and pw) at runtime. annoying, help plz!
 
Hi...
I dont know whether this method will help you or not. I had the same problem earlier. What you need to do is to create a report using the crystal report wizard. If you need to show the data from more than 1 table you need to add 2 tables and verify the links between the tables. Once you finish creating the crystal report, you go back to your form. Add a crystal report viewer to your form. Then go to your "report document" located at componet look at your tool box. You add that to your form, choose the name of crystal report you just create. What you need to do next, click at your report viewer, go to the properties, report source should be the name of your crystal report. Then it should work fine. I hope :)
 
i worked it out similar to your suggestion: reportviewer.ReportSource.myreport1

cheers, thx for help, jazz
 
Back
Top