6 Replies Latest reply on Apr 21, 2005 3:10 PM by (Tammy_Rockett)

    Using Field values as part of PDF output file

      Hello,

      I was wondering if it is possible to use information in the *.dat file to create the name of the *.pdf file which will be sent (by email) to our customer automaticly.
      So let say there is a field "GLOBAL ORDNO" with a value "1042193" in the datastream and I want to have the PDF to have the filename "confirmation for order 1042193"

      Is this, or a similar construction, possible?
        • 1. Re: Using Field values as part of PDF output file
          Level 1
          There may be some way I'm not aware of to get a data field value to be used by the system as the PDF file name but I'm not aware of it. What you could do is to write your own agent to extract the desired data value and then use it for the PDF file name parameter. For example, the agent might get the value and store it in a user variable. The command line for the PDF file creation might be able to reference the user variable. If that isn't possible, then the agent could extract the value and resubmit the job with the parameter on the new ^job statement. It doesn't do any good to change the ^job parameters for the currently running job because Central saved the values when the job started and uses the saved values for each task, not any new/updated ones that a user agent might set.
          • 2. Re: Using Field values as part of PDF output file
            Level 1
            Hello Tom,

            Thank you for the answer.
            I think I understand what you mean, but I have no idea as on how to extract data from a datastream and then store it for later use.
            Could you tell me in which part of the manual I can find the information on this subject.
            • 3. Re: Using Field values as part of PDF output file
              Level 1
              You would have to write your own program, perhaps using VB, to locate the ^GLOBAL ORDNO line and then extract the data from the next physical line. The program would then put this data in the jfserver.ini file as the value for one of the User#= variables (such as "user1") that are defined there. Then the jfmerge step that creates the PDF could reference that variable (-zc:\temp,@user1..pdf). I've never used the user variables so I don't know that you can reference them like that but the manual seems to indicate it will work. It would be easy to test by manually changing the jfserver.ini file to see if it is possible. If it works, then the custom agent to extract the value and set the variable could be written. (Manually changing the file may not work because I see that the manual indicates these variables are reset at the beginning of each job, but it also states that default values can be defined within the jfserver.ini file - testing will let you know.)

              Check out the "Creating a Custom Agent" chapter in the "Working with Central" manual. In my Windows version 5.5 manual it is section 6 and starts on page 45. This not only tells what is required to set up Central to run the agent but explains about the user variables. Section 4 in the same manual explains about using substitution variables.

              Unfortunately, if you aren't a programmer it may be difficult to create the custom agent to extract the value and create the "jetform.rsp" file for setting the variable in the jfserver.ini file. We have many custom agents but none do anything like this, though it would be a simple program to write.
              • 4. Re: Using Field values as part of PDF output file
                Level 1
                Ok thanks. We do have people with (some) programming skills, so I'll try this. This is going to cause several reboots of the server :-)

                Otherwise the customer will just have to settle with a file called something like sp238739.pdf
                • 5. Re: Using Field values as part of PDF output file
                  Level 1
                  Why the reboots? I would think that at most you might need to shut down & restart the Central service to get it to reload any changes to the INI file. I can't recall when the last time was that I had to reboot besides when installing patches & SPs and we have developed several custom agents.
                  • 6. Re: Using Field values as part of PDF output file
                    You could insert a transformation step whereby the TDF extracts the data from the field and inserts it in the -aji parameter in the job card of the data file. Once the data file is then read in for the MERGE job, the JFMERGE task would print to -z@JobId..pdf, which takes the value passed in the -aji parameter on the job line, so in your jobline you would have this:
                    -aji"confirmation for order @GLOBAL_ORDNO."
                    where the variable "GLOBAL_ORDNO" was extracted using the TDF.