start a dataport from a report?

Lars_Ender
Member Posts: 10
Hello,
I try to start a dataport from a report.
I wrote in the "OnPostReport"-Trigger DATAPORT.RUN(594687)
It doesn't work
Lars
I try to start a dataport from a report.
I wrote in the "OnPostReport"-Trigger DATAPORT.RUN(594687)
It doesn't work

Lars
0
Comments
-
can you describe the error?
Tried you add commit before calling the dataport?0 -
hi kine,
there is no error ... it just nothing happens.
It seems that the call of the dataport (from the report) not work.
Lars0 -
Try to call it with reqest form else it do not know which file to load... (or try to add some message into the dataport if it is running...)0
-
Does something happen is you run the dataport manually?
Is the trigger you call this statement from actually getting called / runned?
Little tip:
It's better to call it like :
DATAPORT.RUN(DATAPORT::"Dataport Name");"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
I used one dataport in my one report in this way (and it is working):
ExpDat.IMPORT(False); //if you need import then TRUE ExpDat.FILENAME(FileName); //file you want export or import... ExpDat.RUNMODAL;
ExpDat is variable of type Dataport for the requested dataport...0 -
Problem solved then?"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
no sorry ... the problem is still the same
the trigger runs (i set a message there).
if i run the dataport manualy than it works ...
but if i call it by code - nothing hapens0 -
How do you set which file you want to use in the dataport???0
-
Yeah, I thinks that's it.
You probably select a filename manually when you run the dataport. When you run this dataport from the code, you need to set a filename..."Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Hi
From all the postings I have seen in this thread, the one thing that seems to be missing is Filtering before the dataport is Run.MyRec.SETFILTER(MyField1,'%!..%2',Value1,Value2); MyRec.SETRECFILTER; DATAPORT.RUN(DATAPORT::"My Dataport",TRUE,MyRec);
SteveAnswer the question and wait for the answer.0 -
That can't be right...
SETRECFILTER places a filter on the PK. This is not the solution..."Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
You do not need to filter... it will be running for all records - filters will be the problem only if there are more records exported, but not in case that nothing is exported... ;-)0
-
eromein wrote:
SETRECFILTER places a filter on the PK.
Emiel
What is the PK?
This line of code
MyRec.SETFILTER(MyField1,'%!..%2',Value1,Value2);
should have been
MyRec := Rec;
Kine
You're right, the problem is "Nothing" is being exported.
Not a good day so far, so I'm going home and going back to bed.Answer the question and wait for the answer.0 -
Pls, go to bed, it realy seems that you have some black friday... :whistle:
If nothing is exported, filter will not help...
PK is primary key - it means that if you set filter and then do setrecfilter you will have filtered only for the record which is active - in this case nothing (because there is no FIND or NEXT or GET before....) - if someone will use your code, never will get any data... =;0 -
Hi All
I am also facing the same problem.
Here below my code
Name DataType Subtype
MyDataPort Dataport (Dataport Name)
tblJIFile.RESET;
CLEAR(MyDataport);
MyDataport.IMPORT(TRUE);
MyDataport.FILENAME(ImpFilename);
MyDataport.SETTABLEVIEW(tblJIFile);
MyDataport.RUN;
When I run the Dataport manually, it works. But call from the report (as mentioned) doesn't trigger the dataport.
Please Help.
Regards
Nasheer.0 -
Hi!
I got exactly the same problem when I try to run a dataport from a report.
The solution for me was to edit the properties of the dataport. Set value for the UseReqForm on the dataport to 'NO', then i works like a charm.
Regards Jonas0
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