Page 1 of 2

Manipulating "Sales Order Print Report" Dialog

PostPosted: Mon Sep 21, 2015 2:14 pm
by marcosomizu
Hi,

When I click on "Print" button in Sales Ordem Form, opens a "Sales Order Print Report", where I can select which Report I want to print, Report Type and so on.

I want to manipulate one of the components of this PrintReportSelection form (actually, I just want to disable the "Print to Screen" checkbox, so the user can change this option on this dialog). How do I do this?

Cheers,
Marcos Omizu

Re: Manipulating "Sales Order Print Report" Dialog

PostPosted: Thu Sep 24, 2015 12:21 pm
by marcosomizu
Any ideas?

Re: Manipulating "Sales Order Print Report" Dialog

PostPosted: Tue Oct 20, 2015 2:33 pm
by Scott.Pearce
marcosomizu wrote:actually, I just want to disable the "Print to Screen" checkbox


I thought this checkbox was always disabled already. Are you saying the checkbox is enabled for you?

Re: Manipulating "Sales Order Print Report" Dialog

PostPosted: Wed Oct 21, 2015 12:29 pm
by marcosomizu
Sorry Scott, I wrote it wrong.

Yes, it is always disabled, but I want to enable it under one condition. Is that possible?

Re: Manipulating "Sales Order Print Report" Dialog

PostPosted: Thu Oct 22, 2015 8:55 am
by Scott.Pearce
You could enable it, but it won't do anything without further work.

The Print To Screen checkbox is simply a read-only indicator as to whether the user is configured to print to screen or direct to printer. The setting that this checkbox indicates can be found at System -> Staff Configuration -> Staff Maintenance, on the User Settings tab, Invoicing section. In code, the setting is at SalesOrder.SystemSettings.PrintToScreen.

So, you could enable the checkbox, but you would also have to add a handler for CheckedChanged.

Before I start getting down-and-dirty with code, can you tell me which version of Jiwa you would be doing this for? (C# plugin support was only added in later versions, before that only VB .Net was possible).

Re: Manipulating "Sales Order Print Report" Dialog

PostPosted: Fri Oct 23, 2015 4:04 pm
by indikad
I have a similar question if someone can get me some help please?

in 6513 i have a code in SalesOrder FormPrintBefore tye follwoing code
Code: Select all
rtnPrintToScreen = false

this makes the print to screen checkBox unticked when the print window pops up for the first time.

However I cannot get this happening "properly" ( using the code below)
Code: Select all
salesOrder.SystemSettings.PrintToScreen  = False


The change displays only after the print window opens once and closed by hitting ok. ( only subsequent opens will have the change )
I need this to happen before this first time and obviously the event i am using is wrong.
what is the event I should use ?

Re: Manipulating "Sales Order Print Report" Dialog

PostPosted: Fri Oct 23, 2015 4:08 pm
by Scott.Pearce
Which event are you currently using?

Re: Manipulating "Sales Order Print Report" Dialog

PostPosted: Wed Oct 28, 2015 2:50 pm
by marcosomizu
Hi Scott,

The idea is to enable the checkbox so the user can have the choice to Print to Screen (or not) in this form (without having to need to go to Staff Configuration).

For example:

[While in Sales Order Print Report Form]
Is the "Print to Screen" checkbox checked? Then set the Staff Configuration property to True and print to screen. Otherwise, set the Staff Configuration property to False and print directly to the printer.

My JIWA's version is 7.0.129, and the code that I am using is VB.net

Re: Manipulating "Sales Order Print Report" Dialog

PostPosted: Fri Oct 30, 2015 1:58 pm
by indikad
Scott.Pearce wrote:Which event are you currently using?


i am using
Code: Select all
SalesOrdForm.SalesOrder.Printing

event

Re: Manipulating "Sales Order Print Report" Dialog

PostPosted: Fri Nov 13, 2015 4:04 pm
by Scott.Pearce
I've put together a plugin that allows the check-box to control the user's setting. I've also had to work around a little bug whereby the dialog was not keeping a local variable of who called it (which we need to know to preserve the print to screen setting).

I wrote it in 7.0.142.0 but tested it in 7.0.129.0.

You blokes owe me a beer.