Best Practices for a multi-line listing

Best Practices for a multi-line listing

Forum member · Aug 16, 2006
I'm working on a project that creates a directory of sorts using data from our database. Each "listing" will have multiple lines: Company Name Company Address Company City, St Zip Company Telephone Company Fax Company Email Company Website Company Contact Name One of the requirements is that a listing not get broken across columns. I am setting up the page to layout 4 columns of listings. I have everything working by creating a table for each listing, which I can measure to see if it will fit on the bottom of the page and if not move it to the next column or page. Then I ran into a problem with links. We want the email and website address to be URLDestinations. I cannot find a way to make a cell or the text in it a link, due to how you have to set the coordinates of the link. My question is, is there a way to make a cell or the text in it a link when you have no idea of the positioning of the table? If not, is there another way other than using a table that I can create my listing as a number of lines that must stick together where I can measure the entire height of the listing before putting it on the page? Any help would be appreciated. Thank you, Trent Grandey

Re: Best Practices for a multi-line listing

Support · Aug 17, 2006
Hello Trent, Yes, you can add Links or any page element to the cell of a table. The positioning of the page elements within the cell are relative to the X and Y coordinates of the cell and not with respect to the X and Y coordinates of the page. You can declare a table with any size and add it at any X, Y coordinates on the page. You can later modify the height of the Table or its X and Y coordinates depending on your requirement. Following is the link to the Help Documentation on our website that shows how to Add PageElements to Cell of the table. Thanks, ceTe Software Support Team

Re: Best Practices for a multi-line listing

Forum member · Aug 17, 2006
Thankyou for your reply, but from what I can tell, the x,y coordinates of the link are not staying relative to the cell. To test: Start new Win Forms VB project. Add button to form, double-click the buton and copy the following into the onClick method for the button... Dim d As Document = New Document Dim p As Page = New Page(PageSize.Letter, _ PageOrientation.Portrait, 50) d.Pages.Add(p) p.Elements.Add(New TextArea("now is the time for all good men to come to the aid of their country", 0, 0, 500, 330)) p = New Page(PageSize.Letter, PageOrientation.Portrait, 50) d.Pages.Add(p) Dim curY As Integer = 0 For s As Integer = 1 To 10 Dim t As Table = New Table(10, curY, 60, 20) t.Columns.Add(60) Dim r As Row = t.Rows.Add() Dim ag As AreaGroup = New AreaGroup(60, 20) ag.Add(New Link(0, 0, 60, 20, New XYDestination(1, 10, 10))) ag.Add(New TextArea("Test Link", 0, 0, 60, 20)) r.Cells.Add(ag) p.Elements.Add(t) curY = curY + 70 Next d.Draw("C:\MyOutlines.pdf") System.Diagnostics.Process.Start("C:\MyOutlines.pdf") Application.Exit() Then run the project. When you click on the button, you should get a 2 page PDF with one line of text on the first page and 10 tables on the 2nd page with the text "Test Link" in each. From what I understand, each link should point to page 1, point 10,10. For me, the only one that works is the first table. Now, edit the code in the onClick handler to make the link's coordinates based on the x,y of the page: ag.Add(New Link(0, curY, 60, 20, New XYDestination(1, 10, 10))) Now the link is placed based on the X,Y of the page. Rerun the project, click the button and you should now have a PDF where all the links on page 2 work correctly. While this works for this example, it doesn't help me as I have a method that creates the table and then when it is sent back the height is calculated and X,Y of the table is determined. As far as I can tell, there is no way to get to the link and update the X,Y at this point. So, if you get the same results, then am I missing something? Is there a way to get the link to follow the X,Y of the cell it is in? I hope I have provided a good enough example of my problem. Thank you again, Trent

Re: Best Practices for a multi-line listing

Support · Aug 18, 2006
Hello Trent, Ability to place the link inside the cell and positioning it relative to the cell is a known issue. The link page element will be placed relative to the page. The issue is little complex and it will be addressed in v5.0 of our product. For the time being you will have to determine the X and Y co-ordinate by performing some calculations on the table. For example; if you wish to add the link to fourth row of the table and in second cell, sum up the height of the four rows and then calculate the width of the two cells based on the column width you define and this way you can find out the co-ordinates for placing the link. Thanks, ceTe Software Support Team