Hello,
i have in a form (source is item), a variable TempItem (is a temp. variable - record - item), which will be filled with same items records. Now, i want to start a report, which will use only this TempItem Records. (with the FlowFields "Qty. on Sales Order" to the DateFilter)
This is the code to start the report (OnRun-Trigger by a Button)
SelectItem := TempItem;
SelectItem.COPYFILTERS(TempItem);
REPORT.RUN(50073,TRUE,FALSE,SelectItem);
The Report have as DataItem "Item" and "Sales Line".
But this did not work right. What is wrong. How can i transfer the TempItem to the report?
regards
stony
Comments
viewtopic.php?f=23&t=42803&hilit=parameter+report
http://ssdynamics.co.in
http://www.mibuso.com/howtoinfo.asp?FileID=6
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Better will be something like: (but it is only the "purity" of the coding)
But yes, try it...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
in nav 2009 sp1 this code returns this error... maybe a filter on markedonly can work...but be aware of possible performance problems...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
It is the error that table is not there but it is... I think that it was same for XMLPort in NAV 4 but was solved for it in NAV 5+ and may be I remember this one...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I used a form that was bound to a table with the "SourceTableTemporary" property set to Yes. My form fills the temporary table with data. When I want to launch a report based on the temporary data, I execute this code from within the form:
CLEAR(SalesRep);
SalesRep.PassParams(Rec);
SalesRep.RUN
"SalesRep" is a variable that is type "Report", set to the report I wish to run.
In the report, I added a function called "PassParams" with one pass-by-reference parameter (i.e. the VAR column is checked) of type "Record" which points to the same table that the form is bound to. The function looks like this:
PassParams(VAR TempSales : Record "Sales Report Worksheet")
SalesRec.COPY(TempSales,TRUE);
"SalesRec" is a global variable of type "Record" that is set to the table that the form is bound to. Its "Temporary" property is set to Yes. The one line of code is key as it tells Navision to reference the temporary table (and thus all of its data) that was passed (by reference also) from the Form. So in the report, "SalesRec" is actually referencing the temporary table that was created (and still held) by the form.
The report must use the Integer table as the data item and the temporary records must be looped manually. To do this place this code at the beginning of the "Integer - OnAfterGetRecord()" trigger:
IF Counter = 0 THEN
SalesRec.FINDFIRST
ELSE
SalesRec.NEXT;
Counter += 1;
"Counter" is a global variable of type integer. Finally, place this code in the "Integer - OnPreDataItem()" trigger:
SETRANGE(Number,1,SalesRec.COUNT);
Counter := 0;
Otherwise, the report will run for as long as there are integers in the Integer table. Also, each field used in the report "sections" will have to be prefixed with the temporary table variable name (SalesRep in my example above), since these fields won't exist in the Integer table.
why do you need a form with temporary sourcetable and pass the parameters to the report?
you can just populate the temptable within the report dataitems, and then show the integers! (just like it's done in the howto)
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I agree with you but the original poster was asking to launch a report from within a form, using a temporary table.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog