#1
|
||||
|
||||
![]()
The JavaScript table object in FusionPro 7.0, new FPTable, must be declared at the beginning of a table, followed by the number of columns that the table will use. Columns are defined in 100ths of a point. The example below shows 4 columns that are each an inch wide. The number of rows can be added row by row, or at the beginning of the table.
Code:
new FPTable; var myTable = new FPTable; myTable.AddColumns(7200, 7200, 7200, 7200); myTable.AddRows(2); Code:
return myTable.MakeTags(); Code:
myTable.Rows[0].Cells[0].Content = "Hello"; myTable.Rows[0].Cells[1].Content = Field("FName"); myTable.Rows[0].Cells[2].Content = "Goodbye"; myTable.Rows[0].Cells[3].Content = Field("LName"); Code:
myTable.Rows[1].SetContents("Hi", Field("FName"), "Bye", Field("LName")); Code:
myTable.Rows[2].Cells[0].Content = "Bon Jour"; myTable.Rows[2].CopyCells(0, 1,2,3); Code:
myTable.Rows[0].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left"); myTable.Rows[0].CopyCells(0, 1,2,3); The following pages show more examples of ways to format a cell. Shading: Two properties for Shading are Shade Color and Shade Percent. Code:
myTable.Rows[1].Cells[0].ShadeColor="Black"; myTable.Rows[1].Cells[0].ShadePct=20; Code:
myTable.ShadingColor1 = "Blue"; myTable.ShadingPct1 = 20; myTable.ShadingRepeat1 = 1; myTable.ShadingColor2 = "Red"; myTable.ShadingPct2 = 40; myTable.ShadingRepeat2 = 1; myTable.ShadingType = "ByRow"; //or "ByColumn" The 2 border properties include thickness and location. Values for thickness are "Thin", "Medium," "Thick" and "None". If no parameter is specified, the border will default to none. Values for location are "Top," "Bottom," "Right" and "Left". Code:
myTable.Rows[0].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom); The 3 properties for font formatting are Font Face, Text Color and Point Size. Code:
myTable.Rows[2].Cells[0].Font="Times New Roman"; myTable.Rows[2].Cells[0].TextColor="Red"; myTable.Rows[2].Cells[0].PointSize=15; Below is an example of how to apply Bold and Italic formatting to text in a cell: Code:
myTable.Rows[2].Cells[0].Bold="On"; myTable.Rows[2].Cells[0].Italic="On"; To use table margins, the new FPTableMargins object must be declared. Once the new FPTableMargins object is called, the 4 parameters that can be used are Top, Bottom, Left and Right. The margins for top and bottom are called out in 10ths of a point. For left and right they are called out in 100ths of a point Code:
myTable.Rows[2].Cells[0].Margins = new FPTableMargins; myTable.Rows[2].Cells[0].Margins.Top = 50; myTable.Rows[2].Cells[0].Margins.Bottom = 50; Rotation: The contents of a cell can be rotated by using the rotation property. Valid values for rotation are 0, 90, 180, or 270. Code:
myTable.Rows[3].Cells[0].Rotate = 90; Code:
myTable.Rows[3].Cells[0].HStraddle = 2; myTable.Rows[3].Cells[2].VStraddle = 2; Code:
myTable.Rows[3].Cells[0].HAlign = "Left"; myTable.Rows[3].Cells[1].HAlign = "Right"; myTable.Rows[3].Cells[2].HAlign = "Center"; Code:
myTable.Rows[3].Cells[0].VAlign = "Top"; myTable.Rows[3].Cells[1].VAlign = "Bottom"; myTable.Rows[3].Cells[2].VAlign = "Middle"; It is possible to specify a row in a table to be a header type and a footer type. When a row is specified as a header or footer, it will repeat on overflow pages. Code:
myTable.Rows[0].Type = "Header"; myTable.Rows[4].Type = "Footer"; Code:
myTable.Rows[0].Type = "Skip"; //removes the row from the table Code:
var myTable = new FPTable; myTable.AddColumns(7200, 7200, 7200, 7200); myTable.AddRows(3); myTable.Rows[0].Cells[0].Font="Times New Roman"; myTable.Rows[0].Cells[0].TextColor="Red"; myTable.Rows[0].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left"); myTable.Rows[0].CopyCells(0, 1,2,3); myTable.Rows[0].Cells[0].Content = "Hello"; myTable.Rows[0].Cells[1].Content = Field("FName"); myTable.Rows[0].Cells[2].Content = "Goodbye"; myTable.Rows[0].Cells[3].Content = Field("LName"); myTable.Rows[1].Cells[0].Font="Arial"; myTable.Rows[1].Cells[0].TextColor="Blue"; myTable.Rows[1].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left"); myTable.Rows[1].CopyCells(0, 1,2,3); myTable.Rows[1].SetContents( "Hola", Field("FName"), "Adios", Field("LName")); myTable.Rows[2].Cells[0].Font="Times New Roman"; myTable.Rows[2].Cells[0].TextColor="Green"; myTable.Rows[2].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left"); myTable.Rows[2].CopyCells(0, 1,2,3); myTable.Rows[2].SetContents( "This", "Row", "is", "Green"); return myTable.MakeTags(); PDF version of this document
__________________
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)}); ![]() |
#2
|
||||
|
||||
![]()
Dan,
Is there anything in the works about being able to do this simpler form of JavaScript programming to create charts on the fly as well? Thanks .
__________________
David A. Sweet Variable Data Specialist HKM Direct Market Communications Windows 7, Acrobat 10.x FusionPro Desktop and Server 10.0.26 |
#3
|
||||
|
||||
![]() Quote:
What kind of dynamic chart generation are you looking for? If you want to suggest an API or post an example of the kind of code you'd like to be able to write, I can make an enhancement case for it.
__________________
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)}); ![]() |
#4
|
||||
|
||||
![]()
We do a lot of 401K and other such financial statements for certain clients. They currently have their information in a table form, but they are telling us that they are looking elsewhere to do this since other companies are telling them they can more visually pleasing and easier to read charts in a smaller area than we can with FusionPro (3D, single slice exploded pie, legend numbers within the chart bars and slices, etc.) Currently I'm just looking to being able to program even the simple charts within FusionPro instead of having to make a separate .txt file for each chart.
.
__________________
David A. Sweet Variable Data Specialist HKM Direct Market Communications Windows 7, Acrobat 10.x FusionPro Desktop and Server 10.0.26 |
#5
|
||||
|
||||
![]() Quote:
Code:
var chart = '<row type=header><cell>foo<cell>bar<cell>abc'; chart += '<row><cell>' + Field("foo"); chart += '<cell>' + Field("bar"); chart += '<cell>' + Field("abc"); return chart;
__________________
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)}); ![]() |
#6
|
||||
|
||||
![]()
Thanks, that helps. However, I have another question and a comment in regards to charting.
My question is how do I put a border on a pie chart? If one of the colors that you are requested to use is white...then that slice of the pie actually looks like it is missing. There is no border around the individual slices nor the whole circle of the pie itself. I've even checked to see that the property "Draw Chart Border" is checked, but nothing shows for either a regular or an exploded pie chart. How do I get a border? My comment is in regards to adding "custom" colors to the chart. I would like to be able to name these colors instead of just having a bunch of colors named "custom". Thanks. .
__________________
David A. Sweet Variable Data Specialist HKM Direct Market Communications Windows 7, Acrobat 10.x FusionPro Desktop and Server 10.0.26 |
#7
|
||||
|
||||
![]()
Please start a new thread with your chart-specific questions, so that we can keep this thread about the table API. Thanks.
__________________
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)}); ![]() |
#8
|
|||
|
|||
![]()
New question regarding tables: is there a way to center a table when it is included in a left-justified text frame? If I have body copy for a letter where I want to insert a 3-column table, but I want the table centered left to right, it appears that selecting the table rule in the text frame and clicking the center button does not work. Is there a property for alignment?
|
#9
|
||||
|
||||
![]() Quote:
Unfortunately, though, there's no property in the JavaScript Table API which corresponds to this. However, it's pretty easy to modify the tagging returned from the FPTable.MakeTags function, like so: Code:
var TableTags = myFPTableObject.MakeTags().replace(/^\<table/, "<table alignment=center");
__________________
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)}); ![]() |
#10
|
|||
|
|||
![]()
Can this be used to solve the problem in this thread?
http://forums.pti.com/showthread.php...border+graphic Meaning, can you make a dynamic table cell that fits to an uploaded graphic then make a border around it?
__________________
-- FP Creator 9.2.30 / Acrobat Professional XI / Digital Storefront 7.4 |
![]() |
Tags |
javascript, tables |
Thread Tools | Search this Thread |
Display Modes | |
|
|