Hello,
I need to make a filter on fields in a dataport, its fields I declared them as variables to be able to export the data in a single line, because I am going to export the data of two tables and I declared only the only one.
Thank you in advance
0
Comments
MyRecVar2.GET(Field);
MyExportField1 := MyRecVar2.Field1
......
where
MyRecVar2 is of type Record
Field1 is of type MyRecVar2.Field1
Hope this helps
but I would want that the fields on which I have make the filtes that they are visible by the user so that he can make a filter
If the answer is yes then you could do the following
Set 3 DataItems
MyRec1
MyRec2
Integer
Don't set the properties for DataItemTableView.
Declare 2 Variables
MyRec3 same as MyRec1
MyRec4 same as MyRec2
In Integer OnPreDataItem
MyRec3.COPYFILTERS(MyRec1);
if MyRec2.COUNT = 0 THEN
CurrDataport.QUIT;
MyRec4.COPYFILTERS(MyRec2);
SETRANGE(Number,1,MyRec3.COUNT);
In OnBeforeExportRecord section
If Number = 1 THEN
MyRec3.FIND('-')
ELSE
MyRec3.NEXT;
add coding to deal with MyRec4 and then fill in the variable fields
of the data you want to export.
Regards
Albert