Adding Date as Optional Parameter with NULL Check Box in SSRS - reporting-services

I have report with date range as the parameters, User can narrow the results by selecting the date range. Now user want to make the date range fields optional. I enabled "Allow NUlls", user can gary out the date range parameters. The report is returning Zero records after selecting the Check BOX(Graying out the date fields)
I Follwed below ling to fix this, but while Im editing the Formula window, its either throwing END of formula expected ot Sysntax error over ':' .
I copied below code in the Edit as Formula window
OR(FIND(Fund_Project_Date, Parameter:Fund_Project_Date) <> 0, Parameter: Fund_Project_Date = EMPTY)
http://social.technet.microsoft.com/Forums/en-US/sqlreportingservices/thread/d2dd4521-fedd-4501-a675-1ec3b4b87989
Software used:
SSRS 2008 R2 , Report developed from Report Model edited through Report builder 3.0
Thanks in advance

I found it . the solution is "=IIF(Isnothing(Parameters!ItemWorkflow_CUWC_Event_Date.Value),"12/12/1900",Para‌​meters!ItemWorkflow_CUWC_Event_Date.Value)" at Dataset properties level not at Query Designer Filter level. Thanks every one.

You need to use a ! not a :
Hope this helps.

Related

SSRS: Get Dates from Report Into Header Text Boxes

My Dataset has Variables #StartDate and #EndDate that I use to describe a Date Range of the Previous Month.
I Cast () both Date variables as Varchar - E.g. Cast(#StartDate As Varchar(10)) As StartDate and then include StartDate and EndDate in my Final Output.
The Report Body/Detail has StartDate and EndDate fields included but Not Visible.
In the Header of the Report, I have a Text Box in which I have the Expression:
=ReportItems!StartDate.Value
When I run the report, I get the following Warning - and nothing shows in the Test Box in the Header.
Warning [rsInvalidExpressionDataType] The Value expression used in textrun 'StartDate.Paragraphs[0].TextRuns[0]' returned a data type that is not valid.
When I make the two Date fields in the Report Visible, I see that the Values in there are all "#Error". This part is puzzling ... as the two fields SSMS show the dates in '2021-04-20' format.
One thing I should mention. The working report was created using an earlier version of Visual Studio. I am currently using VS 2017 to create this new report.
I would appreciate any help I can get.
Sincerely!
I found the answer in another thread that I hadn't found before. Sorry. The suggestion was to delete the rdl.Data file for the Report. Worked like a charm. Again, apologies that I didn't find that suggestion before I posted my question.

SSRS Report Parameter Issue

I have a report that contains 3 parameters. Start Date, End Date and Segment. The Segment parameter is a multi-value and is set-up as a default. When I run the report (after clicking view report) the Segment parameter value goes blank. When I select several values the report runs, but when I select all the parameter removes the default. I tried to troubleshoot the issue in Visual Studio 2013 and it runs fine, the issue is when it runs from the SSRS report server. Please advice. Thanks.
You can resolve the no data issue by doing the following:
assuming that your parameter names are :
#startdate, #enddate,#segment
Get a list of distinct segment values for your segment dataset.
For that you need to do something like the following
Assuming your table name is segmenttable and your column is segmentcolumn and there is a date somewhere that you join to do get all the distinct segment columns between the dates..
set your query for the segment parameter list to the following (something similar of course)
select distinct
segmentcolumn
from segmenttable
where segmenttable.segmentdate between #start_date and #enddate
This will always ensure that the segment parameter only has values between the dates that is selected and never any value that has "no data" associated with the segment..
Now set your available value and default value for your #segment parameter from this dataset. Done!

What is the correct format for SSRS datetime parameter on Subscription page

I have a report which takes two dates as parameters. This is meant to be automated report, send regularly via subscription to certain users. Let's say I want dateTo to be today and date from to be today - days.. I can't figure out the format or formula that would do this in these fields... I am getting :
One or more report parameters have an invalid parameter value.
Thanks for any help!
Make another parameter like #ReportPeriod, that accepts either "Daily", "Weekly" or "Monthly", and the subscription sets the value of that. Then hide the Date parameters and set them inside the report based on the ReportPeriod chosen.

Adding Fields into an expression in an SSRS 2008 report

Thank you in advance for taking your time to answer my question.
I am having trouble with expressions in the SSRS reporting system.
The Field I am adding required fields from the dataset I provided in the report, however when I try to preview the report I get the Following message:
"A Value expression used for the report parameter ‘Policies_Total’
refers to a field. Fields cannot be used in report parameter
expressions."
This is my expression:
=IIF(Sum(Fields!policy_id.Value, "DataSet1") Is Null, 0, Count(Sum(Fields!policy_id.Value, "DataSet1")))
That was suppoed to be converted from Crystal reports which has the following expression:
If IsNull ({usp_rep_agent_cases;1.policy_id}) then
0
Else
Count ({usp_rep_agent_cases;1.policy_id})
Any help is much appreciated.
Thank you
I think it may be as simple as understand that a 'parameter' should be passed into SSRS before fields are created for the most part. If this parameter is DEPENDENT on the value of something else first being chosen you cannot list it first as the field is not yet populated to my knowledge. It appears you are trying to use an expression to count something from a field from a dataset when you just make a dataset and reference that field directly. So instead of trying an expression you may choose a few other options instead:
Choose on the left pane of your parameter 'Available Values' selected 'Get values from a query'. You may use your query which is a 'dataset', value is self explanatory, label is what the end user will see display.
The option 'Allow null' value will accept a null value
You may run into situations where multiple datasets may need to be used, multiple selects or querying objects. In my experience with SSRS it gets mad at times when you try to reference a dataset used to display data with a dataset used to determine an event or action. SSRS also gets relativity slower the more Expressions you do so doing a whole report with nothing but expressions versus taking the power of the built ins of the RDL language is not really worth it IMHO.
For SSRS expressions you need to use IsNothing for NULL checking, something like:
=IIF(
IsNothing(Sum(Fields!policy_id.Value, "DataSet1"))
, 0
, Count(Sum(Fields!policy_id.Value, "DataSet1"))
)
In fact the whole expression seems a bit odd; what are you specifically trying to achieve with your expression? Are you just trying to count non-null values?
=Sum(IIf(IsNothing(Fields!policy_id.Value), 1, 0), "DataSet1")
Also, your error seems to be saying that a parameter is referencing a field when this isn't allowed, which may not be solved by changing syntax; I think more information about what you're trying to achieve is required here.

Parameter missing a value

I am new to reporting services and have a reporting services 2005 report that I am working on to use as a base report template for our organization. I am trying to place the date that the report was last modified on the report server into the page header of the report. However, I keep getting a 'ParamX' parameter is missing a value error when I try to This is what I have done:
Set up a Parameter ReportName with a default value of Globals!ReportName. It is also hidden and internal.
Set up a Dataset ReportHeader that calls a stored procedure that returns the date the report was last updated or another date, if the report is not on the report server. It has a parameter #ReportName assigned to the Parameter!ReportName.Value. The Dataset returns values when run on the dataset tab in the BI tool.
Set up a Parameter ReportVersion that has a default value Query From based on the dataset ReportHeader and picking the ModDate column. It is the last parameter in the report parameters list.
I assign a textbox to the parameter.
When I preview, I get "The 'ReportVersion' parameter is missing a value whether I place it in the report body or page header (which is where I want it). I have deleted and added the parameter again, toyed with the hidden and internal settings on it.
What does this error really mean, what I am missing, and can I even do this with parameters?
Thanks In Advance
Jim
If I understand what you're doing, it sounds like you want to be using a field where you're implementing a parameter...
You are returning the ModDate from the data source, correct? If you're doing this, you can simply throw a text box in there, and use something like this: =Fields!modDate.Value to display it.
Parameters are values that go in to the query, fields are what it returns.
Hope this helps...
EDIT:: OK so are you trying to retrieve the mod-date column value from the reportserver db? If that's what we're talking about, you'll need to add a few things to the report. Add a datasource to report db, a dataset containing the date (query below), a list object in the report linked to the dataset, and a textbox in said list object to display the field. If you hit the report server with a query like this:
SELECT MAX(ModifiedDate) AS ModDate FROM catalog WHERE name='myReportName'
That will return your modifieddate from the ReportSErvices Database as a field that you can use.