CAM Posted December 13, 2017 Posted December 13, 2017 I've just been asked to run one of the menu route reports in SIMS at the end of every week, cut up the information and give it to the relevant people. Getting staff to run it themselves was my first suggestion but the Head shot it down, so I'm looking at automation instead. Is there any way of running Registers With Missing Marks in the Lesson Monitor reports menu automatically? I'm looking at a time period over the past week generated for each year group and then sent to each relevant head of year. I know it's possible with custom built reports (although I haven't used Scheduled Reports yet) but not so sure on the built-in ones. Anything more efficient than "It's just five minutes of cutting and pasting."
Cache Posted December 13, 2017 Posted December 13, 2017 Nope, you can't automate it unfortunately - asked the question myself. If you do come up with anything automated I'd be interested.
CAM Posted December 14, 2017 Author Posted December 14, 2017 (edited) I've figured out I need CommandReporter to run a custom report and it will need parameters for the date. The following Powershell command gets the date in dd/mm/yy format for the report parameters: Get-Date -uformat "%d/%m/%y" I'm not sure on the final date format required but the formatting can be tweaked with the uformat switch. To get Monday (if running scheduled on a Friday) you need this command: (Get-Date (Get-Date).AddDays(-4) -uformat "%d/%m/%y") It fetches the date, adds -4 days to the result (so back to the start of the week aka Monday) and returns the date in the required format. This isn't necessarily specific to this solution, but if anyone wants to supply an offset date in an automated report it's useful so figured I'd post it. Need to get my permissions loosened a bit by the IT team first before I can test it though. I can't run scripts or schedule tasks. -uformat strings available: %A - Day (string) %d - Day (2 numbers) %m - Month (2 numbers) %h - Month (String in short format) %y - Year (2 numbers) %Y - Year (4 numbers) %D - Quicker way of calling Date in dd/mm/yy format %X - Quicker way of calliing Time in hh/mm/ss format %H - Hours %M - Minutes %S - Seconds Edited December 14, 2017 by CAM
Esteban_Child_of_the_Sun Posted December 14, 2017 Posted December 14, 2017 I do it like this $reportDate = (Get-Date).AddDays($daysOffset).ToString("dd/MM/yyyy") $commandReporterParams = " $reportDate $reportDate " &$commandReporter /TRUSTED /SERVERNAME:$ServerName /DATABASENAME:$DatabaseName /REPORT:Report1 /OUTPUT:"$srcPath\Terms.xml" /PARAMS:"$commandReporterParams" | Out-File -filepath $log -Append -encoding ASCII 2
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