Click to See Complete Forum and Search --> : display one record
remcoploeg
August 22nd, 2001, 02:59 AM
Can somebody tell me how I can show one record in Crystal Reports from vb6. I Go from form1 to a crystal report and there I want to show one record that I selected in form1. How can I give the variable through? So form1 gives the value 1 through to chrystal reports and chrystal reports display record nr. 1. Where do I put the variable, only in vb6 or also in Crystal Reports? And where?
Remco Ploeg
ploegr@promar-agencies.nl
vivek_29
August 22nd, 2001, 04:13 AM
First in crystal report create a report
then there is a method of crstalreport ocx named 'replaceselectionformula'.
you will have to use this method to filter the data that the crystalreport is supposed to show
suppose u have a table named 'TABLE1'
and u have columns named ID,NAME,AGE,SEX
Now in vb u will write:
Report1.replaceselectionformula("TABLE1.ID = somevalue")
Report1.action = 1
This will ensure that the crystalreport shows the record for onle the id that u have supplied.
Hope it helps
remcoploeg
August 22nd, 2001, 04:41 AM
what do you mean with replaceselectionformula. Where can i find that in crystral report?
Remco Ploeg
ploegr@promar-agencies.nl
remcoploeg
August 22nd, 2001, 04:55 AM
So I have form1 there I have got a ID from a customer, now I want to print that customer. So I made a crystal report with a sql query but there is ID = 5. Now When I push the button to start making the report, i want to overrule that sqlstatement in crystal report, with a sql statement that is in the code of the action button. Can I do that? So then I see 1 customer on my screen and not ID5. But the ID where I'am standing on. I made already a variable for that. But how can I make the select statement with the variable in crystal reports?
Remco Ploeg
ploegr@promar-agencies.nl
vivek_29
August 22nd, 2001, 05:13 AM
'replaceselectionformula' is a method of CRYSTAL REPORT CONTROL which is available as an activex control to be used in vb.
You won't find that method on Crystal Report
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.