MAX: Advanced ColdFusion MX 7 Printing and Reporting

Notes from Dean Harmon’s presentation on CFDOCUMENT/CFREPORT:

Stressed the importance of “complete” HTML documents. Each cfdocumentsection needs to be a complete HTML doc. Well formced CSS works file. Border Collapse and Float-Left do not. cfdcoument src attribute is BETTER than using cfhttp to suck down the contents. Multiple header/footers will not work. Only the last one will win. Therefore, use documentsection. But it forces a page break. It’s a CF bug that will hopefully be fixed.

Most things in CFR are expressions. Use same logic as what you could put in Evaluate(). Cant use tags, but could use IIF(), with DE(). You can use tag syntax in a cfr using Report Functions.

Richer and conditional formatting
7.0 - not optimal. 7.01 - things are a bit better. basic html support, must be xhtml compliant, does not work in FP. Support will be improved in the future.

Making decent excel files
Spaces are very important. Use zoom. Simpler layout is best. “Fancy formatting makes for funky files” Don’t use number formatting as excel will treat them as strings, not numbers.

parameters,br> Params are uni-directional. Data can go from cfm to cfr. From master report to child report. You CANT pass from cfr to cfm. You cANT pass from child to master. You can use the shared scopes to get around this, ie, child report can set request variable.

how to force a page break
Make a cfr called cfreport_pagebreak.cfr - see his preso for more notes on the fix. (It’s involved.)

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support.

Lafayette, LA