Creating Formulas, Summaries, and Placeholders at Any Level

22-16 Publishing Reports to the Web with Oracle Reports Services The following tips are useful when looking at this example: ■ Each time you use the SRW.APPLY_DEFINITION built-in procedure, the document buffer is flushed and you must begin building a new XML report definition with SRW.ADD_DEFINITION. ■ Notice the use of the parameters hilite_profits, hilite_costs, hilite_ sales, and money_format to determine what to include in the XML report definition. The hilite_profits, hilite_costs, and hilite_sales parameters are also used in the formatting exceptions to determine which values to highlight. ■ Because of the upper limit on the size of VARCHAR2 columns 4000 bytes, you might need to spread very large XML report definitions across several columns. If so, then you might have to create several definitions in memory and apply them separately rather than creating one large definition and applying it once. function AfterPForm return boolean is begin SRW.ADD_DEFINITIONreport name=vidsales_masks author=Generated DTDVersion=9.0.2.0.0; IF :MONEY_FORMAT=NNNN.00 THEN SRW.ADD_DEFINITIONlayout; SRW.ADD_DEFINITIONsection name=main; SRW.ADD_DEFINITIONfield name=F_TOTAL_PROFIT source=TOTAL_PROFIT formatMask=LNNNNNNNNNNN0D00; SRW.ADD_DEFINITIONfield name=F_TOTAL_SALES source=TOTAL_SALES formatMask=LNNNNNNNNNNN0D00; SRW.ADD_DEFINITIONfield name=F_TOTAL_COST source=TOTAL_COST formatMask=LNNNNNNNNNNN0D00; SRW.ADD_DEFINITIONfield name=F_SumTOTAL_PROFITPerCITY source=SumTOTAL_PROFITPerCITY formatMask=LNNNNNNNNNNN0D00; SRW.ADD_DEFINITIONfield name=F_SumTOTAL_SALESPerCITY source=SumTOTAL_SALESPerCITY formatMask=LNNNNNNNNNNN0D00; SRW.ADD_DEFINITIONfield name=F_SumTOTAL_COSTPerCITY source=SumTOTAL_COSTPerCITY formatMask=LNNNNNNNNNNN0D00; SRW.ADD_DEFINITIONsection; SRW.ADD_DEFINITIONlayout; ELSIF :MONEY_FORMAT=NNNN THEN SRW.ADD_DEFINITIONlayout; SRW.ADD_DEFINITIONsection name=main; SRW.ADD_DEFINITIONfield name=F_TOTAL_PROFIT source=TOTAL_PROFIT formatMask=LNNNNNNNNNNN0; SRW.ADD_DEFINITIONfield name=F_TOTAL_SALES source=TOTAL_SALES formatMask=LNNNNNNNNNNN0; SRW.ADD_DEFINITIONfield name=F_TOTAL_COST source=TOTAL_COST formatMask=LNNNNNNNNNNN0; SRW.ADD_DEFINITIONfield name=F_SumTOTAL_PROFITPerCITY source=SumTOTAL_PROFITPerCITY formatMask=LNNNNNNNNNNN0; SRW.ADD_DEFINITIONfield name=F_SumTOTAL_SALESPerCITY source=SumTOTAL_SALESPerCITY formatMask=LNNNNNNNNNNN0; SRW.ADD_DEFINITIONfield name=F_SumTOTAL_COSTPerCITY source=SumTOTAL_COSTPerCITY formatMask=LNNNNNNNNNNN0; SRW.ADD_DEFINITIONsection; SRW.ADD_DEFINITIONlayout; END IF; SRW.ADD_DEFINITIONreport; SRW.APPLY_DEFINITION; SRW.ADD_DEFINITIONreport name=vidsales_hilite_costs author=Generated DTDVersion=9.0.2.0.0; IF :HILITE_COSTS None THEN