Jump to content

ExternalData File Field Array Loop


Hadrian

Recommended Posts

I have one particular field (MetalSelection) in my external data file that influences the composition of a price return. What is the best way to set a loop to compose with an array of values such as Gold, Silver, Tungsten, and Bronze.
Link to comment
Share on other sites

I'm still not understanding exactly what you're trying to accomplish. Do you mean that you want to compose a whole new output record for each one of a set of values in an external data file? Or are you simply trying to combine these values somehow in one output record? Perhaps if you posted an example of a few lines of the data file, and a explanation of the desired output corresponding to each one, it might help to clarify things.
Link to comment
Share on other sites

Well, if you're using FusionPro 6.0, you could use the FusionPro.Composition.repeatRecordCount and FusionPro.Composition.repeatRecordNumber properties in OnRecordStart to basically do multiple versions of the same input data record. But there's probably a simpler solution. Maybe what you're calling an "external" data file should just be the main input file for the composition. Again, if you could show me what the data looks like, I might be able to offer more specific suggestions.
Link to comment
Share on other sites

I incorporated the "external data" to the main input file and this is what that tab delimited file looks like. Instead of having for example, five "MetalSelection" entries in my input file like below, i wanted to make the composition compose "Gold" followed by the rest of the metal samples below. This would reduce the entries in my input file. Make sense?

 

//Current Input File

Account School TYPE MetalSelection

BN08890-16/NY11 SALEM Dated w Pricing Gold

BN08890-16/NY11 SALEM Dated w Pricing Silver

BN08890-16/NY11 SALEM Dated w Pricing Bronze

BN08890-16/NY11 SALEM Dated w Pricing Copper

BN08890-16/NY11 SALEM Dated w Pricing Steel

BK00968-16/TX109749 ROCHESTER Dated w Pricing Gold

BK00968-16/TX109749 ROCHESTER Dated w Pricing Silver

BK00968-16/TX109749 ROCHESTER Dated w Pricing Bronze

BK00968-16/TX109749 ROCHESTER Dated w Pricing Copper

BK00968-16/TX109749 ROCHESTER Dated w Pricing Steel

BK08018-16/KY2 LANDOVER Dated w Pricing Gold

BK08018-16/KY2 LANDOVER Dated w Pricing Silver

BK08018-16/KY2 LANDOVER Dated w Pricing Bronze

BK08018-16/KY2 LANDOVER Dated w Pricing Copper

BK08018-16/KY2 LANDOVER Dated w Pricing Steel

 

 

//Preferred input file

Account School TYPE

BN08890-16/NY11 SALEM Dated w Pricing

BK00968-16/TX109749 ROCHESTER Dated w Pricing

BK08018-16/KY2 LANDOVER Dated w Pricing

Link to comment
Share on other sites

Okay, thanks, that helps me visualize this a bit better. My next question is, what exactly goes in the output? Do you want to have a page for each MetalSelection value? If so, your best bet might be to duplicate the page five times, set each one to Unused, and call FusionPro.Composition.SetBodyPageUsage for each metal type in OnRecordStart to output only the pages which apply for each record. Or, you could use something like a table or a repeatable component with overflow pages. It all depends on what you're ultimately trying to accomplish, which is why I keep asking about that. I need to see the bigger picture. Sometimes the answer to a question like "How do I do A to get to B?" is "Why are you using A to get to B? Maybe C is a better way to get to B."
Link to comment
Share on other sites

My next question is, what exactly goes in the output?

I already have a hash array that puts a price table together in one text frame per metal selection.

 

Due to the privacy of the content I cannot make the template public. Is there a way i can send it privately?

Link to comment
Share on other sites

I already have a hash array that puts a price table together in one text frame per metal selection.

 

Okay, but then what do you do with that text frame? Is it just one element on a page, where there's one page per record? If so, then duplicating the page and calling FusionPro.Composition.SetBodyPageUsage is probabaly the simplest solution. Or you could use a repeatable component (Template page) and Overflow pages.

 

Due to the privacy of the content I cannot make the template public. Is there a way i can send it privately?

 

Well, you could email it to me (PM me for my email address), but now we're getting into that fuzzy area between helpful advice on the forum (free) and outright template-building (not free). So you might need to inquire with Sales about some custom consulting work.

 

Your other option is to work up a new job with the same basic structure but without the private content (i.e. with dummy data) and post that, in which case others might be able to learn from the generalized solution, which is more in the spirit of the User-to-User forum anyway.

Link to comment
Share on other sites

I made another functioning version by duplicating the pages already. I am not asking for the template or the rule to be built as i can do that. I am simply wondering if what i am proposing is possible or feasible without having to write a book. The reason i cannot make the dummy changes is that i would need change too many elements. Thanks again.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...