Hi, I'm using Crystal Reports XI with a connection to MS SQL Server. I've created a SQL query in the 'Add Command' section for the report to run off which seems to work fine. I've then added a couple of dynamic parameters on the report which again works fine.
The problem I encountered was because of the size of the database the report was taking way too long for the results to display.
To get around this I have added a couple of run-time date parameters from within the Database Expert's Command window, and included these inside the query (e.g. 'WHERE DateCreated BETWEEN {?prmBeginDate} AND {?prmEndDate}'). Although this has shortened the time it takes for the report to run significantly, I have encountered a new problem; the date parameters are now prompting the user twice for the values. The first time it shows the date parameters only, then once the user has entered the values it shows asks for the date parameters again only this time it shows the other parameters as well.
Can anyone tell me if I'm doing anything wrong? or if anyone knows of a way to only get asked for the date parameter once? I think it is something to do with using both dynamic and static parameters together.
Any help would be greatly appreciated!
Software/Hardware used:
Crystal Reports
ASKED:
February 19, 2010 5:16 PM
UPDATED:
November 7, 2011 5:40 PM
Does your report have a sub report? Adding references to parameter in a sub report in a certain way can cause a double prompt.
No there’s no subreport. What I’ve done is:
Create a Blank Report > Create New Connection > OLE DB(ADO)
Entered my SQL Server credentials through the Microsoft OLE DB Provider for SQL Server then clicked on Add Command and pasted in my query.
At this point I have clicked on the Create button from the Parameter List section on the right hand side and created 2 date parameters with no default value. I’ve then inserted a WHERE clause in my query and inserted the parameters.
This all works fine. But because I need to select from a username column dynamically when I have added the dynamic parameter in the design view of the report it asks for the dates twice. Can you think of anything that I’m doing wrong?
I think I’ve discovered a bug!
/
Hi,
Did you find a solution for this? I have the same problem.
Thanks.
I’m afraid not, I’ve tried quite a few different ways but still had no joy! sorry
Hi Hema2, If you do find a solution could you post back please? I’d really like to know how to get around this. Feel like I’ve been banging my head against a wall.
Thanks.