Normal Topic Word merge to export subform values. (Read 2279 times)
KReilly
Member
*
Offline



Posts: 2
Joined: Mar 11th, 2013
Word merge to export subform values.
Mar 11th, 2013 at 9:02pm
Print Post Print Post  
I am currently using the word merge programming provided with the database and need to program it to include subform values.

I assume the @StringArrayElementList function is unable to export subform values. Is there a way to code in an array that includes subforms?

SUBROUTINE MergeFields()
var n as Int
var nn as Int

vLEs = @StringArrayElementList()

For n = 1 to @CountStringArray(vLEs)
     vName = @AccessStringArray(vLEs, n)
     SetThisElement(vName)
     nn = @ElementType(ThisElement)
     If nn > 999 and nn < 1009
     vNames = @AppendStringArray(vNames, vName)
     UnSetThisElement()
Next

END SUBROUTINE
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Word merge to export subform values.
Reply #1 - Mar 12th, 2013 at 8:23pm
Print Post Print Post  
Do you subscribe to Inside Sesame? I created a modified version of WordMerge, which is detailed in an article titled "WordMerge 3 — Advanced Subform Support" in the June 2010 issue.

My solution is just one method. Here are some other articles that address merging subforms:
"Mailmerge Subrecords the Easy Way", August 2006
"WordMerge and Subrecords Revisited", March 2009
"WordMerge For Lineitems Subforms", November 2012
« Last Edit: Mar 12th, 2013 at 9:23pm by Carl Underwood »  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Word merge to export subform values.
Reply #2 - Mar 12th, 2013 at 9:23pm
Print Post Print Post  
One thing that is unique to my method is that it does not push down or pull up the part of the document that follows the subform data. For example, you can have an invoice where the total (and any graphic or fine print, etc) is always at the bottom of the page. It never shrinks up to the middle, leaving a lot of blank space under it. It always fills a whole page, or two whole pages, etc. Never 1/2 a page, or 1-1/2 pages.

The other techniques will always move the bottom part of the page around based on the amount of data from the subform. Now, that may be what you want if you are trying to put subform data into a letter. If that's the case, you would want to use something like the solution in the November 2012 issue.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
KReilly
Member
*
Offline



Posts: 2
Joined: Mar 11th, 2013
Re: Word merge to export subform values.
Reply #3 - Mar 12th, 2013 at 9:27pm
Print Post Print Post  
Thank you Carl, I do not subscribe to inside Sesame; but will order those issues. I appreciate you helping me narrow my search.
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Word merge to export subform values.
Reply #4 - Mar 12th, 2013 at 9:51pm
Print Post Print Post  
You're welcome.

BTW, regarding your comment about @StringArrayElementList, in your first post. I've already submitted a request to the Sesame development team for a version of that command that would return the info about forms other than the current one. Variations on the following three commands, which would allow us to specify the form, would have simplified the WordMerge 3 code quite a bit. Hopefully, we will see them in version 3 of Sesame.

@StringArrayElementList()
@ElementType()
@AsFormattedByLE()
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged