#1
|
|||
|
|||
![]()
I'm new to FusionPro. I'm trying to create a simple rule using Drag and Drop. I have a series of numbers (1-100) printing on cards. I want the single digit numbers to be a larger font size than the double digit numbers. My data file only has one field, "TableNo".
I have the following: If "Numeric value of" "TableNo" (my field) is less than "10" Then Return "FusionProRuleWizard.Action.Change Point Size" I'm specifying 250 pts for the point size change. When I try to insert the rule, the rule itself is printing on the page with the data and is not changing the font size as expected. I've looked at at the documentation and searched the forums but haven't been able to figure out what I'm doing wrong. |
#2
|
||||
|
||||
![]()
rjhansen,
Drag and drop is probably not the best way to accomplish this. Try an empty rule with the content below. Quote:
__________________
Richard A. Lewis, Jr. Learning Development Manager | MarcomCentral® a Ricoh Company |
#3
|
||||
|
||||
![]()
I agree that this would be easier to accomplish through a custom rule, but I think the rule as it stands is comparing a string to a string which seems like it would throw off the comparison between the two numbers. I think you probably want to re-write the if statement condition (first line) to be:
Code:
if (StringToNumber(Field("TableNo")) < 10)
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
#4
|
|||
|
|||
![]()
I've never used the drag and drop before, but I whipped up a quick sample and it worked as intended. I'm attaching a jpg screenshot of what my rule looked like in the drag and drop editor window (my field name was "Qty_S" and I used 25pt font, but you get the idea).
After I saved the rule I inserted it into a text frame and it worked fine. Incidentally, if you put in the rule that way and then click the button to convert the rule to JavaScript you get essentially the combination of what users FreightTrain and step posted.
__________________
FusionPro VDP 9.3.12 Desktop/Server Windows 7 Enterprise / Windows Server 2008 r2 Acrobat X |
#5
|
|||
|
|||
![]()
Thanks for all the input! Definitely very helpful, but I'm still having issues getting this to work. Straight off, using FreightTrain's code didn't change the point size. I suspected I needed the StringToNumber function, but I was calling it wrong. Step's suggestion showed the correct usage, but my rule still didn't work correctly.
Then I tried recreating tobarstep's Drag And Drop rule. This didn't change my point size either. Then I converted that to JavaScript and made a couple of changes and now I've got something that changes the point size on 1-9 (as expected) but it also prints the same digit at the original point size right beside the larger number. Here's the rule: if (StringToNumber(Field("TableNo")) < StringToNumber("10")) { return "<span pointSize=230>" + TaggedDataField("TableNo") + "</span>"; } return ""; And a screenshot of the first record as it previews with this rule inserted: |
#6
|
||||
|
||||
![]()
It sounds like your text frame is returning your rule as well as the variable. You should set the contents of your text frame to only return the contents of the rule and the change your rule to:
Code:
if (StringToNumber(Field("TableNo")) < 10){ return "<span pointSize=230>" + TaggedDataField("TableNo") + "</span>"; } else { return TaggedDataField("TableNo"); }
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
#7
|
|||
|
|||
![]()
Thanks Step, I suspected the same thing, but can't figure out how to fix that. Unfortunately, your suggested revision yields the same result.
|
#8
|
|||
|
|||
![]()
Step, you said "You should set the contents of your text frame to only return the contents of the rule…"
How do I do that? |
#9
|
||||
|
||||
![]()
Can you collect your template and post it to the forum with the data? It's really difficult to figure out the problem without seeing all of the factors that come into play.
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
#10
|
|||
|
|||
![]()
Here's my files.
|
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|