I want to incorporate fields from 2 tables in a single crystal report.
I have no problems in incorporating from a single table. But when it comes to >1 table fields in a single report, I am stuck up..
For eg.:
Table 1 :"GENINFO"
----------------------
custno | mail id
-----------------------
Table 2 :"DETAILS"
--------------------------
custno | Listofcompaniesowned
-------------------------------
Now, I would like to write the RECORDSELECTIONFORMULA as part of the code,without using the editor.
I intend the user to choose the customer he wants to see, based on a common customer number that he will provide.
Report.DataDefinition.RecordSelectionFormula = "{GENINFO.custno}=" & i
Report.DataDefinition.RecordSelectionFormula = "{DETAILS.custno}=" & i
This doesnot work...
The first problem is how to couple these both...I used "And". ...doesn't work..
The second problem is that I want only custno field from GENINFO table to be part of my report.
--------------------------------------------------
CrysReport1.rpt
--------------------------------------------------
custno | GENINFO.CUSTNO
mailid | DETAILS.MAILID
listofcompniesowned | DETAILS.LISTOFCOMPNIESOWNED
--------------------------------------------------
--------------------------------------------------
The custno field of DETAILS table is just meant for selecting the other fields in the table such as "listofcompniesowned" etc...
I noted that this field doesnot appear in the formula editor too...since it is not included in the report...(though I don't use the editor as I told before)
Hence, the record selection formula,viz.
Report.DataDefinition.RecordSelectionFormula = "{DETAILS.custno}=" & i
(after modification will it work ?)
In short,
What is the RecordselectionFormula like for incorporating fields from 2 tables ??
Thanks for the time.