DataPort Option FileName

In a DataPort, how can I force The File Name.

In DataPort properties the File Name and File Name Format propertys are not enough, because in my File Name I have one fixed part and another part is variable.


Filename = **AAAVatRegistrationNumber+**FilterDate

Fixed Variable

How can I do This?

You can assign the file name using CurrDataport.FILENAME := YourName

I can’t remember if you’re allowed to do it in the OnInit trigger or not

In Dataport - OnInitDataport()
FileName := ‘BANDI.txt’;

The FileNme must be: BAND+CompanyVatRegistrationNo.+ A filter date inserted manualy by User

So I need to see my File Name in DataPort Request Form, for user add the date correctly.

You can set the FileName using a local text variable, along with a further variable for your user req. form date field.

So, create a variable “userdatefilter”, as a date field

Then create a Text variable: Text50000 BAND %1 %2

Then make sure you can reference the CompanyVatRegistrationNo

Then, on validate of the “userdatefilter”, make FileName := STRSUBSTNO (Text50000,CompanyInfo.VATRegno,userdatefilter)

If my memory serves, then the filename will not magically appear in the export box, on the option tab for the report, but will be set, so will allow the export to run.

If you want to test it, create yourself a further text variable, Text50001, The value of the filename is %1

Then immediately after the code on the onvalidate for the userdatefilter on the req form, add a line


this will then display your filename

hope that gives you a pointer


I Created the new variable, but where is this variable Onvalidate triger do this ?

“Then, on validate of the “userdatefilter”, make FileName := STRSUBSTNO (Text50000,CompanyInfo.VATRegno,userdatefilter)”