Jump to content

Recommended Posts

Posted

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." :(

Posted

Nope, you can't automate it unfortunately - asked the question myself.

 

If you do come up with anything automated I'd be interested.

Posted (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 by CAM
Posted

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

  • Thanks 2

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...