kopytekinc Posted March 29, 2011 Share Posted March 29, 2011 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 More sharing options...
MartyrSyx Posted March 30, 2011 Share Posted March 30, 2011 Just a short answer to get you started. We would utilize the External Data file capabilities of FusionPro. Once you get the concept, it's pretty powerful to create tables, lists, and use these multi-line-record files. Link to comment Share on other sites More sharing options...
kopytekinc Posted March 30, 2011 Author Share Posted March 30, 2011 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 More sharing options...
esmith Posted March 30, 2011 Share Posted March 30, 2011 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 More sharing options...
MartyrSyx Posted March 31, 2011 Share Posted March 31, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.