SSRS 2017 Determine if a report was Printed or Previewed

  • I have created a Packing Slip report in SSRS 2014 that looks at the history of orders already printed
    and does not allow ( without overriding ) the same order packing slip to be printed again.

    The Packing Slip is also a PICK LIST for the warehouse / shippers.

    I currently can look at the execution log Storage and parse the Parameters for the Order Id's that were printed. 
    I know the it has PRINTED if the Format is IMAGE.

    In the new Version of SSRS, everything is pre-rendered as PDF.  How do I KNOW the user Printed or Previewed the report?


    CREATE view [dbo].[get_previously_printed_view] as

    select

    top 100 percent

    reportid 

    ,left(right(cast(Parameters as varchar(max)),-9+len(cast(Parameters as varchar(max)))-PATINDEX('%&BatchNum=%',cast(Parameters as varchar(max)))),15) as batch

    ,''''+replace(right(cast(Parameters as varchar(max)),/*-64+*/len(cast(Parameters as varchar(max)))-PATINDEX('%&BatchNum=%',cast(Parameters as varchar(max)))),'&OrderNum=',''',''')+'''' as params

    FROM [ReportServer].[dbo].[ExecutionLogStorage] where Parameters like '%OrderNum=%' and format='image' --and Parameters like '%BatchNum=%' --ReportID='87C6C0BC-7E6D-4800-8E93-06BF9D280937'

    order by timeend desc;

  • I would never rely on knowing that an SSRS report has been printed for this kind of functionality.  The only good way is to have a table that has a column that can represent whether or not that row has been dealt with in a certain way.  Whatever application you use should be maintaining this kind of data.   You can always print an SSRS report under the control of such an application.  However, that doesn't mean someone might not be able to print the same list twice - after all, printers are not necessarily reliable devices, so they can be out of paper or even offline.   Then someone re-boots the print server, and/or  the print job is lost for whatever reason, and one actually needs to print something a second time, because the first one came out all smudged, or whatever.   You can't account for everything.  But you can assign accountability in your data to specific people.   Holding them accountable is another story.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply