Copy link to clipboard
Copied
Copy link to clipboard
Copied
Change the field names or change the field order at "Custom calculation script".
Copy link to clipboard
Copied
Thank you Bernd for the hint,
Please, could you share the "Custom calculation script" that I should put to get the result wanted?
Copy link to clipboard
Copied
Activate the entry "Custom calculation script" and you will see the script.
Copy link to clipboard
Copied
I did, but even when I place the fields in the order that I want the result doesn't changed.
here is the script:
/* Customize: */
function bMemberOf(strName, aStrNames)
{
for (var nMembIdx in aStrNames)
{
if (strName == aStrNames[nMembIdx])
return true;
}
return false;
}
function strTabDelimited(oParam)
{
var bNeedTab = false;
var strNames = "";
var strValues = "";
for (var i = 0; i < oParam.oDoc.numFields; ++i)
{
var strFieldName = oParam.oDoc.getNthFieldName(i);
if ((null == oParam.aFields || bMemberOf(strFieldName, oParam.aFields))
&& (null == oParam.strXclField || strFieldName != oParam.strXclField)
&& (oParam.oDoc.getField(strFieldName).type != "button"))
{
if (bNeedTab)
{
if (oParam.bFieldNames)
strNames += "\t";
strValues += "\t";
}
if (oParam.bFieldNames)
strNames += strFieldName;
strValues += oParam.oDoc.getField(strFieldName).value;
bNeedTab = true;
}
}
if (oParam.bFieldNames)
return strNames + "\n" + strValues;
else
return strValues;
}
try
{
if ( app.viewerVersion >= ADBE.PMD_Need_Version )
event.value = strTabDelimited({oDoc: this, aFields: ["Text1", "Price1", "Qty1", "Text2", "Price2", "Qty2", "Text3", "Price3", "Qty3", "Total"], bFieldNames: true});
else event.value = " ";
}
catch (e)
{
event.value = " ";
}
Copy link to clipboard
Copied
The script ignores the order in the array.
You must change the script.
Copy link to clipboard
Copied
Hi, I was having the same issue. it seems like the order the data fields are outputted is done alphabetically with an odd way of treat capitalised field names (A>Z>a>z) I found prefixing my field names with A_, B_ meant that I could get them outputted in the order I want without having to teach myself JAVA