April 30, 2014 at 9:07 am
Hello,
I have an ssrs report in the header I am trying to display report start date and report end date.
This is old active report we are converting to ssrs.
In the active report start date and end date is like this
fiscalYear = System.DateTime.Now.Date.Year;
claimMonth = System.DateTime.Now.Date.Month - 1;
startFY = Convert.ToDateTime(Convert.ToString(claimMonth) + "/01/" + Convert.ToString(fiscalYear-3));
endFY = Convert.ToDateTime(Convert.ToString(claimMonth) + "/01/" + Convert.ToString(fiscalYear));
this.repStartFY.Text = startFY.Date.ToShortDateString();
this.rptEndFY.Text = endFY.Date.ToShortDateString();
In ssrs report I taken a text box and written expression as
="Report Start Year Date:" + System.DateTime.Now.Date.Month-1
+ "/01/" + System.DateTime.Now.Date.Year-3
="Report End Year Date:" + System.DateTime.Now.Date.Month-1
+ "/01/" + System.DateTime.Now.Date.Year
But its showing error not sure where I am doing mistake;Any help..
April 30, 2014 at 11:10 am
You need to convert your Month and Year to strings in order for the "+" to be concatenation and not addition and you can't add a string and integers.
You can use CStr(Number) or (Number).ToString()
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply