Below are the steps so far i tried to achieve this .
Created a table with two fields. User and Options(Container field).
When the user hits Options button,
select User from TableA
where TableA.User == XUserInfo::find(false, curuserid()).Name;
if(TableA.Options)
{
printJobSettings = new PrintJobSettings(TableA.Options);
printJobSettings.printerSettings(formstr(SysPrintForm));
TableA.Options = printJobSettings.packPrintJobSettings();
select forupdate label where TableA.User == XUserInfo::find(false, curuserid()).Name;
TableA.Options= printJobSettings.packPrintJobSettings();
ttsbegin;
TableA.update();
ttscommit;
}
else
{
printJobSettings = new PrintJobSettings(TableA.Options);
printJobSettings.printerSettings(formstr(SysPrintForm));
TableA.Options = printJobSettings.packPrintJobSettings();
TableA.User = XUserInfo::find(false, curuserid()).Name;
TableA.insert();
}
While debugging i can see the printer is saved in the Options field.
But, it is not storing this record.
If it stores, then, in the report init() method, i can select printer from this table
and pack it to send it to the printer.
I might be completely wrong.
But please advice alternate solution or solution to my above method.