What I’ve done:

  1. Created a small process with an escalation on one of the activities to fire after 1 minute
  2. In the escalation I send an email, but I attach a report in PDF format from a SmartObject (pointing to a SSRS report)
  3. The report gets executed on the escalation and is then attached in the escalation email

How to:

  1. Create the report you want using the K2 Workspace Report Designer
    1. image001
  2. Build your report in the report builder (or if you have an SSRS report, you can import it for use) – I created a new report
    1. Image002
    2. My data source was info I already had available in SQL
  3. Once you’ve built your report, Publish it
    1. image003
  4.  I created a SQL Reporting Services Service in my environment (if it doesn’t exists already)
    1. image004
    2. image005
    3. image006
    4. Your environment may have a different SQL server version (I just used what I had on my VM)
    5. image007
  5. Now you need to create a SmartObject to reference the report you’ve built
    1. image008
    2. Give it a name, category and make sure it’s “advanced”
    3. image009
    4.  Your report should be visible under the SQL Reporting Service list in the designer
    5. image010
    6. Drag & Drop this onto the SmartObject Designer canvas (right hand side)
    7. Select “Create All” for the property mappings (report file) to bind everything
    8. image011
    9. You should now have a SmartObject with 1 Property (Report File) and a couple of methods
    10. image012
  6. I built a small workflow that does nothing, just to test
    1. image013
    2. Add your Escalation (advanced mode)
    3. image014
    4. Basic escalation settings (when, etc.) and then I fire an email
    5. image015
    6.  Standard stuff for email send
    7. image016
    8. image017
    9. Now add the attachment – THE IMPORTANT bit! 🙂
    10. Using an inline function to get the attachment and adding it to the email
      1. Drag & drop the Files – Get File from Content (…) function on the attachment field
      2. image018
      3. Drag & Drop your SMO “Export to PDF” item on the “Content” section
      4. Give the attachment that will be generated a name – I used “MyEscalationReport.pdf”
      5. image019
      6. No input mapping required for my demo report
      7. image020
      8. Select “Report File.Content” as the return property for the wizard
      9. image021
      10. You should end up with an attachment which states “Get File From Content (…..)
      11. image022
      12. Finish all the events and wizards.
  7. Deploy your workflow with the updated escalation info
  8. Test!
    1. image023
    2. image024

This is one way of utilising K2 SmartObjects and SSRS together.

Have fun !

Advertisements