Skip to Content
author's profile photo Former Member
Former Member

selection formula using data from sub-report to compare to

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 08, 2008 at 12:45 AM

    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!

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 10, 2008 at 01:55 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 10, 2008 at 05:21 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.