Jump to content

Returning the total number of records from an uploaded file.


ehigginbotham

Recommended Posts

I have a customer that is using Marcom to send us data. We are then doing a lot of work to that data offline. We use the customer sending us the data to generate the workorder that goes through the plant. Rather than having a template that says, "thank you for your order" when they preview their uploaded data. I would like to create a report that would give the customer information to verify what they have uploaded.

 

The uploaded file is simply an address file, with 1 field in it for which group the names go with. I need the report to return, how many total records are in the order, and how many of each group are in the order.

 

Is there a way to have a template parse through all of the uploaded data, and use the information in it to give summaries like this.

 

thanks

Link to comment
Share on other sites

Yeah, I have been looking through the forum for a few days now, and saw that, but haven't had any luck getting it to work.

 

Couple questions:

 

1. Do I just put that in an empty rule and give it a name? when I do it does not return a value. If its in a callback rule, I can't actually return it in a template, it just triggers something to happen.

 

2. When I add this as a regular rule, it always returns 0, because the var RecordCount has been defined as 0. I'm kind of lost as how to translate this rule into one that returns the total number of records and information from the uploaded list.

 

var RecordCount = 0;

if (FusionPro.Composition.isBatch)

{

// MarcomCentral

RecordCount = Int(FusionPro.Composition.JobOptions["MCC_num_records"]);

}

else

{

// FP Desktop

RecordCount = new ExternalDataFileEx(FusionPro.Composition.inputFileName, ",").recordCount;

}

return RecordCount;

 

thanks for your help.

Link to comment
Share on other sites

1. Do I just put that in an empty rule and give it a name? when I do it does not return a value. If its in a callback rule, I can't actually return it in a template, it just triggers something to happen.

Yes, you put it in a regular Text rule and give it a name. I'm not sure what you mean by, "it does not return a value," since you say right below that it returns zero.

2. When I add this as a regular rule, it always returns 0, because the var RecordCount has been defined as 0. I'm kind of lost as how to translate this rule into one that returns the total number of records and information from the uploaded list.

What is the format of your data file in FP Desktop? You probably need to modify the second part of that rule to match it.

 

Perhaps uploading the data file, if not the whole job, will make this conversation less abstract.

Link to comment
Share on other sites

When I compile the job on desktop, it tells me the total record count, but when I am in preview mode, it just says 1.

You're only going to get 1 in a Desktop Preview. Preview is only intended to give you a quick way to see how things are going to be laid out on the output page by composing a single record of data. It doesn't access the full input file. Some things like this just can't be done in Preview, so you have to do a full composition.

On MarcomCentral, it just gives a total of 0.

I think this depends on whether you are running a versioned (usually single-record) job where MarcomCentral is generating the data file, or a VDP (multi-record) job where you're uploading your own input data file. In the latter case, the first part of the rule doesn't apply, and I think you should be able to just do this in both FP Desktop/Creator, as well as in MarcomCentral:

return new ExternalDataFileEx(FusionPro.Composition.inputFileName, ",").recordCount;

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...