Home > Dynamics Ax 2012, SSRS > Save The SRS Printer Settings in Table and Re-Use

Save The SRS Printer Settings in Table and Re-Use


In this article,

1)      We can store the printer settings of a report in the table, like in parameters table as a container type field. (Section –I)

2)      While printing the reports, we will read the settings from the parameter table and we will apply the same for report printing.  (Section – II)

static void myPrinterSettingsReport(Args _args)

{

SrsPrintDestinationSettings printSettings;

FormRun                     printSettingForm;

boolean                     ok = true;

Args                        args = new Args();

container                   myPrint;

SrsReportRun                        reportRun;

SRSPrintDestinationSettings srsPrintSettings;

//Section – I

//This we can implement on the parameters form by adding button and define this in click event

printSettings = new SrsPrintDestinationSettings();

args.caller(printSettings);

//calling printersettings form

args.name(formstr(SRSPrintDestinationSettingsForm));

printSettingForm = classfactory.formRunClass(args);

printSettingForm.init();

printSettingForm.run();

printSettingForm.wait(true);

ok = printSettingForm.closedOk();

if (ok)

{

//Retrieving printer settings to a container and this container we can store in to a table

myPrint = printSettings.pack();

}

//Section –II

reportRun = new SRSReportRun();

reportRun.reportName(“Vend.Report”);

// Set printersettings

srsPrintSettings = reportRun.printDestinationSettings();

// while generating the report we can read the printersettings from table (container field value) and pass to the following method.

srsPrintSettings.unpack(myPrint);

reportRun.showDialog(false);

reportRun.init();

reportRun.savePrinterSettings(false);

reportRun.saveReportParameters(false);

reportRun.saveReportQueries(false);

reportRun.run();

}

Advertisements
Categories: Dynamics Ax 2012, SSRS
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: