Running a report from a form or the Object Designer

aztecconsulting
Member Posts: 55
Is it possible to tell if a report is being called from a form or from the object designer? I want to fire some functionality if the user is running the report from a button on the form, but not if I am running it from the designer. I'm hoping to make the change to the report because this isn't a form we can easily modify so I am looking for a way to determine it in the report.
0
Comments
-
If you do not want to modify the form, I think, it is not possible, only if the report is called from the form without request form. Than you can use the variable CurrReport.USEREQUESTFORM for detecting it. But if the request form is used when runned from the form, there is no difference...
But if you will change the form, and will call the report through variable, you can pass some flag through functions etc. See How To pass data into report...0 -
Or if you have some singleinstance codeunit, you can put in it some code to create global variables.
Then in the form you set the global variable, in the report you test for it and then delete the global variable. This last in case you would then run the report from the object designer. If you didn't delete the global variable, it would still be there.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Add a global variable, and a function to the report.
Before you call it from a button, call the function and set the global variable.
//call in code
rReport.SetParameters(true);
rReport.runmodal;
//in report
function SetParameters(_fromForm: boolean)
GlobalCalledFromForm := _fromForm
OnPreReport
if GlobalCalledFromForm then begin
//do whatever
end;
-a0 -
awarn wrote:Add a global variable, and a function to the report.
//call in code
rReport.SetParameters(true);
rReport.runmodal;
-a
That's right!
But in this case: How can I suppress the upcoming filterdialog?
(As I would do it in RUNMODAL(....))
...sorry for activating this one year too late!
Thanks for your help!
Dirk0 -
repTheReport.USEREQUESTFORM(FALSE);Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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