8
Creating Banded Creating Banded Reports im CF using Reports im CF using Nested <CFOUTPUT> Nested <CFOUTPUT> tags tags Douglas M. Smith Douglas M. Smith Application Architect Application Architect Automation Creations, Inc Automation Creations, Inc

Creating Banded Reports im CF using Nested tags Douglas M. Smith Application Architect Automation Creations, Inc

Embed Size (px)

Citation preview

Page 1: Creating Banded Reports im CF using Nested tags Douglas M. Smith Application Architect Automation Creations, Inc

Creating Banded Creating Banded Reports im CF using Reports im CF using

Nested <CFOUTPUT> Nested <CFOUTPUT> tagstags

Creating Banded Creating Banded Reports im CF using Reports im CF using

Nested <CFOUTPUT> Nested <CFOUTPUT> tagstags

Douglas M. SmithDouglas M. SmithApplication ArchitectApplication Architect

Automation Creations, IncAutomation Creations, Inc

Page 2: Creating Banded Reports im CF using Nested tags Douglas M. Smith Application Architect Automation Creations, Inc

What does a traditional banded report look like

• Parts are successively nested• Each part (except the detail) has a

header and a footer• Typically allowed to do domain type

calculations– Sum– Max– Min

Page 3: Creating Banded Reports im CF using Nested tags Douglas M. Smith Application Architect Automation Creations, Inc

Reports Parts• Report• Group1• Group2• GroupX• Detail

Page 4: Creating Banded Reports im CF using Nested tags Douglas M. Smith Application Architect Automation Creations, Inc

How does Grouping work in CF?

• <CFOUTPUT Query="X" Group="Y">• Only shows records where field "Y"

changes• Does not do true grouping• Does *not* sort for you• query should be sorted by the same

fields you group by, in order for the output to make sense

Page 5: Creating Banded Reports im CF using Nested tags Douglas M. Smith Application Architect Automation Creations, Inc

<CFOUTPUT>Nesting Basics

• Query must be on the outer most level

• Must be a different group, or no group to nest

• Any number of groups can be nested• <CFOUTPUT> with no options can

be in the deepest level

Page 6: Creating Banded Reports im CF using Nested tags Douglas M. Smith Application Architect Automation Creations, Inc

Report SectionsREPORT HEADER <CFOUTPUT QUERY="X" Group="1">

GROUP 1 HEADER <CFOUTPUT Group="2">

GROUP 2 HEADER <CFOUTPUT>

REPORT DETAILS </CFOUTPUT>

GROUP 2 FOOTER</CFOUTPUT>GROUP 1 FOOTER

</CFOUTPUT> REPORT FOOTER

Page 7: Creating Banded Reports im CF using Nested tags Douglas M. Smith Application Architect Automation Creations, Inc

Example• Show the books published by each

author, organized by book type• ie, group by

– type– then author– then title

Page 8: Creating Banded Reports im CF using Nested tags Douglas M. Smith Application Architect Automation Creations, Inc

Using Style Sheets effectively

• One class for each level/header/footer

• Page Breaks