This is the code I am using on the OnLoad event of the form that the iFrame
is in:
crmForm.all.new_closedate.FireOnChange();
var url =
"http://ruby/reportserver?%2fSales+Reports%2fCompany_Forecast&rs:Command=Render&Close_Date_Filter="
var Close_Date_Filter = crmForm.all.new_closedate.DataValue
var param = "&rc:parameters=false"
url = url+Close_Date_Filter+param
document.all.IFRAME_Forecast.src=url
The parameter is set to hidden on the report so I can pass it from the field
however when I try to open the iFrame I get the following error:
The value provided for the report parameter 'Close_Date_Filter' is not valid
for its type. (rsReportParameterTypeMismatch)
I don't understand what the problem is, the field it is referencing is a
date field, I've even tried it as a date/time field but get the same error.
to see exactly what's in the field and what you are passing to SRS. I
believe you will see the day, date, time and time zone, which SRS can't
manipulate into a date.
If you stuff the date field DataValue into a new date() in JavaScript, you
can extract the appropriate data and format it correctly for SRS.
--
Richard Riddle
CRM Developer
Autonomix
Yes you're right, CRM passes through the following: Day, Month, Date, Time,
Time Zone, Year.
I'm a bit of an amateur when it comes to java, if you could explain your
last paragraph in more detail it would be much appreciated!!!
replace your Close_Date_Filter declaration with the two lines below
var closeDate = new Date(crmForm.new_closedate.DataValue);
var Close_Date_Filter = closeDate.getMonth() + 1 + "/" + closeDate.getDate()
+ "/" + newDate.getFullYear();
I don't know if SRS will accept that as a date parameter through a url; i
didn't test it. Also, when doing the report, make sure you are using a view
as your source. CRM stores dates in UTC, so if you go off the table itself,
you may get unexpected results.