<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JetForm Expert &#187; logo</title>
	<atom:link href="http://jetformexpert.com/tag/logo/feed/" rel="self" type="application/rss+xml" />
	<link>http://jetformexpert.com</link>
	<description>Problems with JetForm, Accelio, Adobe Central?  You're in the right place.</description>
	<lastBuildDate>Mon, 18 Oct 2010 20:42:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Changing Logos On The Fly in a JetForm Form</title>
		<link>http://jetformexpert.com/2007/06/changing-logos/</link>
		<comments>http://jetformexpert.com/2007/06/changing-logos/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 20:19:08 +0000</pubDate>
		<dc:creator>Daryl</dc:creator>
				<category><![CDATA[Design How-To]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[logo]]></category>
		<category><![CDATA[logos]]></category>

		<guid isPermaLink="false">http://jetformexpert.com/?p=6</guid>
		<description><![CDATA[This has got to be one of the most-asked questions ever. Either you have sub-companies and you want to print different logos depending on the company, or you want to print different addresses for different branch offices &#8211; or you want to do both. Here I will attempt to explain how you can change logos [...]]]></description>
			<content:encoded><![CDATA[<p>This has got to be one of the most-asked questions <em>ever</em>.  Either you have sub-companies and you want to print different logos depending on the company, or you want to print different addresses for different branch offices &#8211; or you want to do both.</p>
<p>Here I will attempt to explain how you can change logos on the fly using nothing more than a piece of information from your data file.</p>
<p><span id="more-6"></span><strong>Determining What You Can Key On</strong></p>
<p>The first thing you need in your data file is something that you can use to determine which logo/address/whatever block you want to use. Whatever this is, you have to be sure that you know what all the possibilities for it are. We can get around <em>nothing</em> being there, but we can&#8217;t get past an entry you didn&#8217;t anticipate.</p>
<p>So here are some good places to look:</p>
<ul>
<li>Warehouse or Plant codes: Things like &#8220;MP&#8221;, &#8220;ZX&#8221;, &#8220;BQ&#8221;, etc.</li>
<li>State or Provice: TN, MO, CA, AL, NL and so on.</li>
<li>If things are numbered, so much the better.</li>
</ul>
<p>If you don&#8217;t have any of those, all is not necessarily lost. Some places will use different company names. If you have &#8220;John&#8217;s Radiator Service&#8221;, &#8220;Eastside Plumbing Corp.&#8221; and &#8220;United Radiator Supply&#8221; you could use a TDF (transformation) to extract just the first 4 characters and end up with &#8220;John&#8221;, &#8220;East&#8221; and &#8220;Unit&#8221;, which will work just fine for our purposes.</p>
<p>The main thing to remember here is that whatever you pick should indicate which variation you need to be printing, and it can&#8217;t have any spaces in it.</p>
<p>For the scope of this sample, I won&#8217;t describe how to make a TDF to do this. I will assume that we have a data file with a field in it already that contains the information we need. And we&#8217;re going to use three plant codes for our examples: &#8220;P1&#8243;, &#8220;P2&#8243; and &#8220;P3&#8243;. I&#8217;m going to call this tidbit of information our &#8220;Key&#8221;. Pretty simple.</p>
<p><strong>Getting That Into a Variable</strong></p>
<p>To be able to print a form with a variable logo on it means that our logos will have to be on subforms. There are other ways to do it, but this is the simplest and works well anywhere up to about 20 different logos/address blocks&#8230;so that&#8217;s what I&#8217;ll explain.</p>
<p>You need to get your Key into a variable that will be available no later than the subform with your logo on it will need to be printed. This could be by the end of the first page (if you intend to place the header last before going to the next page) or it could be at the start. My personal preference is to incorporate the variable as it is needed on the very command line to JFMERGE. That way, it is available even before the form itself loads, so we&#8217;re guaranteed it will be there when we need it.</p>
<p>That can be difficult in some circumstances, though, so I&#8217;ll describe how to do this with just a global variable and some preamble code&#8230;and we&#8217;ll drop the page header at the end of each page, and at the end of the job. This method is also adaptable to using multiple logos in a single print run.</p>
<p><strong>Making Your Global Variable</strong></p>
<p>There are two common ways to create a global variable while your form is running.</p>
<p>The first is to use a command like this in your FNF data:</p>
<div class="codequote">^global PLANTCODE<br />
P2</div>
<p>Or you can do this, which does the same thing:</p>
<div class="codequote">^define global:PLANTCODE P2</div>
<p>The second is to put your data into a field that has its Global attribute set:</p>
<div class="codequote">^field PLANTCODE<br />
P2</div>
<p>If you double-click on your field, you can see the button to switch on the Global option here:</p>
<div id="attachment_7" class="wp-caption alignnone" style="width: 613px"><img class="size-full wp-image-7" title="Field Options" src="http://jetformexpert.com/wp-content/uploads/2009/04/field_options.gif" alt="Field Options in Output Designer" width="603" height="285" /><p class="wp-caption-text">Field Options in Output Designer</p></div>
<p>The trick if you use the field method is that the field must be hit before you need the variable to place the changing section.</p>
<p><strong>Creating Your Changing Subforms</strong></p>
<p>You will need to create a subform for each and every possible code that you will encounter. I also recommend making one that will appear when your chosen code is empty. It will happen, and its best to print the &#8220;default&#8221; logo and/or address than to print nothing or &#8211; worse &#8211; throw an error.</p>
<p>For our sample, you would create four subforms with these names:</p>
<div class="codequote">LOGO_P1<br />
LOGO_P2<br />
LOGO_P3 and<br />
LOGO_</div>
<p>To maintain your sanity, make all of these occupy the same amount of space on the page. So, if P2 has the biggest logo and/or the longest address, make all your subforms that size and allow for that much space to be used at the top of your pages.</p>
<p>I find it useful to draw a box on my boilerplate (JFMAIN) page that takes up the required space. Just set it to no fill and invisible outline and you&#8217;ve got a nice dotted-line box that will not print. You can then create each heading right there and then copy/paste them to other pages to make subforms of them.</p>
<p><strong>Calling Your Logos</strong></p>
<p>I&#8217;ve made the decision here to demonstrate how to call the header at the end of each page. That makes this easier, but it has its limits. My hope is that if you need to do this another way you&#8217;ll be well enough equipped to try it.</p>
<p>If you have managed to get your Key into a global variable and you&#8217;ve got a newer-style form that has a SWITCHPAGE event in the JFPREAMBLE_1 docvar, then you can override that event with another one that will drop your logo and then switch the page.</p>
<p>A standard SWITCHPAGE looks like this:</p>
<div class="codequote">^define group:SWITCHPAGE       \page1\field$POSITION.</div>
<p>And we&#8217;ll copy that across to the override section of our JFPREAMBLE and edit it to look like this:</p>
<div class="codequote">^define group:SWITCHPAGE \positionabsolute,&#8221;0.5&#8243;,&#8221;0.5&#8243;,in\subformLOGO_@global:PLANTCODE.\page1\field$POSITION.</div>
<p><strong>positionabsolute</strong><br />
This inline text text control command tells JFMerge to place the &#8220;pen&#8221; where it will place the next thing it does at a specific point on the page. You can get this measurement by getting to coordinates of that invisible box you drew, or you can put a field there and use positionsave and positionrestore to get the same effect. If you were going to put this together as a set of standard paste-in functions for a number of forms, you might go with that instead.</p>
<p><strong>@global:</strong><br />
This construct definitively calls for a global variable of a specific name. In our case, that&#8217;s PLANTCODE. You could use @PLANTCODE. and get the same effect, but I feel the inclusion of the word &#8220;global&#8221; eliminates any possible ambiguity. It&#8217;s a style thing.</p>
<blockquote><p>A note about my syntax: You will notice that in my preamble code I always type the names of variables and field names (things I have decided) in UPPERCASE, and all reserved words, commands and so forth are all in lowercase.  I do this from habit, but you cannot argue that it doesn&#8217;t make a tough preamble easier to read.</p></blockquote>
<p><strong>What About the Last Page?</strong></p>
<p>You may well ask what happens on your last page, when there is no page being switched <em>to</em>, there will be no SWITCHPAGE fired and therefore there will be no logo. Add an event like this to your JFPREAMBLE:</p>
<div class="codequote">^define group:JfEndData!EndData \positionabsolute,&#8221;0.5&#8243;,&#8221;0.5&#8243;,in\subformLOGO_@global:PLANTCODE.\page1.</div>
<p>The JfEndData!EndData group will only ever fire once for every data file that you process. It will be the last thing that JFMerge will fire when your data file comes to an end. For our purposes, this is perfect.</p>
<p><strong>Samples</strong></p>
<p>Of course there are samples!  I&#8217;ve created a data file and a couple of forms in Output Designer 5.6 that demonstrate these concepts, and that should actually work.  Now that you&#8217;ve read the article (you did read it, didn&#8217;t you?) you can download the samples.  I&#8217;ve put some comments in them to help you along.  There are two data files that show how a single logo selection works as well as how you can change the logo even as you move through the data file.</p>
<blockquote><p><a title="Dynamic Logo Sample" href="http://jetformexpert.com/wp-content/uploads/2009/04/dynamic_logos.zip"><img src="http://jetformexpert.com/wp-content/uploads/2009/04/tar.png" alt="ZIP File" align="middle" /> Click here to download the samples that go with this article.</a></p></blockquote>
<p><strong>More Complex Exercises</strong></p>
<p>It is possible to use more than one key to determine which logo or address you should print.  You could use a combination of a plant code and a country code, for example, and end up with subform names like this:</p>
<div class="codequote">LOGO_P2_US<br />
LOGO_P2_CA<br />
LOGO_P2_MX</div>
<p>What you <em>really</em> need to remember if you decide to do this is that your number of combinations can quickly spiral out of control.  If you had ten plants in 3 countries, that&#8217;s 30 combinations right there.  Then you&#8217;d need to create LOGO__US, LOGO__CA, LOGO__MX, LOGO_P2_, LOGO_P1_ and so on and so on to allow for possible empties.</p>
<p>In such a case as this, I&#8217;d recommend trying to come up with something else to use as the Key.  Really, I would.</p>
<p>If you must do something like this and you can keep your 2 keys separate (say you have a code for the address and another code for the logo), then you just create subforms for logos and subforms for addresses, and use them both.  Not too hard that way.</p>
<p>As with all things JetForm, there are probably more than a dozen perfectly good ways to do this.  This is just one of them.</p>
]]></content:encoded>
			<wfw:commentRss>http://jetformexpert.com/2007/06/changing-logos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

