Hi
I created a reports with BIRT with 3 parameters “start_date”, “end_date”, and “username”.
My query is:
SELECT SITE ,USERID ,USER_FULL_NAME,SUM(NUMPAGES)
,SUM(CASE WHEN PRINTJOBCOLOR = ‘N’ THEN NUMPAGES ELSE 0 END) AS TotalMono
,SUM(CASE WHEN PRINTJOBCOLOR = ‘Y’ THEN NUMPAGES ELSE 0 END) AS TotalColor
FROM dbo.VW_REPORTS
WHERE (FINALACTION = ‘C’ OR
FINALACTION = ‘P’ OR
(FINALACTION = ‘F’ AND RELEASEMETHOD = ‘R’))
AND FINALDATE BETWEEN ? AND ?
AND USERID = ?
GROUP BY SITE, USERID, USER_FULL_NAME
ORDER BY SITE, USERID ASC
Where: FINALDATE BETWEEN “start_date” AND “end_date”
AND USERID = “username”
In Report Server I created these 3 parameters too. Where:
“start_date” - is a Date/Time Parameter
“end_date” - is a Date/Time Parameter
“username” - is a Data Source Parameter with the query below:
SELECT DISTINCT USERID
FROM PR_STATS
WHERE USERID = ${_RS_USER.getUsername()}
With this setting the Report work very well, I put the date time information manually and to username I use the user login (${_RS_USER.getUsername()).
Now I am testing the scheduler function, it is work very well.
but I would like made it:
I would like send this report by user once time week with user information. In my tests the report was sending to users, but the report generated was created with root user information, because I used root to create the scheduled.
My question is: May I generate report by user? May I get de username or email information the Recipients to email? May I set the “start_date” to get the actual date - 1 week and the “end_date” with actual date?
Regards
Cadu