Hello everyone,
I need some help running a report the way I want it to. I created a form, from which I want to run a report. In this form, I'm setting filters based on an option-field. Now I want to run a report with the option selected in the form.
The form filters the Sales Invoice Header. E.g. the user selects Netherlands from my option field, a function is setting filters on the country, the VAT Code and some other fields. My report creates a virtual invoice, in which I want to control the invoice receiver based on the option selected in the form. What I did: In my report I created a function with a rec-var and an option-var, which writes the local var from the function into a global variable for my report, in my form I'm calling the function with the filtered rec and the option selected. Now my problem is, that I don't know how to run the report after calling the function. I think I have to run in directly from my function, but how can I do this?
This is how my function within the report looks like now:
InvRec := InvAdress;
//InvRec is the global option-var, InvAdress is the local option-var
REPORT.RUNMODAL(77239,TRUE,TRUE,InvoiceHeaders);
//InvoiceHeaders is the local Rec-var
Thank you very much for your help!
0
Comments
for more detail you can search for this topic in forum....
Sascha
In my form I created a button, which - pushed - sets the selected Lines on marked (SETSELECTIONFILTER). With the last answer on my post I get the correct option in my report. When I call my function with the rec-variable, the report still shows data for all lines (my report is based on the "Sales Invoice Header" table).
I'm not getting the clue how to filter the DataItem in my report to only the marked lines from my function!
Thanks in advance!
(rep is report,
NewRec is record same as Form data source):
CLEAR(rep);
CurrForm.SETSELECTIONFILTER(NewREC);
NewREC.MARKEDONLY(TRUE);
rep.SETTABLEVIEW(NewREC);
rep.RUNMODAL;
Wo.MARKEDONLY(TRUE);
Rep.SETTABLEVIEW(Wo);
Rep.RUNMODAL;
use this kind of code
(rep is report,
NewRec is record same as Form data source):
CLEAR(rep);
CurrForm.SETSELECTIONFILTER(NewREC);
NewREC.MARKEDONLY(TRUE);
rep.SETTABLEVIEW(NewREC);
rep.RUNMODAL;
another way you can..... according to your requirment i recommended you to use second way.
Now my code in the form looks like (the lines are already marked at this point):
CLEAR(Rep);
Rep.GetInvAdress(InvoiceFilter);
Rep.SETTABLEVIEW(Rec);
Rep.RUNMODAL;
The function in the report:
GlobOptionVar := LocOptionVar;
And it works perfectly!!
Thanks again!
Do not use MARKEDONLY(TRUE) in connection with SETSELECTIONFILTER. SetSelectionFilter sets MarkedOnly(True) *IF* it is using marks. It is not using marks if either all or no records are selected. If all records are selected, SetSelectionFilter is a NOP, if none is selected, SetSelectionFilter is equivalent to SetRecordFilter.
Is there any tutorial that shows how to do it or is there a step by step guide as to how I can do this. I am sorta a newbie at NAV thats why I am sorta lost...
http://www.BiloBeauty.com
http://www.autismspeaks.org
There's this thing called the "C/SIDE Reference Guide", it's in the Classic client under the help menu. Open it, go to the search page and type in keywords that you want to know more about. There are tons of examples and sample code in there. Go to the online help system, there are tons of walkthroughs and tutorials in there.
RIS Plus, LLC
What I want to know is where does it save this information?? How can I retrieve this info?
Its not very detailed, I feel. Maybe thats just the newbie aspect of me talkign who doesnt know that much.
I also did a quick google search and got back almost 3000 results on "SETSELECTIONFILTER Navision".
Surely there is something you can use in there.
These forums are not intended to provide a full explanation of an entire concept. You need to do some of the legwork yourself, and come with specific questions.
RIS Plus, LLC