albgjr Posted September 16, 2010 Share Posted September 16, 2010 Hi everyone... I have a project where text fields in the database has "leading spaces" that needs to be preserved when used in FusionPro text box. I notice that when the field is the first in the line, FusionPro "remove or ignore" the leading spaces. If I add any character in front of the field, FusionPro display the leading spaces properly... Any ideas? I do need the leading spaces and I cannot afford to "add" anything in front of the field... Help?!?! Thanks in advance... AG Quote Link to comment Share on other sites More sharing options...
cquinlin Posted December 20, 2012 Share Posted December 20, 2012 I am having the same problem... I haven't found an answer on this forum yet for this... can anyone help??? Quote Link to comment Share on other sites More sharing options...
esmith Posted December 20, 2012 Share Posted December 20, 2012 Can you provide a visual example of RIGHT and WRONG? I would think you would use a tab instead of multiple spaces. You could also try using multiple non-breaking spaces -- -- although I would think a custom tab would be more effective. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 20, 2012 Share Posted December 20, 2012 (edited) Make a rule with the same name as the field and this syntax (replacing your field name): return TaggedTextFromRaw(Field("YourFieldName")).replace(/^(&[size=3]#[/size]32;)/, ' ');Make sure to check "Treat returned strings as tagged text". Or, if you have multiple fields for which you want to do this, you can do this in OnRecordStart instead: for (var f in FusionPro.Fields) FusionPro.Composition.AddVariable(f, TaggedDataField(f).replace(/^(&[size=3]#[/size]32;)/, ' '), true); Edited December 20, 2012 by Dan Korn Prevent vBulletin from replacing entities Quote Link to comment Share on other sites More sharing options...
cquinlin Posted January 3, 2013 Share Posted January 3, 2013 Thank you guys... I figured out the leading spaces problem; however, as you can see from the difference in these screenshots, the last two columns are not aligning. In the data I will be using, each line is a separate field with a set number of spaces between each variable per line. It looks like fusion pro is not reading the spacing accurately. Can you help??? Test image: http://i1298.photobucket.com/albums/ag42/cquinlin/test_zps2cbaf1a6.jpg The final result should look like: http://i1298.photobucket.com/albums/ag42/cquinlin/20130103_124108_zpsb81cedb6.jpg Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 3, 2013 Share Posted January 3, 2013 Thank you guys... I figured out the leading spaces problem; however, as you can see from the difference in these screenshots, the last two columns are not aligning. Just set the table cells to be right-aligned. Quote Link to comment Share on other sites More sharing options...
cquinlin Posted January 3, 2013 Share Posted January 3, 2013 Dan, The data is currently not in any table in Fusion pro...I have been calling for each line of text directly from the data...(Each line is one cell in my csv file). Is there a way to make a table from an individual cell? If so, I am unaware of how to do this. Thank you. Colin Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 4, 2013 Share Posted January 4, 2013 The data is currently not in any table in Fusion pro...I have been calling for each line of text directly from the data...(Each line is one cell in my csv file). Well, the picture you posted pretty much shouts out "table" to me. So if you're not making a table, you probably should be. Or, set some tab stops to align on the decimal point. Then the rule could simply replace sets of spaces with <t> tags, like so: for (var f in FusionPro.Fields) FusionPro.Composition.AddVariable(f, TaggedDataField(f).replace(/\s{1,10}/g, "<t>", true);Is there a way to make a table from an individual cell? If so, I am unaware of how to do this. I don't understand the question. You could make a table with a single cell, sure, but I'm not sure what that would get you. At any rate, it's hard to tell why you're getting the output you're getting without seeing the job. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.