Hello Folks!!,
I'm trying to export a quotation through COM connector, this is the code in
Microsoft Dynamics AX 4.0:
RecordSortedList journalListLocal;
Args argsLocal;
ReportRun salesQuotationReport;
CustQuotationJour custQuotationJourLocal;
SalesQuotationTableType_Sales salesQuotationTableSales;
PrintJobSettings printJobSettings;
PrintCopyOriginal printCopyOriginalLocal;
str sFilePath;
RunAsPermission runAsPermission;
boolean fileExists;
;
if(quotationId_in)
{
journalListLocal = new RecordSortedList(TableNum(CustQuotationJour));
journalListLocal.sortOrder(FieldNum(CustQuotationJour,RecId));
salesQuotationTableSales =
SalesQuotationTableType_Sales::construct(SalesQuotationTable::find(quotationId_in));
journalListLocal.ins(CustQuotationJour::findFromQuotationDocNum_gvs(salesQuotationTableSales.lastQuotation()));
if(journalListLocal.len())
{
sFilePath = "C:\\temp\\" + quotationId_in +".pdf";
fileExists = WinApi::fileExists(sFilePath);
if(fileExists)
WinApi::deleteFile(sFilePath);
salesQuotationReport = new ReportRun(new
Args(ReportStr(SalesQuotation)));
salesQuotationReport.args().caller(this);
salesQuotationReport.args().parmEnumType(printCopyOriginalLocal);
salesQuotationReport.args().parmEnum(PrintCopyOriginal::Original);
salesQuotationReport.args().parm("Customer");
salesQuotationReport.args().object(journalListLocal);
salesQuotationReport.design("Quotation");
salesQuotationReport.printJobSettings().setTarget(PrintMedium::File);
salesQuotationReport.printJobSettings().preferredTarget(PrintMedium::File);
salesQuotationReport.printJobSettings().format(PrintFormat::PDF);
salesQuotationReport.printJobSettings().preferredFileFormat(PrintFormat::PDF_EMBED_FONTS);
salesQuotationReport.printJobSettings().fileName(sFilePath);
salesQuotationReport.run();
}
}
return(sFilePath);
When I execute this code from Dynamics it works, but Whe I execute this code
from COM connector it works also but the pdf exported is empty.
Somebody know if is possible execute a report from COM connector without
issues?.
It appear as if the axapta client will be necessary to execute the PDF classes
Thanks in advance!!
________________________________
Limitación de responsabilidad / Disclaimer
Este mail y su contenido son confidenciales y exclusivos para su destinatario.
Si usted no es el interesado o el agente responsable para la entrega del
mensaje al interesado, queda notificado por la presente, que cualquier
revelación, distribución o copia de este contenido está absolutamente
prohibido. Si usted ha recibido este mensaje por error, notifique al remitente,
respondiendo a este mensaje y después eliminelo de su sistema.
This e-mail and any attachments is a confidential correspondence intended only
for use of the individual or entity named above. If you are not the intended
recipient or the agent responsible for delivering the message to the intended
recipient, you are hereby notified that any disclosure, distribution or copying
of this communication is strictly prohibited. If you have received this
communication in error, please notify the sender by replying this message, and
then delete this message from your system.
[Non-text portions of this message have been removed]