none
Custom Task to open/print a SQL SRS Report

    Question

  • I know how to add a custom task, but is it possible to add a custom task that opens a report, passes it a field from the selected/open CI and then runs the report to either display it on screen or send it straight to the printer?

    The idea being that when my engineers can mark a CI as disposed or delivered, they click a custom task and easily print off a receipt or disposal form for the user to sign (depending on which task they choose).

    Cheers,
    SB


    My System Center Blog
    Friday, September 24, 2010 5:50 PM

Answers

  • Hi Steve - that's right.  I had forgotten about the requirement to pass a parameter.  There are two ways to do this:

    1) Console task which passes the parameter value on the query string to the SRS web UI.

    2) Console task which passes the parameter value to the report viewer form in SCSM console.

    The first one is actually relatively simple now that I think about it.  Basically this is what you need to do:

    1) Open the SRS web UI, browse to the report and configure the parameters the way you want to have the report look and run it.

    2) In the address bar you will see a URL with the parameters in it. Copy the URL.

    3) Create a new console task in the SCSM console (Library\Tasks view).  Target whatever class is appropriate depending on where you want the task to be launched from (computer, incident, etc.).  When you configure the command line do something like this:

    c:\Program Files\Internet Explorer\iexplore.exe "bla bla bla URL".  Then replace the value that you want to pass by clicking on the Insert button and picking the property of the class that you want to pass.

     

    I hope that makes sense.  The second option above is also possible but that's what I was referring to when I said it would require some research.


    Travis Wright Senior Program Manager Microsoft
    Friday, February 4, 2011 5:47 PM

All replies

  • Yes, this is possible. It's going to take a little bit of research to see how we do this.  I'll post back here as soon as I have some time to look at it.
    Travis Wright Senior Program Manager Lead Microsoft
    Thursday, September 30, 2010 1:59 PM
  • Did you ever get time to look at this Travis?
    My System Center Blog
    Tuesday, December 21, 2010 10:39 AM
  • Hi Steve - sorry I havent had a chance.  Keep bugging me though! :)
    Travis Wright Senior Program Manager Microsoft
    Tuesday, December 21, 2010 2:59 PM
  • Oh I'm so the wrong person to say that to as I'm annoying at the best of times ;)
    My System Center Blog
    Tuesday, December 21, 2010 3:02 PM
  • Hi! I stumbled upon this idea for a solution for the printing as well.

    Have you looked at this Travis?

    Tuesday, February 1, 2011 1:56 PM
  • Sorry Joel/Steve - not yet.
    Travis Wright Senior Program Manager Microsoft
    Tuesday, February 1, 2011 2:05 PM
  • Have you thought about scheduling this in SQL SRS and posting the report to a file share, then use opalis or a simple vbs print to pick this up and sned to the printer....
    Thursday, February 3, 2011 9:03 PM
  • Good idea.  You coudl even just have a console task that opens the file off the file share.  .pdf, .xlsx, etc
    Travis Wright Senior Program Manager Microsoft
    Thursday, February 3, 2011 10:36 PM
  • Hi Guys,

    Sorry to unpropose your answer, but my first question had a specific requirement, it has to pass a variable across to the report based on the CI that is selected, so pre-staging the report isn't an option.

    I've written a report to replace our manual receipt forms and this works fine if the analyst goes into the reports section, opens the report folder, opens the report, types in the asset tag of the equipment and runs the report.

    What I'd like to do to make it much simpler, is let the analyst have the CI highlighted or opened in it's form, click a custom task that then passes a variable (either custom property such as asset tag or principal name in the case of computers for example) to a report on the SRS and have it either display the report, or even better print it straight away.

    The end solution is to go totally paper less, but that's a whole different ball game getting to that point.

    Cheers,
    SB


    My System Center Blog
    Friday, February 4, 2011 7:13 AM
  • Hi Steve - that's right.  I had forgotten about the requirement to pass a parameter.  There are two ways to do this:

    1) Console task which passes the parameter value on the query string to the SRS web UI.

    2) Console task which passes the parameter value to the report viewer form in SCSM console.

    The first one is actually relatively simple now that I think about it.  Basically this is what you need to do:

    1) Open the SRS web UI, browse to the report and configure the parameters the way you want to have the report look and run it.

    2) In the address bar you will see a URL with the parameters in it. Copy the URL.

    3) Create a new console task in the SCSM console (Library\Tasks view).  Target whatever class is appropriate depending on where you want the task to be launched from (computer, incident, etc.).  When you configure the command line do something like this:

    c:\Program Files\Internet Explorer\iexplore.exe "bla bla bla URL".  Then replace the value that you want to pass by clicking on the Insert button and picking the property of the class that you want to pass.

     

    I hope that makes sense.  The second option above is also possible but that's what I was referring to when I said it would require some research.


    Travis Wright Senior Program Manager Microsoft
    Friday, February 4, 2011 5:47 PM
  • That's what i meant :-)

    Nice....

    Friday, February 4, 2011 6:00 PM
  • Your idea got me on the right track! :)
    Travis Wright Senior Program Manager Microsoft
    Friday, February 4, 2011 6:03 PM
  • only joking :-)
    Friday, February 4, 2011 6:13 PM
  • Thanks Guys,

    I haven't tried it yet, but I'll give it a blast this next week or so hopefully.

    One problem I might bump into though is with the URL used in SRS 2008.

    I did look at spawning an IE window to the report briefly a couple of weeks back and I seem to remember the URL was almost random looking.

    I'll take another look soon and come back to you :)

    Cheers,
    SB


    My System Center Blog
    Sunday, February 6, 2011 2:00 AM
  • I really like the idea of this but when I was creating the report I needed I noticed that it does not update as soon as the incident is updated, it usually takes at least 30 minutes (but can take up to 2 hours) for the information to filter through to the reports.

    We wanted to use this for engineers to take out on the road with them as the print task does not provide the information in a suitable format (address etc). But we need the information on the report to be the same as the information on the incident as quickly as possible as incidents are very often updated just before the engineers leave for the day. On our current system just before they leave they hit print and have the most recent information available to them.

    I was wondering whether I could use powershell to pull the information from the incident and somehow feed it into a word document or something similar for printing. But i'm new to powershell and don't really know where to start with it all!

    Any suggestions?

    Thanks

    Thursday, February 16, 2012 12:04 PM
  • This is due to the reporting being done from the Datawarehouse, which will always be behind the operational database used by the console.

    You could use powershell to pull the information straight from the incident, format it and squit it out to a printer or an XPS document or something.

    Or you could look at writing a SQL query/report to pull the Incident information straight from the Operational DB and use the method above to run the report and quick print it.

    I blogged a while ago (naughty me for not posting it back here earlier) on how to put the suggestion Travis gave in this thread into action: http://systemscentre.blogspot.com/2011/03/service-manager-custom-task-to-launch.html

    You could modify that example to pass the Incident ID across to a custom report based off the Operational DB as the data source.

    Cheers,
    SB


    My System Center Blog

    Thursday, February 16, 2012 12:17 PM