Chengooi wrote:ASCIIOutput('PhilH.cma', 'CostCentre','Consol','Actual','MTD','period');
yes, only in prolog, never touch the other because don't know how to use it.
I have attached my pro file to your email.
First, the Prolog is executed only once,
before even a single row of the data source is processed.
Consequently, you can't expect it to output the data from your view. By putting the AsciiOutput in the Prolog tab, it never sees the data. Not one single record of it.
The Metadata and Data tabs both loop through the records which are returned from the data source, one row at a time. It is only in one of those tabs (more commonly the Data one) that you will be able to output the data from your data source using AsciiOutput.
Second, you have put quote marks around each of the arguments in the AsciiOutput function. That means that instead of outputting the variable
values from your data source (that is, the contents of each field on each row), you are outputting the field names as literal strings.
That is to say, even if you were to move the code into the Data tab, you'd end up with a file which would read:
"CostCentre","Consol","Actual","MTD","period"
"CostCentre","Consol","Actual","MTD","period"
"CostCentre","Consol","Actual","MTD","period"
"CostCentre","Consol","Actual","MTD","period"
for as many rows of data as you have.
You would need to remove the quotes around the field names if you wanted to output the data rather than the field names (but NOT the file name):
ASCIIOutput('PhilH.cma', CostCentre,Consol,Actual,MTD,period);
That would presuppose that all of the fields are given a variable type of String, not Numeric on the Variables tab. If you have any of those values set as Numeric, you will need to convert them to a string using a Rules function like Str() before you assign them as an argument to AsciiOutput.