How do i pass a variable from a Report to a Form?

kenyo
Member Posts: 40
Hi, so i have a Form that calls a Report in an OnPush()-Trigger. After the Report is run, i want to pass two Integers back to the Form. Is there any way to do it?
Since apparently all variables are cleared after Report.RUN is executed i cant follow up with get functions in the Report. I also tried it the other way around and put set functions in my form and tried to update the form fields in the OnPostDataItem() of the Report... that doesn't work either ( apparently it's passing the values to a new instance of the form instead of using the one that is currently running.
EDIT: all i had to do was RUNMODAL instead of RUN. I don't know why but apparently the variables don't get cleared this way
Since apparently all variables are cleared after Report.RUN is executed i cant follow up with get functions in the Report. I also tried it the other way around and put set functions in my form and tried to update the form fields in the OnPostDataItem() of the Report... that doesn't work either ( apparently it's passing the values to a new instance of the form instead of using the one that is currently running.
EDIT: all i had to do was RUNMODAL instead of RUN. I don't know why but apparently the variables don't get cleared this way
0
Answers
-
I suppose it is not very good way, but anyway.
You can create codeunit and set it to single instance and create required variables, procedures to set and read variables.
Make modifications in the report to update varaible values in codeunit by calling procedure to set variables in codeunit .
On the form, On OnPush trigger, once after report run, get variables from codeunit.
Nav Upgrades and DEV outsourcing
Reports transformation to RDLC
List -1h , Complex List -3h, Document -4h (dev hours)
navisionupgrade.com0 -
I didn't want to use a codeunit since the report was already done. But yea , i edited the solution in my OP. RUNMODAL doesn't destroy the Object instance so i could just fetch them after the report was run. thanks anyway though.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