Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 19th, 2012, 09:04 AM
gregmaze gregmaze is offline
Junior Community Member
 
Join Date: Jul 2012
Posts: 18
Default Can text from 1 table overflow into another table?

Greetings...

I was wondering if there is a way to have text from 1 table to overflow into another? I have created a table that spans 3 columns. When I add the variables to the tables the text only appears in the 1st LONG column.

I wanted the tables to share all the data and instead of 1 column with 12 items, I would have 3 columns with 4 items.

I am including an PDF image file to show what I am looking for.

Thank you
Greg Maze
MAC OS X 10.6.8 Fusion Pro 8.0.20
Attached Files
File Type: pdf columns.pdf (58.3 KB, 28 views)
Reply With Quote
  #2  
Old September 19th, 2012, 12:08 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,305
Default Re: Can text from 1 table overflow into another table?

From the example, it looks to me that you don't really want a table at all; you actually want a text frame with three columns.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

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)});
Reply With Quote
  #3  
Old September 20th, 2012, 12:00 PM
gregmaze gregmaze is offline
Junior Community Member
 
Join Date: Jul 2012
Posts: 18
Default Re: Can text from 1 table overflow into another table?

Hello Dan,

Thanks for getting back with me. The reason I thought I needed a table was I did not think you could get a vertical rule to fit inside the table between the columns. The number of rows are variable.

So the question now is can I get a vertical rule to print in between the columns and resize it's height?

Thanks
Greg
Reply With Quote
  #4  
Old September 20th, 2012, 03:43 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,305
Default Re: Can text from 1 table overflow into another table?

Quote:
Originally Posted by gregmaze View Post
The reason I thought I needed a table was I did not think you could get a vertical rule to fit inside the table between the columns. The number of rows are variable.
Okay, well, in that case, you do need a table. All you have to do is add some simple logic to rearrange the entries so that they go three-across into table rows, instead of just all in the first column. Something like this:
Code:
var table = new FPTable;
table.AddColumns(10000, 10000, 10000);
table.SetBorders("Thin", "Black", "Top", "Bottom");
for (var r = 1; r <= 4; r++)
{
    var row = table.AddRow();
    for (var c = 0; c < 3; c++)
    {
        row.Cells[c].SetBorders("Thin", "Black", "Left", "Right");
        row.Cells[c].Content = "&bull; widget " + (r + (c * 4));
    }
}
return table.MakeTags();
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

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)});
Reply With Quote
  #5  
Old September 25th, 2012, 08:18 AM
gregmaze gregmaze is offline
Junior Community Member
 
Join Date: Jul 2012
Posts: 18
Default Re: Can text from 1 table overflow into another table?

Hello Dan,

Thank you for helping with this. I am still having a problem with this. I am including a jpg file to show what I am getting. What I am looking to get is a 3 column table that will take the amount of "widgets" and break them evenly across the 3 columns. The "widgets" are variable and the number of them will vary.

So if there were 12 "widgets" into 3 columns equal 4 "widgets" each column.
If there were 15 "widgets" into 3 columns equal 5 "widgets each column.

I would greatly appreciate any help.

Thank you
Greg
Attached Images
File Type: jpg 3-column-table.jpg (53.2 KB, 21 views)
Reply With Quote
  #6  
Old September 25th, 2012, 09:40 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,305
Default Re: Can text from 1 table overflow into another table?

Okay, change the first line for a different number of widgets:
Code:
var numWidgets = 14;

var numRows = Int((numWidgets + 2) / 3);
var table = new FPTable;
table.AddColumns(10000, 10000, 10000);
table.SetBorders("Thin", "Black", "Top", "Bottom");
var widgetNum = 0;
for (var r = 1; r <= numRows; r++)
{
    var row = table.AddRow();
    for (var c = 0; c < 3; c++)
    {
        widgetNum = r + (c * numRows);
        row.Cells[c].SetBorders("Thin", "Black", "Left", "Right");
        if (widgetNum <= numWidgets)
            row.Cells[c].Content = "&bull; widget " + widgetNum;
    }
}
return table.MakeTags();
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

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)});
Reply With Quote
  #7  
Old September 27th, 2012, 10:49 AM
gregmaze gregmaze is offline
Junior Community Member
 
Join Date: Jul 2012
Posts: 18
Default Re: Can text from 1 table overflow into another table?

Hello Dan,

Thanks for getting back to me on this.
I am still confused by this script. I understand how it works and how to add manually to the number of widgets. What I am having a problem with is how to get the number to be variable. As the customer will select from a list of items to put in the table. Ex. Widget1, Widget2, Widget3 etc. These are all in different fields. I am not sure how to count these selected fields. I am so close to completing this project and I am hung up on this.
If you could explain this a little better for someone who is not as advanced in Javascript, I would be so grateful...

Thank you
Reply With Quote
  #8  
Old September 27th, 2012, 12:00 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,305
Default Re: Can text from 1 table overflow into another table?

Quote:
Originally Posted by gregmaze View Post
I am still confused by this script. I understand how it works and how to add manually to the number of widgets. What I am having a problem with is how to get the number to be variable. As the customer will select from a list of items to put in the table. Ex. Widget1, Widget2, Widget3 etc. These are all in different fields. I am not sure how to count these selected fields. I am so close to completing this project and I am hung up on this.
If you could explain this a little better for someone who is not as advanced in Javascript, I would be so grateful...
I'm trying to generalize since I don't know all the details of your job. So you have data fields named "Widget1", "Widget2", etc., and they're either populated or empty? If so, try this:
Code:
var numWidgets = 0;
try
{
    while (Field("Widget" + (numWidgets + 1)))
        numWidgets++;
}
catch (e)
{}

var numRows = Int((numWidgets + 2) / 3);
var table = new FPTable;
table.AddColumns(10000, 10000, 10000);
table.SetBorders("Thin", "Black", "Top", "Bottom");
var widgetNum = 0;
for (var r = 1; r <= numRows; r++)
{
    var row = table.AddRow();
    for (var c = 0; c < 3; c++)
    {
        widgetNum = r + (c * numRows);
        row.Cells[c].SetBorders("Thin", "Black", "Left", "Right");
        if (widgetNum <= numWidgets)
            row.Cells[c].Content = "&bull; " + Field("Widget" + widgetNum);
    }
}
return table.MakeTags();
If that's doesn't work, then you'll need to post a more specific example of what your data file looks like, or better yet, the collected job, so that I can give a more specific answer.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

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)});
Reply With Quote
  #9  
Old September 27th, 2012, 01:38 PM
gregmaze gregmaze is offline
Junior Community Member
 
Join Date: Jul 2012
Posts: 18
Default Re: Can text from 1 table overflow into another table?

Well there is a reason why you have on a Superman Outfit...

But... of course there is a small error. I am including the collected file. It works fine if all fields are used, but if 1 field is not used every field after does nor show up.

Thank you Dan for all your help
Reply With Quote
  #10  
Old September 27th, 2012, 01:44 PM
gregmaze gregmaze is offline
Junior Community Member
 
Join Date: Jul 2012
Posts: 18
Default Re: Can text from 1 table overflow into another table?

Here is the collected file.
Attached Files
File Type: zip Excluded form for PTI.zip (402.0 KB, 15 views)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:27 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.