Jump to content

Dynamic Border with External Data


rsheldon

Recommended Posts

I am having an issue creating a Dynamic Border for a variable text box that contains static text and an OnJobStart external data file. I have tried creating a table for the border but I am having trouble adding the OnJobStart data...any suggestions would be greatly appreciated. I am attaching the OnJobStart rule:

 

returnStr = '';

if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true)

{

Rule("OnJobStart");

}

numRecsExtDF = externalDF.recordCount;

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

{

 

if (externalDF.GetFieldValue(recordWalker, 'COMPANY_ID') == Field("COMPANY_ID"))

{

if (externalDF.GetFieldValue(recordWalker, 'DESIGNEE_NAME') != '')

{

returnStr += externalDF.GetFieldValue(recordWalker, 'DESIGNEE_NAME');

returnStr += ' ';

}

if (externalDF.GetFieldValue(recordWalker, 'DESIGNEE_ID') != '')

{

returnStr += externalDF.GetFieldValue(recordWalker, 'DESIGNEE_ID');

returnStr += '<br>';

}

if (externalDF.GetFieldValue(recordWalker, 'COMPANY_NAME') != '')

 

{

returnStr += externalDF.GetFieldValue(recordWalker, 'COMPANY_NAME');

returnStr += '<br>';

}

if (externalDF.GetFieldValue(recordWalker, 'ADDRESS_1') != '')

{

returnStr += externalDF.GetFieldValue(recordWalker, 'ADDRESS_1');

returnStr += '<br>';

}

if (externalDF.GetFieldValue(recordWalker, 'ADDRESS_2') != '')

{

returnStr += externalDF.GetFieldValue(recordWalker, 'ADDRESS_2');

returnStr += '<br>';

}

if (externalDF.GetFieldValue(recordWalker, 'CITY') != '')

{

returnStr += externalDF.GetFieldValue(recordWalker, 'CITY');

returnStr += ', ';

}

if (externalDF.GetFieldValue(recordWalker, 'STATE') != '')

{

returnStr += externalDF.GetFieldValue(recordWalker, 'STATE');

returnStr += ' ';

}

if (externalDF.GetFieldValue(recordWalker, 'ZIP') != '')

{

returnStr += externalDF.GetFieldValue(recordWalker, 'ZIP');

returnStr += '<br>';

}

if (externalDF.GetFieldValue(recordWalker, 'PHONE') != '')

{

returnStr += externalDF.GetFieldValue(recordWalker, 'PHONE');

returnStr += '<br>';

}

if (externalDF.GetFieldValue(recordWalker, 'PRIMARY_EMAIL_ADDRESS') != '')

{

returnStr += externalDF.GetFieldValue(recordWalker, 'PRIMARY_EMAIL_ADDRESS');

returnStr += '<br>';

}

if (externalDF.GetFieldValue(recordWalker, 'CHAPTER') != '')

{

returnStr += externalDF.GetFieldValue(recordWalker, 'CHAPTER');

returnStr += '<br>';

}

returnStr += '<br>';

}

 

}

 

return returnStr;

Link to comment
Share on other sites

Is this the entire callback rule? If so you need to use the ExternalDataFileEx() function to define where the file is and what delimiter it uses.

 

externalDF = new ExternalDataFileEx("filename.csv", ",");

 

Also, the actual return needs to happen during record composition so it would need to go in a regular rule. Returning it in OnJobStart isn't going to send the data anywhere.

Link to comment
Share on other sites

Thank You Thomas for your reply, you are correct, this was not the entire Callback, the beginning to the callBack is:

 

externalDF = new ExternalDataFileEx('Prolist_CORP_Roster_File_20121101.txt', '\t');

 

if(externalDF.valid != true)

{

Print('Failed to link to the external data file in OnJobStart');

}

Link to comment
Share on other sites

I have the OnJobStart rule in a variable text box along with some static information. I am trying to create a dynamic border that will grow vertically as more addresses are added. Some records only have 1 address, whereas others have 7 or more addresses.
Link to comment
Share on other sites

Hi rsheldon. I'm confused about several things.

 

  • First, you mention you're "creating a table for the border," but I don't see any <table> tags or use of the FPTable object in your code. Are you really trying to create a table, and if so, how are you doing that? Is each address block supposed to be a single table cell?
  • Also, you say that you are "attaching the OnJobStart rule," which calls out OnJobStart. Did you mean you were attaching OnRecordStart, or a different rule, instead?
  • Finally, you say you "have the OnJobStart rule in a variable text box," but that doesn't make sense to me. You can include variables naming regular, non-callback rules in variable text, but, as Thomas alluded to, you can't directly include or call out callback rules (such as OnJobStart) in text. So what rule are you actually calling out in your text frame?

Also, it might help if you included the external data file itself, or at least the first few records, so that we can get an idea of how to access it. An example of what you want the output to look like would be helpful as well.

Link to comment
Share on other sites

Good Morning Dan/Thomas,

 

Please allow me to start over. The issue I am having is: I need to create a dynamic border that will go around variable text box. The variable text box has some static information along with a OnJobStart callback rule:

 

Make any changes to your designees on this form or include the changes on a separate sheet of paper. (Static text)

 

«Designee Rule_2» (OnJobStart_Rule)

 

If you have a change in the Point of Contact, please be sure to note this on this list. (Static Text)

 

The Designee Rule I posted originally minus the callback string, I then posted the callback string.

 

I am attaching a sample collected file (test data, PDF).

 

I am thankful for all the help. I am using FP7.2pk in Acrobat 8 on a Mac.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...