Search code examples
crystal-reports

Display static, non-repeating text in Details Section


I need the gray box in my report to print in the Details section to the right of the actual details:

enter image description here

The defect code box is a subreport that serves as a key to various defects that pop up in the details. How do I get it to appear on the right without increasing the height of the Detail section, and such that the gray box does not repeat.


Solution

  • There's a few ways to do this, but due to the nature of Crystal Reports it might be difficult to pull off.

    I'd recommend placing the white table on the left into its own subreport. Then you just arrange the subreports so one is on the right and one is on the left. That's probably the least amount of work.


    If that's not an option, you could in theory turn the gray box into a very weird, very specific formula. (Not recommended, but still doable.)

    You'd write this formula to contain a large if-else statement based on the record number. (If it's the first record, the report displays "DEFECT CODE". If it's the second record, display "SI - SLAG INCLUSION" and so on and so forth. Change the background color of the formula to gray, and suppress it if the record number goes past the final line.

    Again, I don't recommend this last suggestion, but if you absolutely can't put the white table into a subreport you can get this to work with a little elbow grease.