Langsung ke konten utama

Postingan

Menampilkan postingan dari 2016

Create PDF from SSRS Form

Hi, i want to share code to create and save from SSRS Report I created a new Button, so after user selects data and clicks the button, system creates a PDF file and saves it to the destination folder. public static void main(Args _args) {     PurchTable                      purchTable,purchTable2, row;     PurchPurchaseOrderContract      purchPurchaseOrderContract;     VendPurchOrderJour              vendPurchOrderJour;     FormDataSource                  purchTable_ds;     SRSPrintDestinationSettings     settings;     SrsReportRunController          controller ;     str                             folderPath;     dialog                          d;     DialogField                     dialogFilename;     str                             PDFName, FilePath;     int                             tot = 0;     Args                            args;     ReportName                      reportName = "PurchPurchaseOrder.Report";     PurchTable              

Add an Image/Icon to an Action Pane Button [AX 2012]

Let start with the result. Below is a screenshot of Super Mario replacing the Customer icon. This is becoming a common question with AX 2012 using Action panes and all the buttons having images associated to them. It definitely adds to the usability. Follow the below steps and you’ll be alright. Get your icon file You can purchase your icon file on line or create them. To create them, create a png file with transparent background. Use either Photoshop or equivalent Gimp (free). Just Google on how to make an image transparent (I am very inexperienced and I got by – most people should be fine). Then go to  http://www.convertico.com/  and load up your png to convert to an ico file. From here on it is all standard AX. To add an image resource to the AOT In the AOT, right-click  Resources , and then click  Create from File . The  Select file  window opens. Navigate to the location of the image file that you want to use for a button. Click the file, and then click  Open

Save SSRS report to pdf that uses Controller classes [Dynamics AX 2012]

Friends, This is the most commonly asked requirement of saving the report to pdf and send it to through email. We all know that SRSReportRun class is helpful in combination with printDestinationsettings to save to pdf file. But tricky requirements are those which uses controller classes for the report. Below is the small snippet which will help to save the sales invoice report to pdf that actually uses controller classes. static   void  SR_SaveReportToPDFFromController(Args _args) {     SalesInvoiceController  salesInvoiceController;     SalesInvoiceContract    salesInvoiceContract;     Args                    args =  new  Args();     SrsReportRunImpl        srsReportRun;     CustInvoiceJour         custInvoiceJour;     ReportName              reportName =  "SalesInvoice.Report" ;     ;      select   firstOnly  custInvoiceJour;     args.record(custInvoiceJour);         salesInvoiceController =  new  SalesInvoiceController();     salesInv

Unable to construct an object from the class in the batch framework - AX

Error :  " Unable to construct an object from the class Sample Class in the batch framework. Make sure that the X++ code has been compiled to Microsoft .NET Framework CIL, and that the constructor does not require any parameters " Solution : It is going to take about 2-3 minutes (it depends from environment to environment). Then, to double check if the job run well, go to System Administration > Inquiries > Batch Jobs and look for your job. It status should now be Ended. Enjoy

Joins in X++ into T-SQL

1.  join  in X++: select AccountNum from custTable join TaxGroupId from custGroup where custGroup.CustGroup == custTable.CustGroup; CROSS JOIN  in T-SQL: SELECT T1.ACCOUNTNUM , T1.RECID , T2.TAXGROUPID , T2.RECID FROM CUSTTABLE T1 CROSS JOIN CUSTGROUP T2 WHERE (( T1.PARTITION =?) AND ( T1.DATAAREAID =?)) AND ((( T2.PARTITION =?) AND ( T2.DATAAREAID =?)) AND ( T2.CUSTGROUP = T1.CUSTGROUP )) 2.  outer join  in X++: select AccountNum from custTable outer join AccountID from custBankAccount where custBankAccount.CustAccount == custTable.AccountNum; LEFT OUTER JOIN  in T-SQL: SELECT T1.ACCOUNTNUM , T1.RECID , T2.ACCOUNTID , T2.RECID FROM CUSTTABLE T1 LEFT OUTER JOIN CUSTBANKACCOUNT T2 ON ((( T2.PARTITION =?) AND ( T2.DATAAREAID =?)) AND ( T1.ACCOUNTNUM = T2.CUSTACCOUNT )) WHERE (( T1.PARTITION =?) AND ( T1.DATAAREAID =?)) 3.  exists join  in X++: select AccountNum from custBankAccount exists join custTable where

AbyssRium’s Hidden Fish

AbyssRium’s Hidden Fish Blue Clownfish: Take a picture of Clownfish 3 times Pictures of Red Clownfish didn’t work for me, only Percula (orange) Clownfish Snowflake Clownfish: Push Twitter button 5 times in Settings It’s a good idea to unlock these two immediately so you don’t end up with 4 Orange/Red clownfish like me Randall’s Goby: Take 3 pictures of Goby Spotted Mandarin Dragonet: Start AbyssRium upon notification (random chance) To get this, make sure “Notice” is on in AbyssRium’s settings, and also make sure your device is allowing AbyssRium to send notifications. You can enable/disable this in Notifications settings in iOS or Google Play Games’ settings for the app on Android. Clown Tang: Take a picture of Tang 5 times Convict Tang: Do nothing for 1 hour You must leave the game open, which means you’ll want the game in Battery Saver mode and on a charger because abyssrium is crazy battery hungry. Naso Tang Obtain 50 Tangs Obviously, you’re going t

Different Joins in AX 2012

First Table Second Table There is a normal relation between these tables as follows… I created form with two datasources in it. A) Inner Join between these tables. As you can see, firsttable has one more record which is not shown as there is no linked record exist in secondtable because of inner join. B) Outer join between these tables. As you can see, firsttable has one more record which is shown because of outerjoin. C) Exist Join between these tables. As you can see, only fields from first table will be shown which are matched. D) Not Exist Join between these tables. As you can see, only fields from first table will be shown which are not matched. Happy DaXing……….

QBDS Query Range

Range for string QueryBuildDataSource qbds; queryBuildRange qbr; ; qbds = this.query().dataSourceTable(tablenum(SalesQuotationTable)); qbds.clearRanges(); qbdr = qbds.addRange(fieldnum(SalesLine, PlanModelId)); //STRING qbds.addRange(fieldnum(SalesLine, PlanModelId)).value(SysQuery::valueEmptyString()); // = value('=""'); qbds.addRange(fieldnum(SalesLine, PlanModelId)).value('!=""'); qbds.addRange(fieldnum(SalesLine, PlanModelId)).value('1'); qbds.addRange(fieldnum(SalesLine, PlanModelId)).value(queryValue('!=' + planModel.PlanModelId)); queryBuildRange = queryBuildDataSource.addRange(fieldnum(WMSLocation, SPLCustAccount)); queryBuildRange.value('=""'); -> SPLCUSTAccount='' -> ((SPLCUSTAccount='')) queryBuildRange.value(SysQuery::valueEmptyString()); -> SPLCUSTAccount='' -> ((SPLCUSTAccount='')) queryBuildRange.value(queryValue('')); -> SPLCUSTAcco