Aleksey wrote:Hello,
The following code wokrs only for compiled report:
report["ParamName"] = value
Please try to use the following code:
report.Dictionary.DataSources["DataSourceName"].Parameters["ParameterName"].Value = "";
Thank you.
I've tried passing the value in the following string format but receiving 'failed to convert parameter value from Int32 to a DateTime. I've also tried new DateTime(2010, 10, 1).ToString(); but receive an exception in ...AppData\Local\Temp\hogrghq2.0.cs.
Code: Select all
report.Load(Server.MapPath("~/Content/Reports/Stock Usage Detail.mrt"));
report.Dictionary.DataSources["TransMonthDetail"].Parameters["FromDate"].Value = "10/1/2010";
report.Dictionary.DataSources["TransMonthDetail"].Parameters["ToDate"].Value = "4/1/2014";
report.Dictionary.DataSources["TransMonthDetail"].Parameters["ItemNumber"].Value = "4202802";
How should a date string be passed? The parameter is defined as Date and not DateTime.
The query definition is:
Code: Select all
SELECT TransDate,
SiteID,
Item,
ItemClass,
Description1,
TypeDescription,
Cost,
Quantity
FROM TRANS
INNER JOIN Crib ON TRANS.Crib = Crib.Crib
INNER JOIN INVENTRY ON TRANS.Item = INVENTRY.ItemNumber
WHERE (TypeDescription IN ('ADJUS', 'CANCL', 'COUNT', 'ISSRT', 'ISSUE', 'RETN', 'RETNW', 'SCRAP', 'SCRPR')
AND (Transdate >= @FromDate AND TransDate < @ToDate)
AND (Item = @ItemNumber))