MikeW Posted November 22, 2010 Posted November 22, 2010 I'm setting up scheduled reports in SIMS.net and want to run reports which will show behaviour incidents for the previous week/month. I can't find any mechanism within the SIMS reporting tool to do this. All I can specify is a range of dates which would have to be changed everytime the report was run - defeating the object of report scheduling. Am I missing someting obvious ? TIA
LosOjos Posted November 22, 2010 Posted November 22, 2010 (edited) I'm setting up scheduled reports in SIMS.net and want to run reports which will show behaviour incidents for the previous week/month. I can't find any mechanism within the SIMS reporting tool to do this. All I can specify is a range of dates which would have to be changed everytime the report was run - defeating the object of report scheduling. Am I missing someting obvious ? TIA Unfortunately, I don't think there is a way of dynamically setting date ranges from within SIMS, ruling out scheduled reporting for this purpose. There is a way to do it though: use CommandReporter and set up a script to dynamically create a parameter file containing the date range you want, this can then be passed as a parameter on the CLI to run the report you want, and you can set the script to run in windows scheduled tasks. CommandReporter can be found in your "\Program Files\SIMS\SIMS .net" folder, and the format is CommandReporter /USER:username [/PASSWORD:password | /TRUSTED] /REPORT:"report name in SIMS .net" /PARAMFILE:"path to your parameter XML file" /OUTPUT:"path to output to including file name" NOTE: you must use [b]either[/b] /PASSWORD or /TRUSTED: /PASSWORD is used when you log in to SIMS using an SQL password, /TRUSTED is when SIMS logs in using Windows authentication IN SIMS, set up the report as you want it, and make sure that the date range is set up so it can be selected at run time. Then the easiest way I find to work out what format your param file needs to be in is to run CommandReporter as described above, but add the /PARAMDEF option to it: that will make the output the default param file, so you can see what you need your script to write to be able to do what you want. EDIT: as an alternative to writing a param file, you can just pass the full XML to an option called /PARAMS, I personally find the param file method easier to debug though, that's why I favour it. Edited November 22, 2010 by LosOjos 1
Popular Post LosOjos Posted November 24, 2010 Popular Post Posted November 24, 2010 (edited) Just in case it's any use to anybody looking to write their own scripts, here is one I came up with for Mike to help solve his problem. It'll run a pre-made SIMS report (Behaviour Incidents) and automatically set the filter to be from one week previous up until the day it is run. Set WshShell = WScript.CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") Set ParamFile = fso.CreateTextFile("params.xml", true) Dim strParams 'Create start of XML parameters strParams = "DateDateRangeDate is between" 'Calculate start date strDate = DateAdd("d",-7,Date) strStart = Year(strDate) & "-" & Month(strDate) & "-" & Day(strDate) & "T00:00:00" strParams = strParams & strStart strParams = strParams & "" 'Calculate end date strEnd = Year(Date) & "-" & Month(Date) & "-" & Day(Date) & "T23:59:59" strParams = strParams & strEnd strParams = strParams & "" 'execute command reporter ParamFile.Write(strParams) ParamFile.Close WshShell.Run "commandreporter /user: /password: /report:""Behaviour Incidents"" /output:output.csv /paramfile:params.xml" One irritation I've found with SIMS reports is that the Parameter ID value changes when the report is imported in to a different database, so that needs to be reflected in your scripts if you share them with anybody else, otherwise the filter is ignored and the report ran as though you ticked the "Accept All" option. The bulk of the script is just writing the params.xml file, the structure of which can be found by initially running your report from CommandReporter with the '/PARAMDEF' option. Also, as you can see above, your username and password are stored as plain text (unless you're using Windows authenication, in which case you replace the '/PASSWORD' option with '/TRUSTED') so it's probably a good idea from a security point of view to create a user in SIMS specifically for running the reports you need to with the minimum set of permissions required to run them. Edited November 24, 2010 by LosOjos 5
unexus Posted March 21, 2017 Posted March 21, 2017 Hi Folks, I've only just stumbled across the existence of CommandReporter.exe so I'm a complete newbie when it comes to using this tool. I've called an existing report using commandreporter.exe with /PARAMDEF option to create the XML parameters file, but the resulting XML does not contain a parameter id. I've looked through several post on Edugeek showing examples of parameter files including scripts on how to dynamically build them. All of them have a unique parameter id string, but I can't figure out how any of you are getting this parameter id value. Can someone tell me what the parameter id is and how it gets generated? Many Thanks, Keith.
vikpaw Posted March 22, 2017 Posted March 22, 2017 It's been a while since I did anything with this, but try another report, perhaps a new one you've written yourself with additional parameters. See if that works.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now