Skip to main content

Posts

Showing posts with the label reports

Report Printing Progress Bar - SysPrintProgess

The code listed below details change to the SysReportRun class which causes the progress bar to display for reports called from menu items. This HAS NOT BEEN TESTED thoroughly, Edit: No longer overriding the send method, due to the potential to cause problems with the _newPageBeforeBody parameter. Instead, adding to the buildPrintRange method, seems to be called once per page on the reports I've tested with. ----Begin Code---- class SysReportRun extends ReportRun { ... Object ProgressForm; // Added ... } void run(boolean onlyReport = false) { ... if (runBaseReport.prompt()) { ProgressForm = this.createProgressForm(); // Added ProgressForm.init(); // Added ProgressForm.setNames(this.design().caption(), this.printerPrinterName()); // Added runBaseReport.run(); } ... } // Start - Override send method and modify as shown public boolean send(Common _cursor, int _level=1, boolean _triggerOffBody=TR...

Bir kayıt için rapor yazdırma / Call a report from a spesific record

//rapor belli bir kayıt için çağırmak istendiğinde yazılacak kod //code block to call a report from a spesific record //init içne yazılacak //embed into init section // teklif tablosunda bir kayıt için örnek //example for a quotation record { smmQuotationTable callersmmQuotationTable; QueryBuildDataSource qbds; ; sysReportRun::getRunbaseReport(this).getLast(); if (element.args().caller()) { if (! element.args().record().recId) throw error(strFmt("@SYS22338",funcName())); switch (element.args().dataset()) { case tablenum(smmQuotationTable): callersmmQuotationTable = element.args().record(); break; default: throw error(strFmt("@SYS23396",funcName())); } } if (callersmmQuotationTable.QuotationId) { qbds = element.query().dataSourceTable(tablenum(smmQuotationTable)); ...

Raporda nesne erişimi / Access to object in report

//nesnenin oto tanımlama özelliği aktive edilirse doğrudan ismini kullanarak erişilebilirsiniz. //you can access to object with its name, if you activate autodecleration property. //Oto tanımlama yapmadan bir nesnenin özellğini kullanmak için AOT yapısından faydalanılabilir. //you can access to object Without Aoutodecleration property using AOT this.design("ReportDesign1").sectionName('ReportHeader').controlName("DispField").delete(); this.design("ReportDesign1").sectionName('ReportHeader').controlName("DispField").hide();

How can I change AX_CompanyName parameter

I have a report developed in SSRS, but it's not deployed in Dynamics AX Portal. I need permit to user change Company using a parameter. How can I do that? srsReportRun.reportParameter("AX_CompanyName").value("dat");

Calling a Custom Dynamics AX 2009 SSRS report and passing parameters - From X++

In this example I have created a custom SSRS report for Dynamics AX 2009 instance. In this you will see I have a Query, that was used for my report, and also a report library I created using Visual Studio 2008 Dynamics AX 2009 Reporting template. The query, has a Range of SalesId, and in doing that, this was auto added to the report parameters, in the VS2008 projects. (see below image) This is the name of the parameter in the report def., and therefore important to note for our exercise. So the task was to take and pass values to reports from X++. I took and create a job that does exactly that. It takes and call my custom reports, output menu item, and pass it a value for the SalesId parameter. The code follows.: MenuFunction CustRptMI; Args Args; ; CustRptMI = new MenuFunction(menuItemOutputStr(srsCustomRpt),MenuItemType::Output) Args = new Args(); Args.parm("qryCustomSSRS_SalesId=*SO-100004*"); CustRptMI.run(Args); CustRptMI.wait(); Notice the name of the parameter is exact...

Passing parameter from a form to a report

I figured out a sligtly different solution that works. On the Button Clicked method: void clicked() { Args args = new args(); ReportRun reportRun; ; args.parm(SMAServiceOrderTable.ServiceOrderId); args.name(reportstr(GAB_ServiceOrder_NO)); reportRun = classFactory.reportRunClass(args); reportRun.init(); reportrun.run(); super(); } And then on the init method on the report; public void init() { ; try { if(element.args().parm()) { this.query().dataSourceTable(tablenum(SMAServiceOrderTable)) .addRange(fieldnum(SMAServiceOrderTable,ServiceOrderID)).value(element.args().parm()); this.query().userUpdate(false); this.query().interactive(false); super(); } } catch(exception::Error) { info("Error in init method"); } }

Creating a report in X++ code and running

static void MakeReportJob(Args _args) { #AOT str reportName = 'aaMakeReport'; tableid custTableId = tablenum(CustTable); TreeNode reportNode = TreeNode::findNode(#ReportsPath); Report areport; ReportDesign design; ReportAutoDesignSpecs specs; ReportSection section; ReportRun run; ; // Delete the report if it already exists areport = reportNode.AOTfindChild(reportName); if (areport) areport.AOTdelete(); // Build the report areport = reportNode.AOTadd(reportName); areport.query().addDataSource(custTableId); design = areport.addDesign('Design'); specs = design.autoDesignSpecs(); section = specs.addSection(ReportBlockType::Body, custTableId); section.addControl(custTableId, fieldnum(CustTable, AccountNum)); section.addControl(custTableId, fieldnum(CustTable, Name)); // Now the report will not prompt for user input areport.interactive(false); areport.query().interactive...

Inventory Turns Report

static void InventoryTurns(Args _args) { itemId itemId; inventTrans inventTrans; inventSum inventSum; qty thisQty, qtyOnHand, totalDailyQtyOnHand, avgDailyQtyOnHand, usageQty; Amount thisValue, valueOnHand, totalDailyValueOnHand, avgDailyValueOnHand, usageValue; Real turnsByQty, turnsByValue; date lastDate, fromDate, toDate; ; //set the itemID and date range itemId = '00001'; fromDate = mkDate(1,1,2010); toDate = mkDate(31,12,2010); //****average daily on-hand lastDate = systemDateGet(); //initialize with today. //inventSum contains today's values for qty and value while select inventSum where inventSum.ItemId == itemId && inventSum.Closed == NoYes::No { qtyOnHand += inventSum.PhysicalInvent; valueOnHand += (inventSum.PhysicalValue + inventSum.PostedValue); } //starting with today, we work backward to the from ...