Показать сообщение отдельно
Старый 18.03.2008, 03:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,492 / 846 (79) +++++++
Регистрация: 28.10.2006
C# and AX Development: Printing directly to PDF in AX
Источник: http://olondono.blogspot.com/2008/03...ly-to-pdf.html
==============

References: AxaptaPedia

To achieve this task, we need to set some values to the printing settings before running the report like this:
X++:
// Variables
PrintJobSettings    printJobSettings;
ReportRun           myReportRun;

...


// Getting the report settings
printJobSettings = myReportRun.printJobSettings();

// Setting our parameters
printJobSettings.setTarget(PrintMedium::File);
printJobSettings.preferredTarget(PrintMedium::File);

printJobSettings.format(PrintFormat::PDF);
printJobSettings.preferredFileFormat(PrintFormat::PDF);

printJobSettings.fileName("c:\\attachment.pdf");

// Saving values
myReportRun.unpackPrintJobSettings(printJobSettings.packPrintJobSettings());

// Running the report
myReportRun.run();
Before running the report, we can set query's values:

X++:
query = myReportRun.query();
qbds = query.dataSourceNo(1);

qbds.range(1).value(_custTable.CustAccount);
qbds.range(2).value("");
qbds.range(3).value(queryvalue(NoYes::Yes));

myReportRun.run();
NOTE: For using a PDF Printer like "PDFCreator", simply set the deviceName like this:

X++:
myReportRun.deviceName("PDFCreator");
Источник: http://olondono.blogspot.com/2008/03...ly-to-pdf.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.