+ Post New Thread
Results 1 to 3 of 3
MIS Systems Thread, SIMS.net Reporting in Technical; I'm setting up scheduled reports in SIMS.net and want to run reports which will show behaviour incidents for the previous ...
  1. #1
    MikeW's Avatar
    Join Date
    Nov 2005
    Location
    Moston, Manchester
    Posts
    14
    Thank Post
    39
    Thanked 1 Time in 1 Post
    Rep Power
    18

    SIMS.net Reporting

    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

  2. #2

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,433
    Thank Post
    1,432
    Thanked 1,161 Times in 794 Posts
    Rep Power
    705
    Quote Originally Posted by MikeW View Post
    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
    Code:
    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 either /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.
    Last edited by LosOjos; 22nd November 2010 at 10:35 AM.

  3. Thanks to LosOjos from:

    MikeW (22nd November 2010)

  4. #3

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,433
    Thank Post
    1,432
    Thanked 1,161 Times in 794 Posts
    Rep Power
    705
    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.

    Code:
    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 = "<ReportParameters><Parameter id=""N+WhVUXPCJ3JfZcRyTsVEw=="" subreportfilter=""True""><Name>Date</Name><Type>DateRange</Type><PromptText>Date is between</PromptText><Values><DateRange><Start>"
    
    'Calculate start date
    strDate = DateAdd("d",-7,Date)
    strStart = Year(strDate) & "-" & Month(strDate) & "-" & Day(strDate) & "T00:00:00"
    
    strParams = strParams & strStart
    strParams = strParams & "</Start><End>"
    
    'Calculate end date
    strEnd = Year(Date) & "-" & Month(Date) & "-" & Day(Date) & "T23:59:59"
    
    strParams = strParams & strEnd
    strParams = strParams & "</End></DateRange></Values></Parameter></ReportParameters>"
    
    'execute command reporter
    ParamFile.Write(strParams)
    ParamFile.Close
    WshShell.Run "commandreporter /user:<username> /password:<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.
    Last edited by LosOjos; 24th November 2010 at 11:15 AM.

  5. 3 Thanks to LosOjos:

    MikeW (24th November 2010), StevieTSS (17th October 2013), vikpaw (3rd February 2011)

SHARE:
+ Post New Thread

Similar Threads

  1. [SIMS] SIMS.Net Active Directory Integration
    By robknowles in forum MIS Systems
    Replies: 29
    Last Post: 4th October 2011, 02:54 PM
  2. [SIMS] SIMS.net and multiple connect.ini files
    By NortyUK in forum MIS Systems
    Replies: 23
    Last Post: 9th September 2011, 12:05 PM
  3. [SIMS] Ecopy Toshiba SIMS.net Connector, AD login
    By ithelp in forum MIS Systems
    Replies: 2
    Last Post: 17th March 2011, 08:28 AM
  4. [SIMS] Import into sims.net diary
    By philjones2000 in forum MIS Systems
    Replies: 9
    Last Post: 9th March 2011, 10:57 AM
  5. Sims.net - Reporting on Achievement and Behaviour
    By Iain.Faulkner in forum MIS Systems
    Replies: 22
    Last Post: 21st November 2009, 09:35 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •