Friday Dec 21, 2012

Generating barcodes in reports

I recently had a comment posted on a previous blog post regarding generating barcodes in the reports that come with the records management module (either in WebCenter Content/UCM or WebCenter Content: Records/URM).  

I knew we could output barcodes because we do  in some of the default reports that come with the product.  But even when looking at those rich-text templates, it wasn't clear how they were defined.  So I did a little digging and discovered the code needed to be added to those fields to do the barcode magic.  I won't repeat the steps on how to update/create the custom reports from my earlier post, but will just cover the few extra steps for barcodes.

Once you have your field input into the template in Word, right-click on the field and choose BI Publisher -> Properties.  Click on the Advanced tab and you should see the box for Code with the field you are outputting surrounded by <?field_name?>. For barcodes, you'll want to enter this in that code field:

<?register-barcode-vendor:’oracle.xdo.template.rtf.util.barcoder.BarcodeUtil';'XMLPBarVendor'?><?dBarcodeFormated?>*<?dBarcode?>*<?format-barcode:dBarcodeFormated;code39;XMLPBarVendor?>

Just replace dBarcode with your field name (e.g. dDocName, xComments, etc).  

code

Next, you'll want to change the font on the field to be 'BC 3of9'.  This font should have been added when the BI Publisher Desktop add-in for Word was installed.

font

Now simply follow the steps to add the template to the repository and configure the appropriate reports.  Now when the reports are run, it should provide the values in barcodes.

report

One thing I noticed is when I saved the Word document in rich-text format, I was no longer able to re-open that rtf file and get back to the code for the field properties.  But in Word's default doc format, I was.  So if you think you might need to edit the report later on, it's probably a good idea to save a copy in doc format as well. 

Thursday Mar 08, 2012

Creating custom report templates with BI Publisher

In the records management capabilities within WebCenter Content 11g, reports that are created are generated by a runtime version of Oracle BI Publisher.  In order to create those reports, there are report templates that are checked in during the initial configuration of records management.  These templates are in rich-text format (RTF) and can be easily modified in Word.  To make simple changes within the existing templates, you can simply check them out, download the RTF file, modify them in Word, and check in a new revision.  But to make more complex changes such as the input data into the report or to create a whole new report templates, that involves using the BI Publisher client to help design those templates.  I'll walk through a simple example of creating a new report template from scratch and then adding that template into WebCenter Content: Records.  In this sample report, we'll create a new Search Results report and output some custom metadata to the report.

The first step is to download and install the Oracle BI Publisher Desktop for Windows utility.  Install this on your Windows client machine that has Microsoft Word installed.  This will add a new menu choice or ribbon for BI Publisher.

publisher ribbon

Next, we need to turn on the proper rights within our 'rmaadmin' role to enable customization of the reports.  In WebCenter Content, login as an administrator and go to Administration -> Admin Applets -> User Admin.  From the menu, go to Security -> Permissions by Role.  Highlight the 'rmaadmin' role (or role you want to grant this access to) and click Edit RMA Rights. On the Admin tab, check the 'Customization' box.

Customization

Now log in as a user with the rmaadmin role.  In the menus, you should now have the additional choices within Records -> Configure -> Reports.

Reports Menu

Select the  'Download BI XML Data' choice in the menu.  This will give you a list of the types of data you can export as part of the report.  In our example, we'll select the 'Content' choice.  Then click the Download button and download that to your local system. 

Now go to Microsoft Word and start a new document.  Apply whatever look & feel, headers & footers, etc you want for the template.  Now go to the BI Publisher menu and select Load Data -> Sample XML. Select the XML file that saved previously.  It should report that data was loaded successfully.

Loaded

Now position the mouse where the table of results should appear.  Click Table Wizard in the menu.  Select the report format of 'Table' and click next.

Table format

For the Data Set, select '/InternalContent/Values' and click Next.

Data set

You can now select the fields you want added to the table. Once selected, click Finish.


It should now add a table automatically for you.  The headers can be changed to reflect the display value for the field name.

Table added

Now that we have our report template, save it out in rich text format (RTF).  Now we can add this into WebCenter Content as our new template.  Go back to the browser where you are logged in with the rmaadmin role.  Go to Records -> Configure -> Reports -> Templates.  Select the type of Report Template.  In this case, we'll select 'Content' and click Configure. 

Template Choices

In the results menu, click 'Check In New Template'.  Fill out the appropriate metadata, browse to the RTF file, and submit the template. 

Now that we have the template established, we need to create the report object itself.  Go to Records -> Configure -> Reports ->  Create New Report.  Select the type of report, in this case Content and click Configure.  In this case, we're not actually submitting a file.  Instead, we're associating our report with the report template and the service we want to tie it to.  Fill out the standard Type, Title, Security Group and other fields and scroll to the Report Template field.  Because we selected a report type of Content, we should see the list of templates associated with that type including the one we just added.  Select that from the list.  For Report Format, select the format of the report you want generated.  For Report Source Type, you have 3 choices: Service, Query, and Dynamic Query.  The Service and Query would use predefined services or direct database query statements.  Dynamic Query allows you to define a particular search query for results.  In this example, we want to rely on the results coming back from the users' searches, so we'll pick 'Service'.  For Report Source, click 'Add New'.  In the report sources dialog, scroll down to the 'GET_SEARCH_RESULTS' service and move that into the Report Source Services list.

Report Sources

This should now be in the Report Source field.

Report Check-In

There are also choices to modify the source parameters of the service as well as the ability to schedule the report to be run at certain times.  In this example, neither option is necessary.  Fill out the rest of the form and check-in the report.

Now when you do a search, you should now have the report template available to run the report:

Search Result menu

And when you run the report, you should get your report back presented in your template.

Final Report

To read more about creating custom reports, please review the online documentation.






Monday Nov 01, 2010

Document and Workflow History

[Read More]
About

Kyle Hatlestad is a Solution Architect in the WebCenter Architecture group (A-Team) who works with WebCenter Content and other products in the WebCenter & Fusion Middleware portfolios. The WebCenter A-Team blog can be found at: https://blogs.oracle.com/ ateam_webcenter/

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