请你帮我解决这个问题
我创建了一个接收5个参数的报告
所有似乎都运行良好,报告根据需要进行过滤。现在的问题是我需要在另一个系统上发布它的同一个rdl文件,并且在我运行它之后立即发布它给出了这个错误“Reportviewer - 特定报告错误:The 'StartTime' parameter is missing a value ;0;Void Error(System.String, System.Object[])"
由于我在本地运行报告时没有遇到错误,因此我不确定此时会在哪里查看。以下是我使用的代码:
Parameters
@StartDate default = dateadd(dateinterval.Day, -1, Today)
@EndDate default = =dateadd(dateinterval.Day, -1, Today)
@SiteID SQL Dataset = SELECT 0 AS ID, 'All' as Name
FROM sites
UNION
SELECT ID, Name
FROM sites
@StartTime default = 12:00:00 AM
Available values (12:00:00 AM - 11:00:00 PM
@EndTime default = 11:00:00 M
Available values (12:00:00 AM - 11:00:00 PM
SQL Dataset
Declare @Start datetime = cast (@StartDate + ' '+ @StartTime as datetime)
Declare @End datetime = cast(@EndDate + ' ' + @EndTime as datetime )
SELECT Distinct ast.Name as HomeSite, ISNULL(c.FirstName + ' ', '') + c.LastName as Name, md.MemRefNo,att2.Name as VisitedSite,isnull(att2.TotalVisits,0) as TotalVisits, isnull(atc.totalaccepted,0) TotalAcceptedVisits, ISNULL(att.TotalOverrideVisits, 0) AS TotalOverrideVisits, isnull(att1.TotalOverrideDenieds,0) as TotalOverrideDenieds
FROM Contacts c
INNER JOIN MemberDetail md on md.ContactGUID = c.GUID
INNER JOIN Sites ast on c.HomeSiteID = ast.ID
OUTER APPLY
(
SELECT ast.Name,a1.contactguid,COUNT(*) totalaccepted
FROM Attendance a1
INNER JOIN Sites ast on a1.SiteID = ast.ID
WHERE a1.contactguid = c.GUID
AND (a1.IsSwipeSuccessful = 1)
AND a1.accessoverridereasonid IS NULL
AND a1.AttendDate BETWEEN @Start AND @End
AND (a1.SiteID = @SiteID OR @SiteID = 0)
group by a1.contactguid,ast.Name
)atc
OUTER APPLY
(
SELECT ast.Name,a2.contactguid,COUNT(*) TotalOverrideVisits
FROM Attendance a2
INNER JOIN Sites ast on a2.SiteID = ast.ID
WHERE a2.contactguid = c.GUID
AND a2.accessoverridereasonid IS NOT NULL
AND a2.AttendDate BETWEEN @Start AND @End
AND (a2.SiteID = @SiteID OR @SiteID = 0)
group by a2.contactguid,ast.Name
) att
Outer APPLY
(
SELECT ast.Name,a3.contactguid,COUNT(*) TotalOverrideDenieds
FROM Attendance a3
INNER JOIN Sites ast on a3.SiteID = ast.ID
WHERE a3.contactguid = c.GUID
AND a3.IsSwipeSuccessful = 0
AND a3.AttendDate BETWEEN @Start AND @End
AND (a3.SiteID = @SiteID OR @SiteID = 0)
group by a3.contactguid,ast.Name
) att1
Cross APPLY
(
SELECT ast.Name,a3.contactguid,COUNT(*) TotalVisits
FROM Attendance a3
INNER JOIN Sites ast on a3.SiteID = ast.ID
WHERE a3.contactguid = c.GUID
AND a3.AttendDate BETWEEN @Start AND @End
AND (a3.SiteID = @SiteID OR @SiteID = 0)
group by a3.contactguid,ast.Name
) att2
Order by name
答案 0 :(得分:0)
希望这有帮助,
Henro