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.
Related
I am having an issue with a parameter and the convert function when executing my query in Report Builder.
I am having the following in my code:
CONVERT(VARCHAR(11), COALESCE(Status.POBDate, Status.[Sched Collection Date]),(#DateFormat)) AS [Collection Date]
,CONVERT(VARCHAR(11), Status.[Act Del Date],(#DateFormat)) AS [Delivery Date]
The (#DateFormat) parametner has data type Integer and available values as per the bild below.
The funny thing is that I can run the query in SSMS without any problem, but when trying to apply some adjustments in Report Builder, and save the report, it is complaining about the invalind argument even though, the parament (#DateFormat) was not edited anyhow. The report worked perfect online and only after opening it in Report Builder it started to complain also when I do not apply any new adjustments.
Any idea what can be wrong and how I could solve it?
I have checked some ideas here on stackoverflow, but nothing worked out so far.
Tones of thanks in advance!
Your parameter type is text not integer and that causes the error.
You can verify it by casting the DateFormat parameter to INTEGER in your SQL code
CONVERT(VARCHAR(11), COALESCE(Status.POBDate, Status.[Sched Collection Date]),CAST(#DateFormat AS INTEGER)) AS [Collection Date]
As a suggestion use the parameter to format the dates inside the report.
How to do it:
Remove conversion from your SQL code
In your parameter set it to text and as values set the date format string
For US ="dd/MM/yyyy"
For UK ="MM/dd/yyyy"
For your date fields set the format expression to = Parameters!DateFormat.Value
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!
Report SSRS in window 10 and open from IE 11
my computer filter date not working (not show image calendars)
How to fixed .
thank you.
Expanding on WEI_DBA, it looks like you need to set the default value of your Start Date parameter to ="3/16/2017 0:00:00" since your date format has months and days reversed.
Note that this can be confusing when you have a server with a different region setting than your workstation. The report is fine to develop locally and will then generate this error when deployed to your server.
In the parameter pane, right-click on Start Date and select Parameter Properties. Find "Data Type:" in the middle of the dialog and change the drop down to be Date/Time. Do the same for End date.
A date/time parameter will will show the date picker and will ensure you are passing a properly structured date value into your dataset query, regardless of your culture/language settings.
I have created data set (as TFS drill through report) using TFSOlap data source which is displaying all bugs based on created date. Now, I want to pass date range as parameter from main report so drill through report displays data for the bugs created between given date range. I am getting error "string.. can not be converted to date type" I am using following formatting expression at drillthrough report parameter:
="[Work Item].[System_CreatedDate].&[" + FORMAT(Parameters!FromWorkItemSystemCreatedDate, "yyyy-MM-dd") + "T00:00:00]"
Please let me know what type of expression should be used to avoid error. I tried with using CDate() instead of FORMAT but still getting problem.
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",Parameters!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.