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

before report triggers in crystal

Post Author: vdm

CA Forum: Data Connectivity and SQL

Hi,

I need to develop a report the data for which cannot be easily selected from tables using a sql statement. It needs to first call a stored procedure which would populate some temp tables and crystal would then report from these temp tables.I am from Oracle reports background which has a before report trigger in which you could put any of this pre-processing but not sure if crystal (CR XI) has the equivalent of that.what I did try with crystal was this :- 1. On my main report I have this query - select * from temp......2.I have put a sub-report in my Report Header section. This sub-report calls a sql server stored procedure which populates the temp table.But what I am finding is that before the sub-report is called crystal has already executed the select statement -which is still empty at this stage.Question:1.What I am trying to do is just not possible to do in crystal ?2. Or is there a way that I can stop crystal from executing the main select statement until the sub-report has been called ?thanks in advanceVishal

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 01:36 PM

    Post Author: bettername

    CA Forum: Data Connectivity and SQL

    Why not just use a single Command object as your datasource, and have it contain the following sql:

    exec sp_your_stored_procedure

    --that should have generated your temp_table

    select * from your_temp_table

    drop table your_temp_table --or not, depending on your preference... 😊

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 05:37 AM

    Post Author: yangster

    CA Forum: Data Connectivity and SQL

    really depends what you are doing or achieving with the temp table in the subreportand the very nature of the subreport within a main report means the main report datasource will always come before the subreportreverse the order of your reports if you want to execute the procedure firstor better yet tell us what you are trying to do and we'll be able to tell you if you even need a subreport

    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.