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.

DO it the same way as u do it for the single one


but select two tables and both of the tables shud have a comon thing


like porduct table has pdate
and scheme table has sdate


so when u select both of these u can see a relation ship shown between the two tables . now u can compare and generate a report

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.