Skip to content

Commit 91be788

Browse files
authored
Update Report List.rdl
1 parent 9921609 commit 91be788

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

ServerReports/Report List.rdl

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -87,29 +87,29 @@ SET @all_value = '<ALL>'
8787
report_users
8888
AS
8989
(
90-
SELECT UserID, SimpleUserName = UPPER(RIGHT(UserName, (LEN(UserName)-CHARINDEX('\',UserName)))) FROM dbo.Users
90+
SELECT [UserID], [SimpleUserName] = UPPER(RIGHT([UserName], (LEN([UserName])-CHARINDEX('\', [UserName])))) FROM dbo.[Users]
9191
)
9292
,
9393
report_catalog
9494
AS
9595
(
9696
SELECT
97-
rpt.ItemID
98-
, rpt.CreatedById
99-
, rpt.ModifiedById
97+
rpt.[ItemID]
98+
, rpt.[CreatedById]
99+
, rpt.[ModifiedById]
100100
, rpt.[Type]
101101
, rpt.[Name]
102102
, rpt.[Description]
103103
, rpt.Parameter
104-
, CreationDate = CONVERT(DATETIME, CONVERT(VARCHAR(11), rpt.CreationDate, 13))
105-
, ModifiedDate = CONVERT(DATETIME, CONVERT(VARCHAR(11), rpt.ModifiedDate, 13))
106-
, ReportFolder = SUBSTRING(rpt.[Path], 2, Len(rpt.[Path])-Len(rpt.[Name])-2)
104+
, [CreationDate] = CONVERT(DATETIME, CONVERT(VARCHAR(11), rpt.[CreationDate], 13))
105+
, [ModifiedDate] = CONVERT(DATETIME, CONVERT(VARCHAR(11), rpt.[ModifiedDate], 13))
106+
, [ReportFolder] = SUBSTRING(rpt.[Path], 2, Len(rpt.[Path])-Len(rpt.[Name])-2)
107107
, rpt.[Path]
108-
, URL_ReportFolder = 'http://' + Host_Name() + '/Reports/browse/' + SUBSTRING(rpt.[Path], 2, Len(rpt.[Path])-Len(rpt.[Name])-2)
109-
, URL_Report = 'http://' + Host_Name() + '/Reports/report/' + SUBSTRING(rpt.[Path], 2, Len(rpt.[Path])-Len(rpt.[Name])-2) + '%2f' + rpt.[Name]
110-
, ReportDefinition = CONVERT(VARCHAR(MAX), CONVERT(VARBINARY(MAX), rpt.Content))
108+
, [URL_ReportFolder] = 'http://' + Host_Name() + '/Reports/browse/' + SUBSTRING(rpt.[Path], 2, Len(rpt.[Path])-Len(rpt.[Name])-2)
109+
, [URL_Report] = 'http://' + Host_Name() + '/Reports/report/' + SUBSTRING(rpt.[Path], 2, Len(rpt.[Path])-Len(rpt.[Name])-2) + '%2f' + rpt.[Name]
110+
, [ReportDefinition] = CONVERT(VARCHAR(MAX), CONVERT(VARBINARY(MAX), rpt.[Content]))
111111
FROM
112-
dbo.Catalog AS rpt
112+
dbo.[Catalog] AS rpt
113113
WHERE
114114
1=1
115115
AND rpt.[Type] = 2
@@ -118,39 +118,39 @@ SELECT
118118
rpt.ItemID
119119
, rpt.[Name]
120120
, rpt.[Description]
121-
, rpt.Parameter
122-
, ReportCreatedBy = urc.SimpleUserName
123-
, ReportCreationDate = rpt.CreationDate
124-
, ReportModifiedBy = urm.SimpleUserName
125-
, ReportModifiedDate = rpt.ModifiedDate
126-
, rpt.ReportFolder
127-
, ReportPath = rpt.[Path]
128-
, rpt.URL_ReportFolder
129-
, rpt.URL_Report
130-
, rpt.ReportDefinition
131-
, CommandText = rpt.ReportDefinition
132-
, el.ExecutionLogCount
133-
, sc.SubscriptionCount
134-
, SearchForStr = ISNULL(@SearchFor, ' ')
121+
, rpt.[Parameter]
122+
, [ReportCreatedBy] = urc.[SimpleUserName]
123+
, [ReportCreationDate] = rpt.[CreationDate]
124+
, [ReportModifiedBy] = urm.[SimpleUserName]
125+
, [ReportModifiedDate] = rpt.[ModifiedDate]
126+
, rpt.[ReportFolder]
127+
, [ReportPath] = rpt.[Path]
128+
, rpt.[URL_ReportFolder]
129+
, rpt.[URL_Report]
130+
, rpt.[ReportDefinition]
131+
, [CommandText] = rpt.[ReportDefinition]
132+
, el.[ExecutionLogCount]
133+
, sc.[SubscriptionCount]
134+
, [SearchForStr] = ISNULL(@SearchFor, ' ')
135135
FROM
136136
report_catalog AS rpt
137-
LEFT JOIN (SELECT ExecutionLogCount = COUNT([ReportID]), ReportID FROM dbo.ExecutionLog GROUP BY ReportID) el ON el.ReportID = rpt.ItemID
138-
LEFT JOIN (SELECT SubscriptionCount = COUNT([Report_OID]), Report_OID FROM dbo.Subscriptions GROUP BY Report_OID) sc ON sc.Report_OID = rpt.ItemID
139-
LEFT JOIN report_users AS urc ON rpt.CreatedById = urc.UserID
140-
LEFT JOIN report_users AS urm ON rpt.ModifiedById = urm.UserID
137+
LEFT JOIN (SELECT [ExecutionLogCount] = COUNT([ReportID]), [ReportID] FROM dbo.[ExecutionLog] GROUP BY [ReportID]) el ON el.[ReportID] = rpt.[ItemID]
138+
LEFT JOIN (SELECT [SubscriptionCount] = COUNT([Report_OID]), [Report_OID] FROM dbo.[Subscriptions] GROUP BY [Report_OID]) sc ON sc.[Report_OID] = rpt.[ItemID]
139+
LEFT JOIN report_users AS urc ON rpt.[CreatedById] = urc.[UserID]
140+
LEFT JOIN report_users AS urm ON rpt.[ModifiedById] = urm.[UserID]
141141
WHERE
142142
1=1
143-
AND (@all_value IN (@ReportFolder) OR rpt.ReportFolder IN(@ReportFolder))
144-
AND (@CreatedBy IS NULL OR urc.SimpleUserName LIKE '%' + @CreatedBy + '%')
145-
AND (@CreatedDate IS NULL OR rpt.CreationDate >= @CreatedDate)
146-
AND (@ModifiedBy IS NULL OR urm.SimpleUserName LIKE '%' + @ModifiedBy + '%')
147-
AND (@ModifiedDate IS NULL OR rpt.ModifiedDate >= @ModifiedDate)
143+
AND (@all_value IN (@ReportFolder) OR rpt.[ReportFolder] IN(@ReportFolder))
144+
AND (@CreatedBy IS NULL OR urc.[SimpleUserName] LIKE '%' + @CreatedBy + '%')
145+
AND (@CreatedDate IS NULL OR rpt.[CreationDate] >= @CreatedDate)
146+
AND (@ModifiedBy IS NULL OR urm.[SimpleUserName] LIKE '%' + @ModifiedBy + '%')
147+
AND (@ModifiedDate IS NULL OR rpt.[ModifiedDate] >= @ModifiedDate)
148148
AND (
149149
@SearchFor IS NULL
150150
OR (
151151
(rpt.[Name] LIKE '%' + @SearchFor + '%' AND (@all_value IN(@SearchType) OR 'Report Name' IN(@SearchType)))
152152
OR (rpt.[Description] LIKE '%' + @SearchFor + '%' AND (@all_value IN(@SearchType) OR 'Report Description' IN(@SearchType)) )
153-
OR (PATINDEX('%' + @SearchFor + '%', rpt.ReportDefinition) > 0 AND (@all_value IN(@SearchType) OR 'Report Definition' IN(@SearchType)) )
153+
OR (PATINDEX('%' + @SearchFor + '%', rpt.[ReportDefinition]) > 0 AND (@all_value IN(@SearchType) OR 'Report Definition' IN(@SearchType)) )
154154
)
155155
)</CommandText>
156156
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>

0 commit comments

Comments
 (0)