REPORT.RUNMODAL from Form

any1
Member Posts: 7
Hi,
I've build a table and according to that table i got a form and a report.
When i opened the form watching a record, i want to run a report using the current record which is currently displayed in the form.
Function on the form:
Report.Runmodal(12345,False,False,Rec).
When running into the report the rec is lost.
What is wrong here?
Tried putting a SETRECFILTER in front of the Report.Runmodal, but that doesn't help either.
Thanks for any advice.
Greets
I've build a table and according to that table i got a form and a report.
When i opened the form watching a record, i want to run a report using the current record which is currently displayed in the form.
Function on the form:
Report.Runmodal(12345,False,False,Rec).
When running into the report the rec is lost.
What is wrong here?
Tried putting a SETRECFILTER in front of the Report.Runmodal, but that doesn't help either.
Thanks for any advice.
Greets
0
Comments
-
Hi,
Are you using the Rec from the form?
If so, just before calling the report try to read your form record into a variable and call the report using the new variable.
Something like this:
NewRecVar type Record and should be the same as the source table of your form.
In Code:
IF NewRecVar.GET(rec.'First Key',rec.'Second key'....rec.'last key') THEN
Report.RunModal(12345,False,False,NewRecVar);
Maybe this will help
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
Tried that, also no success.
What ive tried so far:
SETRECFILTER;
REPORT.RUNMODAL(12345,False,False,Rec)
=== no success
Rec2 := Rec,
Rec2.SETRECFILTER;
Report.Runmodal(12345,False,False,Rec2);
=== no success
Rec2.Get("No.");
Rec2.Setrecfilter;
Report.Runmodal(12345,False,False,Rec2);
=== no success either
In all cases the record in the report is empty again...0 -
RecVariable.setrange(YourField,Yourfield); report.runmodal(xxx,true,true,RecVariable);
Do you make it right, it works too!0 -
Ive done everything from the scratch again.
Now it works #-o
I still dont see any difference when comparing the text-files in beyondcompare.
Using the usual Setrecfilter and running the report with current rec.
Absolutely no clue what changed, prolly it works only after 10p.m. or something similar, hehe.
Weird Navision :-)
Thanks for ur help .0 -
for example if I wanted to run a report from my puchase order I would do something like this
PurchLine.RESET;
PurchLine.SETRANGE("Document Type",PurchHeader."Document Type");
PurchLine.SETRANGE("Document No.",PurchHeader."No.");
REPORT.RUNMODAL(50065,TRUE,FALSE,PurchLine);
try setting the range
**edit ** oops a bit slow clicking the post button0
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