Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

Finding out which records were actually printed

$
0
0

Hi All,

 

I need to find out which records were ACTUALLY printed when a user prints a range of pages to the printer.

 

Here's a simple example:-

 

I have a report which runs from a table (SQL) - say Id, Name, Address & Postcode - the selection is for those that haven't yet been printed.

The report is run (using the Crystal Reports Viewer).

The user clicks the Print button - but only chooses to print Page 2 (of the 10 page report).

I need to know the Ids of those records that were actually printed on Page 2 (because I then need to update the fact that they were printed so they don't appear the next time I run the report).  Please note that the addresses are multiple lines (Can Grow) so I can't work out how many there are per page!

 

This is an overly-simplified version of what I'm trying to achieve but hopefully does illustrate my point!

 

I have already implemented my own Print button (by removing the Handlers for the Crystal Reports Print button on the toolbar and adding my own handler).

 

I have already considered a few ways of achieving this but haven't been able to get any of them to work!

 

1) Using an SQL Expression to launch a Stored Procedure which updates a flag in the record (on the detail line) - haven't really got past square one on this!).

 

2) Populating a Shared/Global variable (containing the relevant Ids) within the report and attempting to access this variable after the report has been printed (Report.PrintToPrinter) - but I'm struggling to access that variable (not sure if it can even be done!) - and anyway - I think it'll include ALL the Ids - not just the ones that were physically printed!).

 

Any help would be gratefully received!

 

John

Crystal Reports (for Visual Studio 2015) and VB.NET (or even C#.NET!)


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>