cancel
Showing results for 
Search instead for 
Did you mean: 

selection formula using data from sub-report to compare to

Former Member
0 Kudos

Basically this is what I am trying to accomplish if it was just a straight query:

SELECT ar.acc_itn, ar.document_itn,

dx.document_itn, dx.read_dtime, dx.reading_dr, dx.pat_itn,

va.acc_itn, va.pat_itn, va.dept+va.proc_no,

vtas.acc_itn, vtas.stp_cd, vtas.stp_dtime

from activity_result ar, document_xref dx, visit_activity va, visit_trk_act_steps vtas

where ar.document_itn = dx.document_itn and

ar.acc_itn = va.acc_itn and

ar.acc_itn = vtas.acc_itn and

vtas.stp_cd = 8 and

vtas.acc_itn not in

*(select acc_itn from visit_trk_act_steps where stp_cd = 6 or stp_cd = 5 or stp_cd = 1)*

The code inside the ** I have in a subreport. I want to make the statement ' vtas.acc_itn not in' use the data returned by the subreport to compare to.

Can this be done? If so, does anyone have a coding sample to do this?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I think it is better to create a view or stored procedure in the database and create a report using a view or SP from database.

Regards,

Raghavendra

Former Member
0 Kudos

I am using Crystal XI and both the main report and the subreport are using the same data source and I am not using views. How do I put my sub-report into a command. I have only been using Crystal for about 7 months.

Former Member
0 Kudos

Hi Pamela

Please let us know the following information:

1) Exact version of Crystal Reports Designer.

2) Is main report and subreport using the same Data Source?

3) Are you using Views to create the report?

If both main report and subreport use the same Data Source then you can use the SQL generated in the Subreport in Main report's SQL by creating a command object.

If you want the main report to dynamically point to the subreport then it is not possible from Crystal Report Designer.

Hope this helps.

Thanks!

Former Member
0 Kudos

I am using Crystal XI and both the main report and the subreport are using the same data source and I am not using views. How do I put my sub-report into a command. I have only been using Crystal for about 7 months.