|
|||||||||
|
Crystal Reports Tools: Improve Performance While Saving Time and Money |
|
Crystal Reports: Heading List of Multi-value RangesTo display a multivalue range you will need this formula:stringvar d :=""; //start with empty string numbervar i; //counter for the loop datevar d1; datevar d2; // two variables to use in calculations for i:=1 to count({?What Date}) do ( // for each parameter in the list d1 :=minimum({?What Date} [i]); // Store first date in the range into d1 d2 :=maximum({?What Date} [i]); // Store last date in the range into d2 if d1 <>d2 then d := d + ", "+ // they are different so must be a range Totext(d1,"dd-MMM-yyyy") + " to " + Totext(d2,"dd-MMM-yyyy") else d := d + ", "+ Totext(d1,"dd-MMM-yyyy") ;) ; // otherwise just show one value "Date List: " + mid(d,3) // remove the first two characters (a comma and a space)
You can also put a range in the footer where the data aren't sorted. For example, we wanted to show the highest and lowest value of a field’s values on the page. The solution is a slight variation on the solution we used for the index in the page footer: A formula in the Page Header: (Supress)
A formula in the Details: (Supress)
A Formula in the Page Footer:
This technique can be used only on the page footer. The page header can only see the record at the top of the page. It is not aware (yet) of the other records to be printed on the page.
Speaking of footers, you can use two page footer sections for odd and even page footers. If you look at any professionally prepared bound, double sided publication you will see the page footers are different on the odd and even pages. The Even numbered pages on the left of the binding often have the page numbers on the left, and other copyright information on the right, while the right hand, odd numbered pages have these fields the other way around. The theory is that if you are looking for a specific page number, then you can thumb along the pages and see all the page numbers on the outer edge of the document. You can achieve the same effect in your Crystal Reports by using a Page Footer a and Page Footer b section with the two layouts you want. Then conditionally suppress the sections using a formula of Remainder(PageNumber,2)=0 //To suppress if page number is even And Remainder(PageNumber,2)=1 //To suppress if page number is odd You might also want to use the section formatting option "Reserve Minimum Page Footer" to give you a little more room for data on the page.
This article is copyrighted by Crystalkeen, Mindconnection, and Chelsea Technologies Ltd. It may be freely copied and distributed as long as the original copyright is displayed and no modifications are made to this material. Extracts are permitted. The names Crystal Reports and Seagate Info are trademarks owned by Business Objects. |