Manipulating Print Dialog box  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Manipulating Print Dialog box

Postby Ernst » Wed Jul 08, 2020 12:04 pm

CapturePrintDialog.JPG
CapturePrintDialog.JPG (29.99 KiB) Viewed 531 times


Enable Print To Screen Option When Printing a Sales Order, is a great plugin.

Is there a way it could be enhanced, so the Print Type defaults to "Report Type" rather than Single report, while keeping the focus on the OK button?

Cannot see if thats even possible?

Thx for help.
User avatar
Ernst
Kohai
Kohai
 
Posts: 216
Joined: Tue Feb 19, 2008 3:43 pm
Topics Solved: 12

Re: Manipulating Print Dialog box  Topic is solved

Postby SBarnes » Wed Jul 08, 2020 3:19 pm

Hi Ernst

The dialog is created by the Dialog factory such as

Code: Select all
          PrintReportSelection selection = Manager.Instance.DialogFactory.CreateDialog<PrintReportSelection>(startParameters, salesform, "Sales Order Entry");


And the dialog factory has an after dialog start event which you should be able to attach to in an application plugin.

I am pretty sure you are then after


Code: Select all
         selection.ReportTypeRadioButton
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Manipulating Print Dialog box

Postby Ernst » Wed Jul 08, 2020 4:35 pm

Thanks, found that spot. tried bold below. But not sure how to switch off the one button, and switch the bottom one on..;)

public void SalesOrderForm_AfterDialogStart(JiwaFinancials.Jiwa.JiwaApplication.IJiwaDialog JiwaDialog)
{
if(JiwaDialog is JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.PrintReportSelection)
{
JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.PrintReportSelection printReportSelectionDialog = (JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.PrintReportSelection)JiwaDialog;
printReportSelectionDialog.Manager.MakeReadOnly(printReportSelectionDialog.PrintToScreenCheckBox, false);
printReportSelectionDialog.Manager.MakeReadOnly(printReportSelectionDialog.OverrideNumberCopiesCheckBox, true);
printReportSelectionDialog.FormClosing += printReportSelectionDialog_FormClosing;
printReportSelectionDialog.PrintToScreenCheckBox.CheckedChanged += PrintToScreenCheckBox_CheckedChanged;
printReportSelectionDialog.ReportTypeRadioButton.TabIndex =1;
}

}
User avatar
Ernst
Kohai
Kohai
 
Posts: 216
Joined: Tue Feb 19, 2008 3:43 pm
Topics Solved: 12

Re: Manipulating Print Dialog box

Postby SBarnes » Wed Jul 08, 2020 5:20 pm

Try

Code: Select all
selection.SingleReportRadioButton.Checked = true;

or
Code: Select all
selection.ReportTypeRadioButton.Checked = true;


Depending on what you want
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Manipulating Print Dialog box

Postby Ernst » Wed Jul 08, 2020 7:01 pm

That has worked perfectly.. Thx Stuart. Here is completed code...;)

public void SalesOrderForm_AfterDialogStart(JiwaFinancials.Jiwa.JiwaApplication.IJiwaDialog JiwaDialog)
{
if(JiwaDialog is JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.PrintReportSelection)
{
JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.PrintReportSelection printReportSelectionDialog = (JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.PrintReportSelection)JiwaDialog;
printReportSelectionDialog.Manager.MakeReadOnly(printReportSelectionDialog.PrintToScreenCheckBox, false);
printReportSelectionDialog.Manager.MakeReadOnly(printReportSelectionDialog.OverrideNumberCopiesCheckBox, true);
printReportSelectionDialog.FormClosing += printReportSelectionDialog_FormClosing;
printReportSelectionDialog.PrintToScreenCheckBox.CheckedChanged += PrintToScreenCheckBox_CheckedChanged;
// printReportSelectionDialog.SingleReportRadioButton.Checked = true;
printReportSelectionDialog.ReportTypeRadioButton.Checked = true;
}
User avatar
Ernst
Kohai
Kohai
 
Posts: 216
Joined: Tue Feb 19, 2008 3:43 pm
Topics Solved: 12

Re: Manipulating Print Dialog box

Postby SBarnes » Wed Jul 08, 2020 7:07 pm

Happy to help I am even impressed it's c# don't you usually prefer vb.net?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Manipulating Print Dialog box

Postby Ernst » Wed Oct 28, 2020 12:15 pm

Am definitely a VB fan. Just forced to use C#, when that the only plugin I can find..:)
You need to be an alien to read that stuff..:)
User avatar
Ernst
Kohai
Kohai
 
Posts: 216
Joined: Tue Feb 19, 2008 3:43 pm
Topics Solved: 12


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 7 guests

cron