0
votes

I'm maintaining a project which uses a pretty hefty Crystal Report and, during moving from VS2008 to VS2010, the report just stopped working at runtime (but it still Previews just fine. Go figure.), so I'm having to reconstruct it from the ground up.

During report creation, several parts of the report are used more than once. The following section shows the basic layout of the main report page (each bullet point represents a different section of the Main Report form), along with the behaviour of each section.

On Page 1

  • The first section of the main report form is empty, but the empty space in it appears not to print
  • The second section of the main report is printed
  • The third section of the main report is not printed
  • The fourth section of the main report is printed
  • Subreport A may be printed, depending on a data element
  • Subreport B is printed
  • SubReport C is not printed
  • Main report footer is printed

On Page 2

  • The first section of the main report form is empty, but the empty space in it appears not to print
  • The second section of the main report is printed
  • The third section of the main report is printed
  • The fourth section of the main report is not printed
  • Subreport A is not printed
  • Subreport B is not printed
  • SubReport C is printed several times, according to the number of rows returned by a query, one printing for each query
  • Main report footer is printed

If SubReport C is printed enough times, another copy of Page 2 will be printed, with the two main report sections (2 and 3) reprinted on each page.

What I want to know is where I can program these things to happen. I can't seem to see any code that's actually giving these instructions. The only code that's used to generate the report at runtime is, reportObject.ExportToDisk(), so it's not being done there.

1

1 Answers

1
votes

Go to Report->Section Expert and you'll see all the options you're talking about. For each section & subsection, this is where you can suppress sections, move content to new pages , etc. (Once you're in there, you can F11 for help.)

To activate an option only on certain conditions (like the value of a field), use the X-2 button to enter the Formula Editor. In most cases, you'll have to make a formula that results in a boolean value.

Example Report-SectionExpert