Current page of nested table

Current page of nested table

Forum member · Mar 12, 2007
Hello all, I am creating a directory that will have nested tables. I am curious as to how I would find the page number of table 'Z' below given the following layout and knowing that I will use overflow for my tables: OutermostTable (X) InnerTable (Y) InnerMostTable(Z) Here is how I will use this in the real world. OutermostTable (City) InnerTable (Doctor Specialty (i.e. Surgery, or Cardiology)) InnerMostTable (Doctor Information) There could potentially be 100's of doctors within a specialty within a city, which will require the use of overflow. I would like to get the page number of the innermost table when it is created to put in an index of the directory. Is this possible? If so, does anyone know how to do it?

Re: Current page of nested table

Support · Mar 12, 2007
Hello, There is no direct method to find out what page number the innermost table gets added to. You will need to keep track of page numbers as you are building the document. In other words keep a counter of the pages that you add to the document so that when you reach the point where the innermost table is about to get added, you will have the page number that you are on and this is the page you will use to create the link on your index page. Thanks, ceTe Software Support Team

Re: Current page of nested table

Forum member · Mar 12, 2007
Okay... let me see if I understand this. Here is some sample code that I used when building a different project. I am thinking that I could use the same code (slightly modified) for my dilemma. do { ceTe.DynamicPDF.Page page = new ceTe.DynamicPDF.Page(m_Dimensions); m_PDF.Pages.Add(page); page.Elements.Add(authGridTable); authGridTable = authGridTable.GetOverflowRows(); } while (authGridTable != null); My confusion is that I have only built something with one table... not nested tables. If I have a total of three levels of tables then would I have to have my do-while loop have two nested do-whiles also? Argh... sorry if I made things more confusing.

Re: Current page of nested table

Support · Mar 12, 2007
Hello, The way to get nested tables is by adding table to the cells of the table. That is you add the innermost table to the cell of the inner table and then add the inner table to the cell of the main table. This scenario will work well if the sizes of the tables are small and if they will fit on one page. If the tables are larger in size, it will not be advantageous to use Table page element due to the limitation of table element since the cell of the table will not split and so the nested tables might get cut off if they are longer than the size of the page. From what you described, the better way of doing this is by using Label and TextArea page element and this will give you better control over the placement of elements on the page as TextArea can be splitted between pages. Thanks, ceTe Software Support Team

Re: Current page of nested table

Forum member · Mar 12, 2007
Thank you for your reply. I would like to ask your advice on the following scenario. OutermostTable can span multiple pages InnerTable can also span pages InnerMostTable will be consistently small and should not span pages (it will show a name, address, and phone number, so it would only be a few lines tall) Lets say that the document created has 3 outermost tables (which are cities). OutermostTable1 - Los Angeles OutermostTable2 - San Diego OutermostTable3 - Palm Springs OutermostTable(n) Each of these tables will have nested within them an unknown number of doctor specialties. InnerTable1 - Pediatrics InnerTable2 - Surgery InnerTable3 - Dermatology InnerTable(n) Within each of these doctor specialty tables will be a listing of doctors that practice that specialty. So the relationship is that a doctor practices some type of specialty in some city. InnerMostTable1 - Dr. John Johnson, 1234 Doctor Dr, Los Angeles 98765 InnerMostTable2 - Dr. Beverly Rogers, 2345 Physician Way, Los Angeles 98765 InnerMostTable(n) If I know that the Innermost Table should not overflow but the Inner table can overflow, will that cause issues like you said in your post above?

Re: Current page of nested table

Support · Mar 12, 2007
Hello, Since the InnerTable can span multiple pages, you will still continue to run into the problem mentioned in the earlier post. Thanks, ceTe Software Support Team

Re: Current page of nested table

Forum member · Mar 12, 2007
Thank you for your time, I think you have saved me a big headache :)

Re: Current page of nested table

Forum member · Mar 12, 2007
I have one more question. Can I create a table that has three columns and will overflow from one column to the next on a page and if the item to be added at the end of column three (right-most column) is too large, then pop it to the next page?

Re: Current page of nested table

Support · Mar 13, 2007
Hello, Yes, you can add a table as you described. The easiest way to do this is take a table with single column and add it to the page. Then take the overflow records using the GetOverflowRows method and you can add this overflow table to the same page by changing the X position so that the second table looks like the second column and you can do the same for the third column also. After the third column you will have to add a new page and add the overflow to the new page. You can do this until the overflow table exists in a loop. Thanks, ceTe Software Support Team.