Jump to content

Data question


kopytekinc

Recommended Posts

I have a database that the customer wants to create statements from, it has multiple rows per record. I have not dealt with a way to utilize more than 1 row for a specific file.

 

Please review the attached and let me know if this is feasible as the data currently formatted. The User ID shows which records would go onto a single statement.

Statement List.txt

Link to comment
Share on other sites

Alrighty, exactly the functionality I was looking for, found the example in the manual on it. Unfortunately I am a bit lost on how to rework the rule to fit my needs as it seems to iterate along the ID to use the records where with my data fields I need it to use the same page for a varied number of records then when the userid changes start another statement.

 

Below I was building just a beginning rule off of what the sample was, but I am not sure how to get it to work as I need. Unfortunately it doesnt work and crashes saying I have an uncaught error on the matter.

 

Dir = new ExternalDataFile("C:\\Test\\MBF_VBHNJ\\Test.txt", ",");

x = 1;

while (Dir.GetFieldValue(x, "CustID") != "")

{

Final = Final + Dir.GetFieldValue(x, "BillName") + " " +
   Dir.GetFieldValue(x, "UnitPrice") + " " +
   Dir.GetFieldValue(x, "Shipping") + " " +
   Dir.GetFieldValue(x, "TotalTax") + "<br><br>";

   x=x+1;

}

return;

 

Thanks for any/all help in this matter

Link to comment
Share on other sites

Perhaps (assuming your data is sorted on CustID) you can set up a WHILE loop that adds rows of data to your tagged output for each record until the CustID changes. Then it would hold the row number of the row containing a new CustID in a global variable to start from when it begins pulling row(s) of data for the next record.
Link to comment
Share on other sites

Here's the basic part of a rule we use to get the multiple records from an external data file. It goes through the whole external file to find all matches...

 

var numRecsExtDF = Sub_File.recordCount;

for (var recordWalker=1; recordWalker <= numRecsExtDF; recordWalker++)

{

if (Sub_File.GetFieldValue(recordWalker, 'CUSTOMid') == Field("CUSTOMid"))

{

----ALL YOUR CUSTOM STUFF----

}

}

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...