Hi nav Masters,
I have a problems when importing using dataport then i call a report to print the record that i just imported.
I use a temptable on the dataport to fill in the data that is imported, then call a function in the report, the function is to fill the temp table in the report.
So now i have the same record in the dataport and in the report.
Then on the dataport i call the report with this code :
Dataport - OnPostDataport()
RptSalesPrice.gFn_SetRecord(RecTmpSalesPrice);
RptSalesPrice.USEREQUESTFORM(TRUE);
RptSalesPrice.RUN();
The Import data is success but it didn't call the Report?
What i want is to show the Report Request Form so i can preview or print.
Can i do that?
Please advice
Thanks in advance
______________
Regards,
Steven
0
Answers
REPORT.RUNMODAL(Number [, ReqWindow] [, SystemPrinter] [, Record])
here u create a variable type record of same rec because if u pass rec in last parameter then it wont work.
saleshdr record sales header
saleshdr.setrange(saleshdr."No.","No.");
if saleshdr.findfirst then
report.runmodal(50000, ture, false, saleshdr);
hope it will help u.
Rajesh Patel
I've try this before. Cannot use RUNMODAL because it will cause ERROR, i think its be cause the dataport haven't commit yet.
Any other idea?
thanks
Regards,
Steven
Thats a good idea, but i want to know if navision can call report from dataport?
Thanks for the advice
Regards,
Steven
Instead in your OnPostDataport trigger you could COMMIT changes and after that call the report with RUN.
Upon exit of OnPostDataport the COMMIT is issued by dataport itself so calling from a separate function your dataport and then your report essencially does the same thing
I already try to use COMMIT and then RUN, still cannot.
I think navision cannot call report from dataport, so i will try to find a workaround by calling from another function like David said.
Thanks
Regards,
Steven
example:
Regards
I always get 0 record.
Any idea?
Regards,
Steven
if records are avail in that time. then use var type parameter.
in a function called from from
Rajesh Patel
Change it from RUN to runmodal;
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Currently trying to do like this from codeunit
YourDataportAsVariable.runmodal;
YourDataportAsVariable.GetTempTab(TempTab); <- CallByReference (VAR)
YourReportAsVariable.SetTempTab(TempTab);
YourReportAsVariable.runmodal;
But i can't get my value even using CallByReference ](*,)
This is my code:
Its seems that my code must add Insert
bu then problems when i have more than 1 record. Should i use looping or does Nav have a function to copy all records to another records?
Thanks in advance[/quote]
Regards,
Steven
This is the code in function GetTempTab in YourDataport
This is the code in function SetTempTab in YourReport
Now in report you loop through the TempTab, for example, in DataItem "Integer"
Do you need more informations :?:
Thanks garak.
I just find out that navision cannot do Rec := Rec1 without looping and INSERT.
My problem solved now,
Thank you all
Regards,
Steven