Run a report with the current record in form

Stan09
Member Posts: 63
Hi,
i try to run a report from a form, the form sourcetable and the report main dataitem are the same. i used Report.Run(...,Rec) in the Command Push trigger. the matter is that the report do not run with the current record of the form but with the random record in the table.
HAve any idea, please share with me.
i try to run a report from a form, the form sourcetable and the report main dataitem are the same. i used Report.Run(...,Rec) in the Command Push trigger. the matter is that the report do not run with the current record of the form but with the random record in the table.
HAve any idea, please share with me.
0
Answers
-
Stan,
Reports are run with the filters on rec not the value of rec.
You need to set a filter on rec equal to the primary key values of rec
Use:
myrec local variable same as rec
myrec.setrange(field1,rec.field1);
myrec.setrange(field2,rec.field2);
(etc, if needed)
report.run(....myrec);
Steve0 -
You are GREAT, Steve
TKs U.0 -
It gives an error when use like this : REPORT.RUN(90028,g_changerequest ); The error is "İnvalid type Boolean := Record"0
-
Stan,
REPORT.RUN function have next sintaxis:
REPORT.RUN(Number [, ReqWindow] [, SystemPrinter] [, Record])
for your report it will be:
REPORT.RUN(90028,TRUE,FALSE,g_changerequest);1 -
Thanks, its working.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