Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Please share your knowledge about these Crystal Reports concepts.

  1. I want to know what is difference in section and sub report? I know about default sections and we can add new sections into report.

  2. What is purpose of a subreport? when should we use a subreport instead of a section?

  3. Where should we use multiple detail sections in report?

  4. Are sections used to carry a "Can grow" field that will be bringing data dynamically?

share|improve this question
    
(I am very interested in #3) –  Morons Sep 12 '12 at 2:36

1 Answer 1

1) Difference between Section And Subreport

I guess you have confused the concept of section and subreport.
- Section refers to the design areas which is used to build your report. Page header, report header, details, footer are sections of report.
- Subreport is the report within another report object. Even
subreports have sections in their report.(Page header and Page
footers Section is not there in subreports)

2) Purpose of having Sub report

  • We use subreports to combine unrelated report to one, to get and present different views of same data within a report and also to non linkable data to coordinate.

3) When Multiple Sections are used.

I found the answer by googling. And the answer is here.

  • Keeping variable length objects from overwriting each other
    When subreports or other variable length objects are placed above other objects in one section of the report while the Can Grow option for the variable length object is toggled on in the Properties view, that object may overprint objects positioned directly below it unless you have:

    • Expanded the section to fit the maximum size of the object.
    • Spaced the objects, allowing enough space for the first object to complete printing before the second one begins.

      You can eliminate this overprinting problem by creating multiple sections in an area and placing objects below the variable length object in their own section(s). Now, when the report runs, the section with the variable length object will finish printing before the section below it prints and you will get the results you want.
      Note: Many report objects can use the Can Grow option and can, therefore, cause overprinting:
      • Text fields
      • Formula fields
      • Subreports
  • Eliminating blank lines when fields are empty
    It is very common to have two address lines in a customer table, one for street address (Address 1), and one that can be used for a suite number or mail stop (Address 2). Address 1 usually contains a value, but Address 2 is often blank. If you create a customer list using this data and stack the fields on top of one another in mailing label format, those customer records with an empty Address 2 field will print with a blank line. You can eliminate this blank line either by using multiple sections, or by suppressing blank lines.

    To eliminate blank lines by using multiple sections
    a. Create two new Body sections so that you have a total of three.
    b. Place the Address 2 field in the middle section and the other data in the sections above and below it as you want it to appear in the report.
    c. In the Report Structure Panel, highlight the second section.
    d. In the Properties view, set Suppress if Blank to True. Now, when the report prints, if the Address 2 section is blank, the program will not print it and you will not get unwanted blank lines in the report.

  • Adding blank lines conditionally
    Use multiple sections to print a blank line on your report under specific conditions. For example,
    you may want to insert a blank line after every fifth record in the
    report.
    To add blank lines conditionally
    1. Create two Body sections.
    2. Place the report detail data in the top section.
    3. Right-click the second section and from the context menu, click Conditional Formulas.
    4. Select Suppress and then click OK.
    5. Enter the following formula: Remainder (RecordNumber,5) <> 0 This formula divides each record number by 5. If the division
    produces a remainder, it suppresses the blank section. But if the
    division produces no remainder (which it will for every fifth record printed), the program prints the second section, thus inserting a
    blank line.
    Note: To insert a blank line under different conditions, you can modify your formula appropriately.

4) "Can grow" is an option(check box) can be set to sections in order to dynamically format data.

Hope it answers your question!!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.