| Author |
Message |
premnathk.chn
Newbie
Joined: 17 Jan 2008
Online Status: Offline
Posts: 19
|

Topic: Tables & Table of contents - Help Posted: 17 Jan 2008 at 10:27pm |
|
Hi,
Is it possible to draw tables(2*3,3*3 ..etc) and to have dynamic Table of contents in crystal report XI like we have in Ms-Word.
Thanks in advance.
regards,
prem
|
IP Logged |
|
|
|
Lugh
Senior Member
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
|

Posted: 18 Jan 2008 at 5:08am |
|
It is possible to have those kinds of tables in Crystal. Though, in general, one has to ask: What do you want them for? Because that strongly determines which technique you use to create them.
I used to have a bookmark to a solution for the Table of Contents issue. It was rather ingenious. Unfortunately, I appear to have lost it, and I don't remember how it goes. The basic problem is that page numbers don't get assigned until the "whileprintingrecords" pass. There isn't another pass after that. So, it becomes extremely tricky to send the page numbers back to the beginning of the report to be in the ToC.
One solution that I do recall was to actually print the ToC in the report footer, then, after you've printed everything out, just move it to the front. Because it's at the end of the report, you can collect the page numbers as the report processes. The basic problem is that this really only works for reports that are destined for hard copy distribution, as you can't really expect users to navigate to the end of the report to see the ToC online.
|
IP Logged |
|
premnathk.chn
Newbie
Joined: 17 Jan 2008
Online Status: Offline
Posts: 19
|

Posted: 20 Jan 2008 at 11:23pm |
|
Hi Lugh,
Thanks for ur reply.
I need to generate Employee details table with column names such as Employee name, Emp Id, Date of birth and Salary. If there is any way to draw table with exact column width and alignment.
Also you have mentioned to move the TOC after printing the report. That means i have to manually move the TOC to the start of the page of the generated report or if there is any automated way to do that...?
Regards
Prem
Edited by premnathk.chn - 20 Jan 2008 at 11:24pm
|
IP Logged |
|
Lugh
Senior Member
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
|

Posted: 22 Jan 2008 at 5:53am |
|
With what you're talking about with the table, I think that you are actually describing Crystal's default behavior. In what way does a standard report not provide this for you? Are you looking for gridlines? Are you looking for justified text?
You'd have to manually move the page (unless you can perform crazy printing stunts that I am unaware of). Essentially, your ToC is actually the last page to print. After it prints, you pull it off the bottom of the stack, and put it on top.
|
IP Logged |
|
premnathk.chn
Newbie
Joined: 17 Jan 2008
Online Status: Offline
Posts: 19
|

Posted: 22 Jan 2008 at 10:39pm |
|
yes i want my tables to have gridlines. i want it exactly like how a table would appear if drawn through MS-Word.As i browsed i found that lines and boxes are only options and there is no direct option like drawing tables of our desire rows and columns.
Everything was fine with manually drawing a table but the problem occurs when i had to supress one of my coulmn when there is not even one single value available under it. is it possible to supress a coulmn as a whole.
i have drawn a box and drawn vertical lines within it to make it look like a table. is it correct or am i missing something.
|
IP Logged |
|
Lugh
Senior Member
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
|

Posted: 23 Jan 2008 at 4:56am |
|
There are a couple options here.
The simplest is to use the box and line objects, as you have done. Note that these can cross sections, in order to, say, include column headers within the box. Be sure to explore the formatting options of the lines and boxes, as there are options there which will make things look nicer.
You can designate your fields to have borders. If you size your fields such that they all touch, the borders will generally end up looking like a grid. This can be tricky to get looking right, but also has some additional options for formatting.
As to suppressing a column, it's not easy. Having Crystal move fields dynamically is possible, but it requires some tricks. If you right-click on a field, and go into the Size and Position dialog, you will see that the X value has a formula button next to it. You can move it around, based on various criteria. But, keep in mind that you will have to not only test to see if this column is empty, but test to see which of the columns to the left are empty. (Incidentally, the simplest way to test for an empty column is to use COUNT ({MyReport.MyField}). If this is 0, the column is empty.)
|
IP Logged |
|
premnathk.chn
Newbie
Joined: 17 Jan 2008
Online Status: Offline
Posts: 19
|

Posted: 23 Jan 2008 at 8:13pm |
Lugh,
Thanks for your reply.
I tried what you have told but even there i had the below mentioned problem
Problem:
for eg. if have three columns, as per the solution i will put three textbox with the right or left border but what happens even if one of the text box content grows not all the text box height increaes automatically. so in that case the alignment is worse. any solution for this?
regards,
Premnath K
|
IP Logged |
|
Lugh
Senior Member
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
|

Posted: 24 Jan 2008 at 4:18am |
|
Ah, now you're getting into some tricky scenarios. Fortunately, there's a relatively simple, if non-obvious, solution.
Create vertical lines going from the header to the footer, across all the detail sections. You can also make these with boxes, if that helps keep the top and bottom of the grid looking nice.
Then, create a second details section below your existing details section. This section should contain nothing but a horiztonal line. This will form your horizontal gridlines. By putting it in a separate details section, it will be moved up an down as your text boxes grow.
|
IP Logged |
|
premnathk.chn
Newbie
Joined: 17 Jan 2008
Online Status: Offline
Posts: 19
|

Posted: 24 Jan 2008 at 8:39pm |
|
Thanks lugh!!
But will this help me in achieving my ultimate goal of supressing a whole column when all the values under it is empty?
If yes kindly explain as very new to CR
regards,
Prem
|
IP Logged |
|
Lugh
Senior Member
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
|

Posted: 25 Jan 2008 at 5:12am |
|
You know, it might at that.
How many columns do you have that might need suppressing? If it's a fairly small number, there is an option. You can put each possible configuration in a separate details section. E.g., create one details section with columns 1, 2, and 3. Create another with 1, 3, and 4. Create a third with 1, 2, and 4. Et cetera. Then, just suppress all the detail sections except the one you want. Your details section with the horizontal line is not suppressed, and will be printed below.
The tricky bit with that might be making sure the vertical lines continue to line up. The simplest solution is to make all the columns the same width, and just suppress any boxes at the end that aren't needed.
|
IP Logged |
|
|
|