Vous êtes sur la page 1sur 3

How to: Excel pivot tables with BI Publisher

Author: Date: Version: Jacques van Nes 20 Februari 2012 1.0

Introduction Bi Publisher is a power ul tool to !o reportin" an! !ocu#ent creation ro# $racle pro!ucts. %tan!ar! a &or! plu"'in is provi!e! to create la(out te#plates in a user rien!l( an! visual wa(. )an( o the pro*ects + *oin in a speci ic #o#ent there,s also a nee! to e-tract !ata into .-cel sheets or overview an! #ana"e#ent reportin" purposes. /hose e-cel sheets can be "enerate! b( creatin" a P01%20 pac3a"e which e-tracts the necessar( !ata in a 456 !eli#ite! wa(7 or b( usin" the 8/F la(out te#plate an! output the !ata also in a !eli#ite! wa(. Ne-t the plain A%9++ ile has to be i#porte! into .-cel an! the user can create a pivot table hi#sel . Describe! in this !ocu#ent + e-plain a wa( o "eneratin" native :)0 %prea!sheet co!e7 with a ull( unctional pivot table opene! strai"ht into )% .-cel. What is needed /his solution #a3es use o B+ Publisher: A !ata te#plate which !oes the queries an! "enerates the !ata :)0 ile A :)0 %t(le sheet la(out te#plate which "enerates the :)0 %prea!sheet !ocu#ent. Step 1: Create the BI Publisher data template De ine (our queries in a B+ Publisher !ata te#plate an! re"ister it in B+ Publisher Step 2: Basic !" st#lesheet Basic :)0 %t(le sheet or co#posin" :)0 %prea! sheet with the 4plain6 !ata wor3sheet /he basic :)0 st(lesheet 4-sl6 has 2 re"ions: ' /he irst part provi!es the necessar( hea!er !ata5 +t i!enti ies the -sl na#espaces7 output t(pe7 an! processin" instructions ' /he secon! part provi!es the !e inition o the wor3sheets. /he inal results o this !ocu#ent shows a Pivot table7 an! a secon! wor3sheet with the !etail !ata. First create the st(lesheet with onl( the !etail !ata wor3sheet7 see e#be!!e! e-a#ple:

WordPad Docum ent

8e"ister this st(le sheet as a la(out te#plate in B+ Publisher as t(pe set $ S"% !"& an! !e ault output t(pe is set to $ !"& Now !o a irst run o this report. + suppose (ou create! a concurrent pro"ra# or that an! 3eep in #in! that in the concurrent pro"ra#7 in the ;<pon co#pletion=, section (ou state the B+ Publisher la(out te#plate an! output or#at is set to .:9.0. %ave the output ile to (ou local ol!er an! open it in .-cel. Pre erable let the !ata te#plate "enerate *ust 1 row

Step ': Create the pivot table la#out in Excel +n a nor#al wa(7 !e ine the pivot table on a separate wor3sheet within the wor3boo3. 9hoose the iel!s7 options etc base! on the !ata wor3sheet. &hen inishe!7 save the sheet as :)0 %prea!sheet or#at to (our local ol!er. )% .-cel "enerates a hu"e a#ount o co!e 4as nor#al or )icroso t67 an! *ust a little part o that we nee! to place it on the :)0 %t(lesheet. $pen the store! e-cel sheet in (our avorite e!itor 4e.". Notepa!>>7 :)0 sp( etc6. &hen no anc( st(lin" was use! !urin" the buil! o the Pivot table7 we can "et ri! o the ?st(les@=?1st(les@ section in the save! sheet7 otherwise leave the st(les ta"s. Now scroll!own to the !e inition o the pivottable wor3sheet 4?&or3sheet ss:Na#eABPivot/ableB@6. %elect all co!e between ?&or3sheet@=.?1&or3sheet@. An! save this selection in a ile on (ou local !isc. + the !e ault .-cel st(lin" suits or (ou7 re#ove all the ss:%t(le+DABs xxB ro# the cell ta". Step (: Embed the )enerated pivot code Now "o bac3 to the 4basic6 :)0 %t(le sheet7 an! paste the pivot table co!e above the wor3sheet 4!ata6 !e inition. Step *: ma+e the st#le sheet wor+: ,xs:template match-. Ne-t step is to #a3e the st(le sheet wor3. &e i!enti ( the te#plate #atch ta"s7 base! on the structure o the output ro# the !ata te#plate. Just be ore the ?&or3sheet ss:Na#eABPivot/ableB@ put the state#ent: ?-sl:te#plate #atchAB0+%/CDCDA/AB@ where 0+%/CDCDA/. is the :)0 !ata"roup ro# the Data te#plate. Don,t or"et to close the ?-sl:appl('te#plates1@ at the en! o this wor3sheet !e inition. Now at the ver( botto# o the st(le sheet7 create the -sl:te#plate na#e: ?1-sl:te#plate@ ?-sl:te#plate na#eABPivot/ableB@ ?1-sl:te#plate@ +n the ?P/%ource@ ta" we have to a!*ust 2 thin"s: %ince we !o not provi!e cachein" o the pivottable7 we instruct .-cel to !o a re resh o the pivot table on loa!: A!! ?8e resh$nFile$pen1@ A!*ust the 8e erence ta"7 so it re ers to the !ata wor3sheet: ?9onsoli!ation8e erence@ ?FileNa#e@E?-sl:value'o selectAB11F+0.CNA).B1@FData?1FileNa#e@ ?8e erence@8191:8?-sl:value'o selectABcount4DCDA/A6 >1B1@911?18e erence@ ?19onsoli!ation8e erence@ Geep in #in! that the ilena#e has to correspon!ent with the ilena#e "enerate! b( the concurrent request7 otherwise the re erence is bro3en. +n the Data te#plate + co#pose! this ilena#e is passe! to the %t(lesheet. Now we are !one7 see e#be! ull e-a#ple o the %t(lesheet

WordPad Docum ent

Step (: Extra settin)s in /racle EBS &e have to a!! an e-tra viewin" option7 which lets the pro!uce! .-cel sheet ro# the 9oncurrent View $utput option open in .-cel +n the viewer options7 i not (et e-ist7 a!! a new option with File For#at ;:)0, an! )i#e t(pe ;application1vn!.#s'e-cel, Conclusion A nice wa( o creatin" power ull 4#ana"e#ent6 .-cel sheets. Basicall( an(thin" is possible an! can be st(le! in the %t(lesheet. Be aware o the usal pit alls which ta3es ver( #uch ti#e to solve. Doo! luc3 0e1erences :)0 %prea!sheet 8e erence $racle B+ Publisher !ocu#entation :)0 Publisher an! concurrent #ana"er inte"ration