#1
|
||||
|
||||
![]()
sometimes I need to compose simple letters with names, addresses and dates. The problem is that it's never today's date. Or any predictable date. The customer simply tells me the date when they give me the data file. The date is NOT in the data file. Is there a way using OnRecordStart to bring up a dialog box and ask for the date to use? I've tried using window.prompt("Enter Date ","") but have not been getting very far.
Thanks George |
#2
|
|||
|
|||
![]()
I just have this as a regular rule.
Code:
return FormatDate(Today(), "lm d, yyyy");
__________________
Windows 7 64BIT Intel - I7 chip - 3.33Ghz - 6GB ram ![]() 8.0 Creator/8.0 Producer/CS5.5 |
#3
|
||||
|
||||
![]()
rpaterick,
Thanks for the reply, but that simply provides today's date. I never know what date goes on the letters till the customer tells me what date they want on the letters when they send the data file. In a perfect world the program would ask me for the date when it starts to compose. Thanks George
__________________
Fusion Pro Desktop 6.2P1a Windows 7 64 bit Home Premium Acrobat 8 Pro Ver 8.2.0 |
#4
|
|||
|
|||
![]() Quote:
__________________
Windows 7 64BIT Intel - I7 chip - 3.33Ghz - 6GB ram ![]() 8.0 Creator/8.0 Producer/CS5.5 |
#5
|
||||
|
||||
![]()
Hi George,
Since the date is not "predictable" it is difficult to create some kind of automated function. We had to deal with this same issue and through talking with the customer we were able to determine exactly why the dates were the they they were. In turn we found a way to calculate them. If there is actually no way to calculate them then somebody needs to enter them somewhere. There are a couple of options: 1. Simply open the rule editor and enter the date you want to use like this: At the top of the JavaScript Globals Code:
date = "03/15/2010" Code:
return "Static text before the date " + date + " with the rest of the text after the date." StartDate EndDate January 01, 2010 February 01, 2010 Enter this in the JavaScript Globals: Code:
//Set the Date Matrix to retrieve the customer values //Since it is in the root directory no path is needed to locate the file. DateMatrix = new ExternalDataFileEx("DateMatrix.csv", ",") Code:
//Set the date variables StartDate = DateMatrix.GetFieldValue(1,"StartDate"); EndDate = DateMatrix.GetFieldValue(1,"EndDate"); Code:
//Use the date variables entered in OnJobStart return "Start Date: " + StartDate + " -- End Date: " + EndDate DateTest.zip |
#6
|
||||
|
||||
![]()
Remember that FusionPro Desktop is intended primarily as a design tool for building FusionPro jobs (templates), not really as an end publishing tool. While you can certainly compose your job in FP Desktop, the real power of FusionPro is in its batch (automated) composition capabilities. This batch capability is available in FusionPro Server and FusionPro Direct, in our Web-to-Print solution MarcomCentral, and in many other third-party Web-to-Print solutions which integrate FusionPro behind the scenes. In most of these environments, FusionPro Server is running as a batch process, often on a dedicated, remote server machine, with no GUI context for displaying a dialog to an end user at composition time.
Also, while FusionPro does leverage the standard JavaScript 1.5 library, which has its roots in the Netscape/Mozilla Firefox browser and was originally designed for client-side web page scripting, only the core language elements are integrated with FusionPro, and web-specific objects and functions such as window and alert which you might see in online examples of web-specific JavaScript code are not relevant to FusionPro rules. Your "input" in a FusionPro rule is (primarily) the data file, not a web form, and your "output" is, well, your output, not a web page. (However, in addition to returning things that go into text and graphic frames in your composed output, you can also use functions such as Print in FusionPro rules to write to your log file.) So, if you want a context for an end user to be able to enter data in a text box of some kind, either in a desktop or a web application, you will need to create the app and integrate FusionPro Server. In FP Desktop, you will have to manually change either a file from which FusionPro is reading data, or something hard-coded in the job (in a rule or text frame) before composing. Doug's solution is a good one.
__________________
Dan Korn FusionPro Developer / JavaScript Guru / Forum Moderator PTI Marketing Technologies | Printable | MarcomCentral I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com. Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs. This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data. Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages. Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance. Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support. How To Ask Questions The Smart Way The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript. Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5. return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)}); ![]() |
#7
|
|||
|
|||
![]()
I agree with Dan. Doug's solution is a very good one, which I will probably incorporate in some of my work soon. (Thanks Doug!)
However, there is something that everyone may be missing that looks to me to be a very simple fix. Quote:
![]() Just my $0.02.
__________________
Lester Sjoblom Knight Printing FP Desktop 6.2P1a • FP Designer 6.0P1e | Acrobat Pro 9.5.1 | Mac OS 10.5.8 • 2.8 GHz Intel Core 2 Duo • 4 GB 800 MHz DDR2 SDRAM |
#8
|
||||
|
||||
![]()
George,
I have a sort-of-work-around that you can try to use. Why not code the date in a text file that can be read in and assign that date at the very beginning of composition? Try this.... 1) Create a text file called "dateFile.txt" and store it in the same location as the template you are running. In this file give it a record header of "projDate" and then on the next line place whatever date your client wishes to have appear on this run of the letter. 2) In the template itself encode these two rules... as an OnJobStart rule... assignDate = new ExternalDataFileEx("dateFile.txt", "\t"); projectDate = assignDate.GetFieldValue(1, "projDate"); then as a regular text rule... return projectDate 3) You can format the date however you wish within step 2 and use it wherever you wish then in the template by referring to the text-rule you assigned in step 2. By doing this you do not need to alter the template in anyway in order to change the value of "projectDate". It will be assigned whatever value that you place in the text file "dateFile.txt" which can be changed over and over again prior to the start of a composition. And it will be read in and assigned anew everytime the project is run. Hopefully this is a bit more than just 2 cents worth. Good Luck. .
__________________
David A. Sweet Variable Data Specialist HKM Direct Market Communications Windows 7, Acrobat 10.x FusionPro Desktop and Server 10.0.26 |
#9
|
||||
|
||||
![]()
So I'm so late responding.... Been out a few days. Thanks to all those who replied. Dan...Your server explanation made perfect sense. Thanks also to those who suggested the external file. I can see where that can be used in a number of places.
Thanks again George
__________________
Fusion Pro Desktop 6.2P1a Windows 7 64 bit Home Premium Acrobat 8 Pro Ver 8.2.0 |
#10
|
|||
|
|||
![]()
An external file may be a great solution, but if the date doesn't change from record to record, but may be placed in a number of locations, why not just create a rule that returns a specific date and use the rule in the areas where you need the date returned?
Code:
return "January 17, 2010";
__________________
Lester Sjoblom Knight Printing FP Desktop 6.2P1a • FP Designer 6.0P1e | Acrobat Pro 9.5.1 | Mac OS 10.5.8 • 2.8 GHz Intel Core 2 Duo • 4 GB 800 MHz DDR2 SDRAM |
![]() |
Tags |
onrecordstart, prompt |
Thread Tools | Search this Thread |
Display Modes | |
|
|