how to avoid cascading in ssas parameters in ssrs report and load default "all" when report loads? - ssrs-2008

i have a ssrs report which uses ssas data source and all of the parameter in report also come from ssas data source. the problem is parameters are acting as cascading parameters. i can not have values in parameter drop-down until i select parameter from previous drop-down.
i wanted to have default value "All" selected when report loads instead of waiting for selecting first parameter and then load subsequent?
i have removed #parameters from parameter data source and now here is how my MDX looks like:
WITH MEMBER
[Measures].[ParameterCaption] AS [Category].[Category ID].CURRENTMEMBER.MEMBER_CAPTION MEMBER
[Measures].[ParameterValue] AS [Category].[Category ID].CURRENTMEMBER.UNIQUENAME MEMBER
[Measures].[ParameterLevel] AS [Category].[Category ID].CURRENTMEMBER.LEVEL.ORDINAL
SELECT
{
[Measures].[ParameterCaption],
[Measures].[ParameterValue],
[Measures].[ParameterLevel]
} ON COLUMNS ,
[Category].[Category ID].ALLMEMBERS
ON ROWS FROM
( SELECT ( [OwningEntity].[Entity ID] )
ON COLUMNS FROM
( SELECT ( [Organization].[Organization] ) ON COLUMNS FROM [PerformanceScores]
))

Create Additional data source , point your first parameter with default value "from query" to that data source - This parameter need to be on the top of the list as in SSRS order of parameters is important.
- Let me know if you got any problems.
Thanks
Daniel

Create hidden parameter with IIF statement in default value.
in IIF put dummy date - this will not execute the report but will fill all the other parameters.
IIF(yourparameter.value="",dummydate.value,yourparameter.value)
Use this hidden parameter as your "Main" data range but default value will depend on visible parameter value in IIF statement when user can choose the range
This should work...

Related

Generate table report using sql joins in iReport

SELECT a.CIVIL_ID,a.PAT_NAME,a.SEX,a.PAT_NAT_CD,a.BIRTH_DT,a.ADDR,a.MOBILE_NO,b.FILE_NO,b.CREATED_DATE
FROM PAT_MST a
JOIN PATIENT_FILE b ON (a.PATIENT_ID = b.PATIENT_ID)
AND( b.HOSP_DEPT_SEC_SERIAL = $P{P_HOSP_DEPT_SEC_CD})
AND a.SEX = DECODE($P{P_GENDER},'ALL',a.SEX,$P{P_GENDER})
AND TRUNC(B.CREATED_DATE)>= TO_DATE($P{P_FILE_CR_DT_FROM},'DD/MM/RRRR') AND TRUNC(B.CREATED_DATE) <= TO_DATE($P{P_FILE_CR_DT_TO},'DD/MM/RRRR')
I am using this query to generate a table report in iReport(5.6.0), but for some reason I am only getting the column headers but this query is returning records when I run on toad.
Please tell where I am wrong..
Are you using Table report element? If so, you are using not the main dataset but some other subdataset. You should transfer parameters values from the main dataset to the one of which your table "feeds".
Add to your subdataset a parameter for an every parameter, used in main dataset.
Right click on your table Edit table dtasource->select Parameters tab->click Add.
In the Add/modify parameter window select your subdataset parameters in the upper menu. In the lower menu select their values (correspondent parameter from main dataset). Do this for an every parameter.

SSRS two datasets need to use field from one dataset as a parameter in second?

The issue is that the in field that has the data is just one record in the data set pulled from a set stored proc (not touchable).
Then using it as a parameter in the second dataset. Any help would be appreciated.
Add parameter
Select parameter visibility as Hidden
Go to Default Values: (Screenshot of below)
Select "Get values from a query" (and select your first dataset and value field)
In Dataset 2 filter the data with your new parameter
i.e. SELECT * FROM XYZ WHERE ABC IN (#Param)
You can do this using a subreport.
Add a subreport to the main report.
Add a parameter to the subreport.
Open the rdl of the subreport, add a paramter with the same name.
create a dataset in that RDL using your query for example
select * from YourTable where ENTY_KEY = (#param)

SSRS report parameters

In my SSRS report there are 2 parameters called DataSourceIDList and ReporterIDlist.
DataSourceIDList : is a drop down list and this will populate based on SQL query.
ReporterIDlist : is a drop down list and this will populate reporters based on selected Datasourceid from DataSourceIDList and this is also a SQL query.
both parameters are optional fields but when i am running the report i am getting error called "Please select value for DataSourceID" but i set the property for that parameter as allow NULL values
and same problem for ReporterIDlist also.
Please suggest your suggestion....
Thanks in advance...
I think that SSRS will not allow you NULL value if parameter have datasource.
Trick that I do when I need all values that is: I change data source for parameters that is in list have
null, or ( 0) value, and option select ALL, and after that I set default value to null so users do not have to touch parameters before it call it
Something like this,
Select 1,null as ValueOfParam,'All values' as TextOfParam
union all
select 2,id,name from myDatasourceThatHaveParamValues
order by 1,name
to verify date, you can use this method too:
make two rectangle; insert table/matrix in first rectangle
in second rectangle insert msg like
"Selected Date is not valid, please select correct date"
or "Start Date should be less less than End Date"
put appropriate msg, and make condition in 1st rectangle where all tables/matrix is there
iif( Parameters!StartDate.Value < Parameters!EndDate.Value,false,true)
in second rectangle where Error msg is inserted write this:
iif( Parameters!StartDate.Value < Parameters!EndDate.Value,true,false)

Can I assign a value for one parameter

I am using crystal reports 2008. I want to generate a report for which i will get one value from one subreport and i want to pass this value as a parameter so that i can include this value in the sql command.
For eg.
From my subreport i will get customerkey and i want to pass this value in the sql as
{?customerkey}
Sql is 'select card_number from customers where customerkey={?customerkey}'
For this i created parameter in the command and added like this.
But what my problem is this customerkey is getting from subreport(using shared variable).If i get a value customer_key from subreport how will i assign this value to {?customerkey}. I tried like assighning this value but i dont want to popup {?customerkey}this value as a parameter.
Can anyone help? Please
So you want the data shown in the main report to be based on a parameter passed to it from a subreport? I don't think this is possible - the Report Processing Model (described here) states that SubReports are in 'Pass 2', while data retrieval is in 'Pass 1'. This means that the parameter prompt will always appear first.
You might instead be able to have the main report contain TWO subreports, the first of which is used to retrieve the parameter and the second uses it. That can get very messy, especially when dealing with page headers and footers.

Default value to a data parameter , SSRS

In my SSRS report I wanted to default the date parameter with the execution date. I default the date patameter with =DateValue(Globals!ExecutionTime)
or =today. I do have 5 other parameters in my report.
In reporting manager, it makes the page refresh each time when I select another parameter value. Why is that? How do I solve this?
Hope this helps somebody still in need.
To avoid refreshes on changing parameters, avoid using expressions in the Parameter default values.
For example, instead of specifying =TODAY() expression, create a dataset with a SQL query such as SELECT getdate() = DefaultDate and from the parameter, refer to this dataset using query for your default value.
check these out:
http://blog.summitcloud.com/2009/12/fix-refresh-of-parameters-in-ssrs/
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/6e5c4137-092f-4d54-a1a1-27730744074d/
Hope it helps.