Hi all - Crystal Reports XI - SQL Server Database:
How do you create a TOC with 2 Group Headers?
Group Header 1: Category.... Page Number
then Group Header 2: CustomerName (indented under Category)... Page Number
Thanks for that direction - not sure if I can use that post though. Could anyone give me more of a step-by-step for the TOC? I do not want to edit registry, nor create any additonal table in the database.
--
All Help Greatly Appreciated ! Thanks.
Does the TOC have to be page 1 of the report, or could it be at the end? Are you saying that you want page numbers and indentations, etc., based on your main report that has these two groups?
Thanks Lbass,
Yes, It can be at the footer or end.
Yes page numbers based on the main report.
So something like this: (Pg Nbrs respective to page location of CustomerName)
Table of Contents PgNbr Category1
CustomerName1........1
CustomerName21......13
CustomerName36......35
etc.
Category2
CustomerName4........1
CustomerName17.......9
CustomerName48......23
etc.
If I can take this report into more advancement, the report would ideally look something like this (in 3 columns, aligned well):
if 1 < 1000 then (
redim preserve categ;
if not({table.category} in categ) then (
categ := {table.category};
redim preserve categno;
categno := pagenumber;
)
);
if j < 1000 then (
redim preserve cust[j];
if not({table.customername} in cust) then (
cust[j] := {table.customername};
redim preserve custno[j];
custno[j] := pagenumber
)
);
Insert a subreport in the report footer that uses the same tables and selection criteria and insert a group on category and a group on customer name. Suppress all other sections. Then create these formulas:
//{@displcateg} to be placed in GH1:
whileprintingrecords;
shared stringvar array categ;
shared numbervar array categno;
numbervar k := k + 1;
numbervar displcateg;
for k := 1 to ubound(categno) do(
if categ[k] = {table.category} then
displcateg := categno[k]
);
displcateg
//{@displcust} to be placed in GH2:
whileprintingrecords;
shared stringvar array cust;
shared numbervar array custno;
numbervar m := m + 1;
numbervar displcust;
for m := 1 to ubound(custno) do(
if cust[m] = {table.customername} then
displcust := custno[m]
);
displcust
If any of the arrays exceed 1000 elements, you would have to modify the formulas.
I forgot the last step. In the subreport, go to the section expert->details->format with multiple columns->layout tab->set width and gap->down then across->check "format groups with multiple columns". This would give you:
If you really need the categories in separate sections, then you could either reference only one category per subreport (add a separate subreport for each, and formatting the sub so that it cannot grow--in order to force the columns within a specified height), or, you could collect the results of {@displcust} in another variable that includes returns, is formatted to can grow, and is displayed in GF1.
There is a way to add in the dots, too, but it depends upon which display option you choose.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.