Report wizard - Count records functionality

jdeme
Member Posts: 12
Hello everyone.
I have a question which I would assume a lot of other people might have.
A similar question was posted back in 2005 but nobody bothered to answer...
Regarding there report wizard. Customers would like to have the option to display the number of records contained in their ad-hoc report. Currently such a thing does not exist.
I gave it a try to modify the existing classes and display the record count, but not much luck as some classes cannot be modified (e.g. ReportRun).
Any ideas???
Joanna
I have a question which I would assume a lot of other people might have.
A similar question was posted back in 2005 but nobody bothered to answer...
Regarding there report wizard. Customers would like to have the option to display the number of records contained in their ad-hoc report. Currently such a thing does not exist.
I gave it a try to modify the existing classes and display the record count, but not much luck as some classes cannot be modified (e.g. ReportRun).
Any ideas???
Joanna
jdeme
0
Comments
-
A report is generated from query. Unfortunately you can not predict the size of the tables inside the query, so you have to iterate through the list.
In AX 4.0 the wizard has a method which returns the query used for the report, what you can do is in the SysReportWizard class under the reportGenerate method add something like this:int myCounter = 0; QueryRun myQueryRun;
...query = this.reportGenerateQuery(); // new section --> myQueryRun = new QueryRun(query); while (myQueryRun.next()) { myCounter++; } info(strfmt("There are %1 record lines in the report", myCounter)); // new section <--
Then if you open the report wizard, go through the parametrization and click Print preview, you will have a preliminary estimation of how much records are going to be displayed on the report without any criterias.
You can also put this information in the wizard itself, as you can get the query outside of this code anywhere with reportGenerateQuery(), and count the records there, pass the value to a form control.
Another thing is if you know you will get all of the records from the table for sure, you can just do this:SysDictTable dt; ; dt = new SysDictTable(tablename2id("SysUserInfo")); info(strfmt("%1", dt.recordCount()));
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions