Skip to main content

Posts

You can use the following code in order to achieve the requirement.

You can use the following code in order to achieve the requirement.You need to write it in the fetch method- str todayDate; ; element.printJobSettings().SetTarget(PrintMedium::File); element.printJobSettings().format(printFormat::PDF); todaydate = Date2str(SystemDateGet(),213,2,0,2,0,2); element.printJobSettings().FileName(strfmt('c:\\Report%1.pdf',todaydate));

Set report ranges using code..?

I'm calling report using output menuItem from specified form. what i really want is to set the report Ranges by the caller record from the form so the following is the situation: 1. Output meneItem on the form. 2. On the init() method in the report the following tableBuffer = element.args().record(); 3. The required now is to set the report query (Ranges) by using one of the TableBuff fields. I see what you are saying. Basically, if you start from a menu item with NO record, you want to basically NOT use what is stored in usage data. At that point, couldn't you do something like this: public void init() { CustTable ct; ; super(); if (element.args().record()) { this.query().dataSourceTable(TableNum(CustTable)).addRange(FieldNum(CustTable,Name)).value(ct.Name); } else { this.query().datasourceTable(TableNum(CustTable)).addRange(FieldNum(CustTable,Name)).value(""); } } Granted, the range value would hav to make sense based on the field...

Send a report, but change the filename according to caller

My customers has grown tired by the filename 'Axapta report' in class Info -> method reportsend(). I need to change the filename to the name of the caller. But how do I find the caller in class Info -> Method reportsend() ? Let's see if it works this time.... (it's only the SIXTH time that I try to post this answer :( ) There seems to be no way to get a reference to the ReportRun object; the method PrintJobSettings.ReportRun always seems to return null in reportSendMail. You could set a property of PrintJobSettings in your report and use that to fill the filename. Another possible solution (no guarantees) is the following: Add the following to infolog.reportSendMail: if (globalCache.isSet(curuserid(),classidget(p1))) { fileName = globalCache.get(curuserid(),classidget(p1)); globalCache.remove(curuserid(),classidget(p1)); } And to the method SysReportRun.print add the next code (before calling super). SysGlobalCache ...

Dynamics AX in the Field

Have you installed one of the new Report Builders-- version 2 or version 3-- and can't get AX to launch it? This posting addresses the issue and walks you through the steps to point AX to the new version. The first step is that you will need to get Report Builder 2.0 or 3.0 installed on your report server. You should be able to access the Report Builder through the Internet Explorer first. In addition, you should already be able to access Report Builder 1.0 from AX. If you don't have this working you will need to revisit the installation guides. Once you have Report Builder 1.0 working through AX and the newer version of Report Builder working outside of AX than you can make the following changes. Try this in a Test Environment prior to performing this on a production environment and as always make sure you have good backups. Get into Dynamics AX and access the AOT. 1) Locate the SRSConfiguration class (Classes >>SRSConfiguration). 2) Edit the getReportBuilderU...

transfer Images to Word from AX

I need to transfer the employee`s image to an automatic generated word document. It is possible to transfer Text to COM word object with [bookmark, bookmarkValue] = ['EmplTable_FullName', LtabDirParty.Name]; if (this.gotoBookmark(bookmark)) this.insertValue(bookmarkValue, 0); whereby Textmarker within Word = EmplTable_FullName Method gotoBookmark() COMrange = COMdocument.goTo(#wdGotoBoomark,COMArgument::NoValue,COMArgument::NoValue,bookmark); Method inertValue() COMrange.insertAfter(value); Does anybody know how to transfer the Empl-Image (as an image) from AX to word? binData.setData( CompanyImage::find(LtabEmpl.dataareaId, LtabEmpl.TableId, LtabEmpl.RecId).Image; binData.base64Encode() transfers a binary string which will be displayed as a binary text. But how can I display the image as real Image? The idea was the right one. In my case I wanted to move the image to word without having the image stored to the filesystem. Herefore I had to use...

Populating a form Grid through a Temp table using a query

Hello All, I'm working in AX 2009. I have a form with a grid control, which I am trying to populate by using a Temporary table and an X++ query. The query is joining 4-tables, i.e., CustInvoiceTrans, CustInvoiceJour, InventDim, and CustTable. The only range is on CustInvoiceTrans, InvoiceDate. I have set "Relations" to true for each, as CustInvoiceTrans.InvoiceId == CustInvoiceJour.InvoiceId and CustInvoiceTrans.InventDimId == InventDim.InventDimId and CustInvoiceJour.OrderAccount == CustTable.AccountNum. The fields on the grid are from the temp table, which I dragged to the form's grid. I have used a temp table before with success, but I am unable to get my grid to populate with data, although by placing a breakpoint in code and stepping thru the debugger I have been able to see data. I have 3-methods in my project, the classDeclaration, the init, and a method named populateRecords, where I define the query class objects. The following is my code...