Normal Topic Merge File Print Using Subform (Read 2111 times)
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Merge File Print Using Subform
Jan 19th, 2010 at 8:30pm
Print Post Print Post  
I have created an extensive database of documents that I assumed that I could "port" into any application as a subform for merge file printing using the mergefileprint command.  By itself the database works flawlessly for the nearly 500 documents that it references.

However, it does appear that once "ported" into an existing application as a subform the mergefileprint function does not, by itself, merge data from the host application into the documents referenced by the subform.

Yet another lesson in the definition of the word "assume".  Is it possible to do such a thing without needing to recreate this document database for each application that it serves?

As always...I do very much appreciate your assistance.

Thank you, Cliff
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Merge File Print Using Subform
Reply #1 - Jan 19th, 2010 at 10:10pm
Print Post Print Post  
If I understand you correctly, you need to use @FormFieldValue to read the values from the parent form.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Merge File Print Using Subform
Reply #2 - Jan 20th, 2010 at 5:32pm
Print Post Print Post  
I'm not clear as to why the list of merge docs is being presented as a subform, as opposed to a simple selection list  generated from the Documents database.  Can you please clarify how you are using this?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Merge File Print Using Subform
Reply #3 - Jan 21st, 2010 at 2:43pm
Print Post Print Post  
I’ve developed an application that contains 15 merged forms for the purpose of insurance policy issuance.  The forms or individual databases in the application are used to input information (some in great detail) pertinent to the insurance policy.

We are using Sesame to print out and issue insurance policies for several different markets.  When the policy is actually printed there are numerous documents that are directly associated with it and that is what we’ve used Sesame for historically. 

There are two classes of documents, one class that contains specific insured and insurance company information.  This system is in place and works fine.  However, we were subsequently asked to add the boiler plate documents that are associated with any given policy.  There are approximately 500 such boiler plate documents. 

When I was given the project I assumed that being “boiler plates” that these items did not need to extract data from the policy management system so I created a discrete form to enable the user to batch print whatever assortment they need from these 500 or so items.

However, I subsequently learned that some of these boilerplate documents do in fact need to extract data from the application.

Undaunted I figured I would add this discrete application (“forms” by name) to the host application by installing it as a sub form.  The batch print works flawlessly in this manner but it does not seem to allow me to extract data into any of these docuements.

Apologies for the verbose nature of this message.

Thanks again…

Cliff
  
Back to top
 
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Merge File Print Using Subform
Reply #4 - Jan 21st, 2010 at 3:43pm
Print Post Print Post  
Also, re: Carls suggestion to use the @FormFieldValue function. 

I see what you mean by using this...any clues or tips on how I may integrate this with the MergeFilePrint command as I am using the "mergefile" command in a very simple fashion for each of the 500 documents as follows:

if GL0239 00 99 <document name> = "T" then
{
MergeFilePrint("C:\GL0239 00 99.RTF","RTF","","","","","")
}

Tx...
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Merge File Print Using Subform
Reply #5 - Jan 21st, 2010 at 3:48pm
Print Post Print Post  
Cliff wrote on Jan 21st, 2010 at 2:43pm:
Apologies for the verbose nature of this message.

Why? I did ask for clarification, after all.  Smiley

I'm still wondering why you installed your boilerplate forms as a subform instead of as more of a "lookup table." In pseudocode, I'd expect there to be a button on the Main Form called Documents which, when click does something like:

Get list of Documents from Boilerplate database
Offer list to User to select
Print selected document

Or maybe like:

Get list of Documents from Boilerplate database
While User keeps selecting
  Offer list to User to select
  Add selection to list
}
Print documents on list

Carl is right in that you need to use @FormFieldValue in your Merge code to make this work, but I'm wondering if you can take the more direct route so you don't have to.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Merge File Print Using Subform
Reply #6 - Jan 21st, 2010 at 3:53pm
Print Post Print Post  
Thanks Hammer...not being on my "9's" as a coder I simply took a stab at the subform route...I will give the lookup table suggestion the old college try...!!

Thank you graciously...

Cliff
  
Back to top
 
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Merge File Print Using Subform
Reply #7 - Jan 21st, 2010 at 5:14pm
Print Post Print Post  
At this point I have to cry "uncle".  I have really no idea how to go about creating an array that will present a list that someone can pick multiple items from.  While I do appreciate the hand-holding that has at least gotten me to this place I defer to you for either further direction or suggestions.

Thanks again...

Cliff
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2492
Joined: Aug 20th, 2003
Re: Merge File Print Using Subform
Reply #8 - Jan 21st, 2010 at 7:09pm
Print Post Print Post  
Hello Cliff,

@XListValues() will return a StringArray that you can use with @PopupMenu().

Something like the following should be what you are looking for

Code
Select All
Var vDocumentNames as String
Var vDocumentsToPrint as String
Var vSelectedDoc as String
Var vQuit as Int
Var vPos as Int
Var vLoop as Int
Var vCnt as Int
Var vDocName as String

//Get all Document Names
vDocumentNames = @XListValues(@Fn, "MergeDocs!Document Name")
If @Error = False Then
{
	vDocumentNames = "*Done;" + vDocumentNames
	vDocumentsToPrint = ""
	vQuit = 0
	While vQuit = 0
	{
		vSelectedDoc = @PopupMenu(vDocumentNames, "Pick A Document to Print")
		If vSelectedDoc <> "*Done" and vSelectedDoc <> "" Then
		{
			//Add Selected Document to list
			vDocumentsToPrint = @AppendStringArray(vDocumentsToPrint, vSelectedDoc)
			//Remove selected document from the list for the popup
			vPos = @FindStringArray(vDocumentNames, vSelectedDoc)
			vDocumentNames = @DeleteStringArray(vDocumentNames, vPos)
		}
		Else
		{
			vQuit = 1
		}
	}
}

If vDocumentsToPrint <> "" Then
{
	//Loop through documents selected from popup and print them
	vLoop = 1
	vCnt = @CountStringArray(vDocumentsToPrint)
	While vLoop <= vCnt
	{
		vDocName = @AccessStringArray(vDocumentsToPrint, vLoop)
		Writeln("Printing: " + vDocName)
		MergeFilePrint(vDocName,"RTF","","","","","")
		vLoop = vLoop + 1
	}
}
 



You will need to replace "MergeDocs" in the XListValues with the name of the Form that contains your merge documents and "Document Name" with the name of the element that contains the name of the merge doc.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Merge File Print Using Subform
Reply #9 - Jan 21st, 2010 at 7:48pm
Print Post Print Post  
Wow! Ray... Thank you...this is far more than I expected...many thanks...
Cliff
  
Back to top
 
IP Logged