Skip to Content
Former Member
Nov 21, 2008 at 08:06 AM

Running Queries for Dynamic Prompts


I have a crystal report in which in the paramter screen there are two parameters coming from dynamic prompts.There are also a few other static parameters.Thus we have two command objects (Let us refer these two as Command 1 and Command 2) for these two dynamic prompts We have another command object (let us refer this as Command 3) which actually queries the database to retrieve the report data. However when we run the report from the crystal client in the preview mode All three queries get executed before showing the paramter screen . Hence it takes a long time for the parameter screen to come up.In order for the parameter screen to show we only need Command 1 and Command 2 (as mentioned above) to execute. Command 3 should only get executed after we select the parameters . The result set of command 3 is also depend on one of the static parameters. However on previewing the report all three get executed before the parameter screen comes up.(I have used a trace for determining this) .Of the three command 3 gets executed with default value of the concerned static parameter as the selection criteria.If we don't supply a default value to the static parameter command 3 gets executed with the default value for the datatype of the static parameter, for eg if the static parameter is int command 3 gets executed with the value of the static parameter as 0.

Thus essentially Command 3 executes twice, once before the parameter screen appears and once after we select all the paramters and click ok.Since command 3 executes before the parameter screen comes up, it drastically increases the time for the parameter screen to come up.

Is there any way to stop Command 3 to run before selecting the prompt values.