Last Event During Print Preview

Anyone know what is the last form event that takes place during a print preview?. We need to hang off this event and action custom code.

Essentially using code within the form I need to inspect the final dataset (after any filters have been applied by the user) that is submitted to the agent for printing. This dataset should contain all the data I need to action my custom code.

Thank you in advance

What is your custom code trying to do?

Does it need to change the data being used to print? As in does it need to fire and complete before previewing? Or can it function concurrently (like updating a UD field to mark that it has been previewed)?

What you’r probably looking for is:

	private void SalesOrderForm_BeforeToolClick(object sender, Ice.Lib.Framework.BeforeToolClickEventArgs args){
		System.Windows.Forms.MessageBox.Show("The Tool with key '" + args.Tool.Key + "' has been clicked.  It is of type: '" + args.Tool.GetType().ToString() + "'");
		}

EDIT

corrected sample function.

Note that this fires in the form that you’d select print from. To only capture Previews, you’d need to do it in the associated Print form

Thanks ckrusen, I ended up using AfterToolClick which worked well.