Wednesday Mar 05, 2014

Internal Links

Another great question today, this time, from friend and colleague, Jerry the master house re-fitter. I think we are competing on who can completely rip and replace their entire house in the shortest time on their own. Every conversation we have starts with 'so what are you working on?' He's in the midst of a kitchen re-fit, Im finishing off odds and ends before I re-build our stair well and start work on my hidden man cave under said stairs. Anyhoo, his question!

Can you create a PDF document that shows a summary on the first page and provides links to more detailed sections further down in the document?

Why yes you can Jerry. Something like this? Click on the department names in the first table and the return to top links in the detail sections. Pretty neat huh? Dynamic internal links based on the data, in this case the department names.

Its not that hard to do either. Here's the template, RTF only right now.


The important fields in this case are the ones in red, heres their contents.

TopLink

<fo:block id="doctop" />

Just think of it as an anchor to the top of the page called doctop

Back to Top

<fo:basic-link internal-destination="doctop" text-decoration="underline">Back to Top</fo:basic-link>

Just a live link 'Back to Top' if you will, that takes the user to the doc top location i.e. to the top of the page.

DeptLink

<fo:block id="{DEPARTMENT_NAME}"/>

Just like the TopLink above, this just creates an anchor in the document. The neat thing here is that we dynamically name it the actual value of the DEPARTMENT_NAME. Note that this link is inside the for-each:G_DEPT loop so the {DEPARTMENT_NAME} is evaluated each time the loop iterates. The curly braces force the engine to fetch the DEPARTMENT_NAME value before creating the anchor.

DEPARTMENT_NAME

<fo:basic-link  internal-destination="{DEPARTMENT_NAME}" ><?DEPARTMENT_NAME?></fo:basic-link>

This is the link for the user to be able to navigate to the detail for that department. It does not use a regular MSWord URL, we have to create a field in the template to hold the department name value and apply the link. Note, no text decoration this time i.e. no underline.

You can add a dynamic link on to anything in the summary section. You just need to remember to keep link 'names' as unique as needed for source and destination. You can combine multiple data values into the link name using the concat function.

Template and data available here. Tested with 10 and 11g, will work with all BIP flavors.

Monday Nov 25, 2013

Conditional Borders

How can you conditionally turn cells borders on and off in Publishers RTF/XSLFO templates? With a little digging you'll find what appears to be the appropriate attributes to update in your template. You would logically come up with using the various border styling options:

 

border-top|bottom|left|right-width
border-top|bottom|left|right-style
border-top|bottom|left|right-color

 

Buuuut, that doesnt work. Updating them individually does not make a difference to the output. Not sure why and I will ask but for now here's the solution. Use the compound border formatter border-top|bottom|left|right. This takes the form ' border-bottom="0.5pt solid #000000". You set all three options at once rather than individually. In a BIP template you use:

<?if:DEPT='Accounting'?>
<?attribute@incontext:border-bottom;'3.0pt solid #000000'?>
<?attribute@incontext:border-top;'3.0pt solid #000000'?>
<?attribute@incontext:border-left;'3.0pt solid #000000'?>
<?attribute@incontext:border-right;'3.0pt solid #000000'?>
<?end if?>

3pt borders is a little excessive but you get the idea. This approach can be used with the if@row option too to get the complete row borders to update. If your template will need to be run in left to right languages e.g. Arabic or Hebrew, then you will need to use start and end in place of left and right.

For the inquisitive reader, you're maybe wondering how, did this guy know that? And why the heck is this not in the user docs?
Other than my all knowing BIP guru status ;0) I hit the web for info on XSLFO cell border attributes and then the Template Builder for Word. Particularly the export option; I generated the XSLFO output from a test RTF template and took a look at the attributes. Then I started trying stuff out, Im a hacker and proud me!  For the users doc updates, I'll log a request for an update.


Tuesday Nov 05, 2013

Comb Over

Being some what follicly challenged, and to my wife's utter relief, the comb over is not something I have ever considered. The title is a tenuous reference to a formatting feature that Adobe offers in their PDF documents.

The comb provides the ability to equally space a string of characters on a pre-defined form layout so that it fits neatly in the area. See the numbers above are being spaced correctly. Its not a function of the font but a property of the form field.

For the first time, in a long time I had the chance to build a PDF template today to help out a colleague. I spotted the property and thought, hey, lets give it a whirl and see in Publisher supports it? Low and behold, Publisher handles the comb spacing in its PDF outputs. Exciting eh? OK, maybe not that exciting but I was very pleasantly surprise to see it working.

I am reliably informed, by Leslie, BIP Evangelist and Tech Writer that, this feature was introduced from version 10.1.3.4.2 onwards.

Official docs and no mention of comb overs here.


Happy Combing!

Tuesday Feb 26, 2013

E-Business Suite 12 - XML Publisher enabled reports

With some help from the EBS folks, I recently re-ran a report on the latest EBS environment that stores the seeded content that we ship to customers. The document here (sorry,I had to zip it), lists the reports and their publisher templates. The vast majority are still based on an Oracle Reports extract rather than a publisher extract. I can not say that 100% of the reports have a Publisher template but its close. Hopefully it'll be a useful reference.

For more information on the reports check the specific products' documentation.

Thursday Nov 29, 2012

Spring Cleaning

I recently got a shiny new laptop; moving my shiz from old to new, was not the nightmare it used to be. I have gotten into the habit of using a second hard drive in the media bay where the CDROM normally sits. That drive contains my life's work with BIP. I can pull it out and plug it into another machine very easily. I have been sorting through some old directories and files, archiving some, sharing others with colleagues.

For instance, a little dated but if you were looking for a list of Publisher reports available in EBS R12.1, here it is. Im trying to track down a more recent R12 instance and will re-post the document.

I also found another gem; its a little out there in terms of usefulness but Im sharing it none the less. You can embed, locally or remotely reference SVG graphics (in XML format) and bring the images into the BIP outputs. Template and sample data here.

A nice set of templates showing page number control and page suppression - they will need some explanation, so I'll save them for another post.

The list goes on but I'll save them for later. Back to the clean up!

Wednesday Nov 14, 2012

Chart Filtering

Interesting question from a colleague this week. Can you add a filter to a chart to just show a specific set of data?

In an RTF template, you need to do a little finagling in the chart definition. In an online template, a couple of clicks and you're done.

RTF

Build your chart as you would normally to include all the data to start with.

Now flip to the Advanced tab to see the code behind the chart. Its not very pretty but with a little effort you can get it looking a little more friendly. Here's my chart showing employees and their salaries.

<Graph depthAngle="50" depthRadius="8" seriesEffect="SE_AUTO_GRADIENT">
 <LegendArea visible="true"/>
 <Title text="Executive Department Only" visible="true" horizontalAlignment="CENTER"/>
 <LocalGridData colCount="{count(.//G_2)}" rowCount="1">
  <RowLabels>
   <Label>SALARY</Label>
  </RowLabels>
  <ColLabels>
   <xsl:for-each select=".//G_2">
    <Label><xsl:value-of select="EMP_NAME"/></Label>
   </xsl:for-each>
  </ColLabels>
  <DataValues>
   <RowData>
    <xsl:for-each select=".//G_2">
     <Cell><xsl:value-of select="SALARY"/></Cell>
    </xsl:for-each>
   </RowData>
  </DataValues>
 </LocalGridData>
</Graph>

Note the emboldened text. Its currently grabbing all values in the G_2 level of the data. We can use an XPATH expression to filter the data to the set we want to see. In my case I want to only see the employees that are in the Executive department. My  data is structured thus:

 

<DATA_DS>
    <G_1>
        <DEPARTMENT_NAME>Accounting</DEPARTMENT_NAME>
        <G_2>
            <MANAGER>Higgins</MANAGER>
            <EMPLOYEE_ID>206</EMPLOYEE_ID>
            <HIRE_DATE>2002-06-07T00:00:00.000-04:00</HIRE_DATE>
            <SALARY>8300</SALARY>
            <JOB_TITLE>Public Accountant</JOB_TITLE>
            <PARAS>11000</PARAS>
            <EMP_NAME>William Gietz</EMP_NAME>
        </G_2>

So the XPATH expression Im going to use to limit the data to the Executive department would be .//G_2[../DEPARTMENT_NAME='Executive'] Note the ../ moves the parser up the XML tree to be able to test the DEPARTMENT_NAME value. I added this XPATH expression to the three instances that need it ColCount, ColLabels and RowData. Its simple enough to do. Testing your XPATH expression is easier to do using a table of data. Please note, as soon as you make changes to the chart code. Going back to the Builder tab, you'll find that everything is grayed out. I recommend you make all the changes you can via the chart dialog before updating the code.

Online Template

Implementing the filter is much simpler, there is a dialog box to help you out. Add you chart and fill out the various data points you want to show. then hit the Filter item in the ribbon above the chart. That will pop the filter dialog box where you can then add a filter to the chart.


  You can add multiple filters if needed and of course you can use the Manage Filters button to re-open and edit the filters.

Pretty straightforward stuff!

Friday May 11, 2012

Beyond the Conditional Dialog

Interesting question today, asking how to conditionally underline and align text in an RTF template?

Your first thought, the conditional dialog box in the Template Builder for Word right?
Mine too, but I know that the dialog is limited to setting the background color, font color and font style. However, the XSLFO standard has a bunch of attributes that can be set. There is going to an intersect of what the standard offers and what BI Publisher has implemented. Ots also going to depend on what version of BIP you are running too as the boys and gals in the back room constantly add to the list of supported attributes for give objects.

If you're just getting to grips with the language and want to know what attributes are available, the W3c Schools site is a good place to start - http://www.w3schools.com/xslfo/xslfo_reference.asp.  There you can find the object you want to change and its attributes.

The easiest way to create the conditional code is to go ahead and create a condition using the dialog and choosing one of the supported attributes. Note that the dialog only works when you are inside a table. Thats jus tthe dilog box talking, you re not limited to changing attributes only inside tables. Just use the dialog to get the code.

All you then need to do is substitute in the attribute name and the value you want it to be into the code. So:

<?if:@Name='Tim'?><?attribute@incontext:color;'red'?><?end if?>

 

can then be changed to

 

<?if:@Name='Tim'?><?attribute@incontext:text-align;'right'?><?end if?>

 

and of course you have make multiple changes inside the 'if' statement.

One thing to note here, the @incontext might need to be changed to get the desired changes to be applied. Check the documentation for details on the various @ levels you can use. Don't be scared, play a little until it does what you want it to do. Its useful to export the RTF to XSL:FO and see where your code is being applied if the output is not what you were expecting.

Friday Feb 17, 2012

Rocky Mountain User Group Preso

For those of you that could not make the Rocky Mountain User Group session yesterday. Nikos, from the product management team has kindly loaded my presentation and the sample templates I showed, up to OTN. Its a bit of a monster so be patient.

http://www.oracle.com/technetwork/middleware/bi-publisher/beyondthelistingreport-1526340.zip

Its worth 'running' the powerpoint for the fantastic comedic moments we shared in the room, well, kinda. You need my deep southern Louisiana accent for the full effect :0)

Wednesday Aug 03, 2011

Crispy Charts!

It's been so long ... since I last post Kan has been stepping up and providing content. You may know I love weather and have a not so secret desire to see a tornado up close and personal. Since my last post I have come close, I got trapped in deepest darkest Mississippi and hot and sultry Montgomery, AL due to the most fantastic electrical storms. St Louis nearly kept me for an extra night but in spite of tornado sirens our plane snuck out just in time to avoid the worst.

I have also dropped quite a lot of poundage and last week took part in my first Triathlon, just a 'sprint' you understand. 1/2 mile swim, 11 mile ride and a 5K crawl, sorry I mean run. My dear wife joined me and we did not finish last! I even managed to come 8th in the bicycle ride!

To ease back into the blogging world, a bit of a corner case solution that could be applied to other issues and I wanted to get it down on 'paper' before I forget it. We have a customer that is having issues with the charting engine in 10g. As many of you know, you can customize the charts beyond what the dialog box in MSWord offers. Said customer was hitting an alignment issue in one of their customizations. When generating the chart to RTF all was well but with HTML and more particularly PDF the alignment was off. The first think to remember is that by default BIP will try and generate SVG outputs for the charts if it can. In the case of RTF it can not so you get an embedded image. In HTML and PDF, it can, hence the difference in alignment.

The difference in the chart quality is surprising:

 

The image format above and the svg below

I have had to shrink the images a little but you get the idea. Your svg charts are crisp and clear, even if you zoom in to them. The image formats, not so good.

We needed to log and enhancement/bug against the chart engine but was there a workaround? 

If you have ever used the export feature in the Template Builder to take a look at the XSL, you may have noticed a bunch of parameters the engine drops in. One of those controls the chart format, _XDOCHARTTYPE. The actual line is:

<xsl:param name="_XDOCHARTTYPE">image/svg+xml</xsl:param>

So we need a way to override this parameter for the HTML and PDF outputs. Well the HTML is easy, in the user preferences you can specify that you want chart images in your HTML output, simple. For PDF, you need to do a little more work.

Hopefully you know that you can have a set of config properties either at site level or at report level. There are a bunch you can change via the UI. We need to add one manually.

For Report Level only
1. Navigate to the report folder in the BIP catalog
2. Open the xdo.cfg file. If there is not one present, go back to the UI for the report and click the Config link, then just change any property to the opposite of the site level and Apply. This will create a cfg for you back in the report directory. You an change it back later. Now open it.
3. In the properties section add the following line

<property name="xslt._XDOCHARTTYPE">'image/png'</property>

4. Save the file and re-run the report to PDF output and you will get charts embedded as images rather than SVG and the alignment issue will be gone. There is a price to pay in clarity of the charts but its a work around that works.

If you want this for all reports you can put the same property into the 'master' cfg file in Admin/Configuration. Again, you may have to change a value to get the cfg file created.  

Definitely a corner case but the technique can be applied to any parameter settings in the generated XSLFO file. The xslt. prefix also allows you to set your own paraemter values in the template that might be needed ... I'll save that explantion for another time.

Friday Nov 12, 2010

The Unsung 11g Hero

[Read More]
About

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today