Crystal Report Parameter - how to stop parameter appearing twice - sql

I currently have a report which feeds off a stored procedure with the parameters being two date fields i.e. dateto and datefrom.
Now within crystal report and not sql I have created another parameter which asks for the option to select the company the employee belongs to, this can be multiple option or not.
My issue now is that when I run the report the first parameter prompt I get is only the stored procedure parameters, once I input these values another parameter window appears asking for the stored procedure parameters again i.e. the dates but this time also the company parameter.
Is it possible to only have one parameter window prompt with the dates and company parameter appearing once and having to be entered once ?

You can check two aspects:
There is no subreport in this report.
Option "Verify on First Refresh" and "Verify Stored Procedures on First Refresh" are unchecked.

Related

How to use a dynamic parameter with a command in crystal reports?

The problem I'm running into is quite easy to recreate.
In Crystal Reports Developer I add two different tables:
The full table "Users"
A Command containing SELECT * FROM Users
In the Field Explorer I add a new parameter and set this to dynamic. I have this parameter pull it's data from any field in either of the two tables (doesn't matter). Of course making sure the parameter is used in the record select.
If I now preview this report (in Developer) it works perfectly. I get a popup allowing me to select data from whatever field I selected in the parameter.
Using this report in Crystal Viewer it prompts for database username and password.
It seems it only does this when the same report contains both a dynamic parameter and a command. Removing the SQL command (leaving only the table) and the report works as expected.
Does anyone know how to resolve this, or is there some workaround?

SSRS conditional execution of dataset

I have two different datasets in SSRS report which gives different number of output fields.I have used this two data set into two different tables in report.
1) One table will display output at a time in execution based on condition.
Actually while running the report two datasets are executing the SP and it takes more time to display the output.
Requirement:
I need to execute the one dataset SP at time based on condition.Other Dataset SP should not Execute.
Example:
Dataset1 executes Sp1
Dataset2 executes Sp2
Table1 uses Sp1
Table2 uses Sp2
Normally while executing report Table1 will display output(Based on default parameter selection)
But SP1 and SP2 are executing on same time.so report takes more time to display output.
I need to execute 1 SP at a time based on condition.so that other dataset SP will not execute.
Step1:
First Create Dummy SP for Dataset .That SP should have same input parameters and same output fields as original SP1 but gives zero output rows.Do the same for SP2 for Dataset 2
Step2:
In Dataset properties select StoredProcedure Icon and in Fx column add below code
=IIF(Parameters!ManagerID.Value= -1,"SP1","DummySP")
Note: DummySP created should be same like SP1
Do the same for Dataset 2..and this works.
I have seen this answer, it's nice, but to create two SP's, it is sometimes very cumbersome. Sometimes the report uses a SP's many. This means that all SP's must be duplicated. And if you double the reports many... This means that they need to be maintained and improved throughout their lives.
Instead I have another solution:
Step 1: I create one SP, and use one of the parameters that already exists anyway.
Step 2: In the mapping of the DS\Report's parameters, instead of sending to DS the parameter sent to the report as it is, you can write an expression, which says that if I want to display the data of this SP I send the parameter sent to the report, and if I do not want to display this data, I will send different parameter , Which will cause the SP not to return data.
All this of course only if it is a procedure with parameters that allow the above. It is also possible to create a special parameter for this.
The following is a picture and example of an expression:
and the expression:
=IIf(Parameters!Display_xxx.Value=1,Parameters!yyy.Value,0)
You must control the visibility of tablix depends on the received parameter, in additional you can create parameters on both queries to control where execution to avoid the execution, like
Where #Condition = 1 AND ( Your WHERE )
As for that sack of performance, you don't want to run other SP at all, in this case, as per my experience, the best way is to modify your stored procs to add a new parameter based on what you are deciding what data set to call (means what data to pull).
So that, if the parameter says that the specific SP is not required, don't run the code in SP using IF-ELSE combo and return blank single row.
And then, on top of that, you can hide or show your tablix.
Hope that makes sense?
And if the column count and data types are same, you can always use an expression to decide what stored-proc to call.

Passing a parameter from query multiple times and invoking SSRS report

There is an SSRSreport connecting to Oracle DB and it has one date parameter. Is it possible to create a data driven subscription and call it and pass multiple date parameters from a query so that every time a date parameter is passed report gets invoked for each date?
Yes, the subscription will run a copy of the report for each row that the data-driven query returns. So they can each be run with a different date parameter value.

Passing multiple parameter values to crystal reports using SQL

I have in my report a few needed arguments like 'A','B','C' and I would like to pass it using SQL.
How can I do that?
I tried prm_szDiscType='C','N','P' , prm_szDiscType = C,N,P, and prm_szDiscType=''C'',''N'',''P''
I'm not sure how you pass parameters via URL.
In Crystal Reports desktop client, I created a Command Parameter with "Allow multiple values" check on.
Then in my Command SQL, I use a where clause such as:
where item in {?Item}
When you check "Allows multiple values" on, Crystal will create the clause after in. If you select Value Type of String, the values you enter will automatically be wrapped in single quotes.
Credit to ExpertsExchange thread on command parameters ;)

How to input user parameters for an SSRS report?

I created a report using SSRS on VS2008 with a SQL query. My query uses two parameters to run :
I can input these parameters manually in Visual Studio, but how can I let the user input these parameters in CRM and then send them to my report ?
If you set the parameter visibility as "Visible" then the user will get the option to enter data at the top of the report. If the parameter type is correctly set then you will get the right editor for the type i.e. a calendar for a datetime type etc.