Monday, February 13, 2012

Allow Blank Values for Strings

I have a data set in Reporting Services Report (2003)

if (@.prmAudit = 0 or @.prmCellType = 0)
BEGIN
select top 5000 * from NECCCUSTAUDIT.dbo.vw_cust_audit_billing_problem b where datediff(d,@.prmStartDate,b.fld_date_time) >=0 and datediff(d,@.prmEndDate,b.fld_date_time) <=0 and b.fld_problem_type like @.prmType + '%'
END
if (@.prmAudit = 1 or @.prmType = 0)
BEGIN
select top 5000 * from NECCCUSTAUDIT.dbo.vw_cust_audit_cell_problem b
where (DATEDIFF(d, fld_date_time, @.prmStartDate) <= 0)
AND (DATEDIFF(d, fld_date_time, @.prmEndDate) >= 0) and fld_problem_type not like 'A%'
AND b.fld_problem_type like @.prmCellType + '%'

END

--

When I preview my report

Enter the Fist Date, Last Date, prmAudit, prmType

>> I do not select anything for prmCellType

There is no data seen, it is totally blank.

>> When I select FistDate, LastDate, prmAudit, prmType and prmCellType

It works all fine.

Question: I want my query to accept @.prmType as blank, so I went to Reports-->ReportParameter and allowed for Blank. This parameter is a string.

Still my Report does not do what I want?

Please could somebody help me correct my query or give a better solution.

Thank you,

Does the "allow blank" option work in preview, but not when republishing the report on the report server?

In that case, you first have to delete the report from the report server and then publish again. If you just republish over an existing report, parameter settings will be merged with the previous parameter settings (and in this case, the allow blank option will be ignored).

-- Robert

No comments:

Post a Comment