Showing posts with label XML Publisher. Show all posts
Showing posts with label XML Publisher. Show all posts

Monday, January 12, 2015

BI Publisher Bursting - Delivering/sending emails conditionally

Here is the sample code to send emails conditionally from BI/XML Publisher bursting feature.

Problem Statement:
Generate payslips for all the employees at one shot and email the payslips to respective employee.



1. Alter EMP table and added a column called email to hold emails of each individual employees.
And then update email column to add email Ids where you want your emails to be delivered.

2. Create a Data template Sample code available here

3. Default package Sample code available here


4.Define a concurrent program and assign the concurrent program to a responsibility as per your convenience.


5. Design a simple RTF template and register the same. Sample template available here

6. Register data template, created in #1 above

7. Register control file for bursting. Sample code available here

Package Sample code here.

8. Submit the concurrent program defined in #4. If everything goes fine,
you should be able to see emails delivered at the email ids provided.

Sample Data in XML format.



9. Sample output below..

Friday, October 16, 2009

BI Publisher: How to Print check box on BI Publisher

Question: How to print Check box on BI Publisher(XML Publisher) Reports.?
Answer:
Follow these steps to create checkboxes or any symbols for your XML Publisher Reports.
1. Design RTF template.
2. Place your check boxes on the template.

    For MS WORRD-2007, check box available under "Developer" menu/Legacy tools.
3. Right Click on checkbox and etnter criteria how the check box should behave.
      Ex: Which means, when the "DFF_FUMIGATION" is Y, then check box is checked. Otherwise un-checked.

4. Design other check boxes in similar way.

Note: Do not enter criteria under “BI Publisher Properties”. Enter criteria only on “Form field Help Text”.

5. Save template as RTF. If you test/preview your template it will not show check boxes properly. Instead it will show diamond shaped pictures or any other junk characters.

This is expected behavior, as Bi Publisher could not find exact mappings for the check boxes when generating output.

6. To do character set/fonts mappings..
Take “xdo example.cfg” file, which will be available in your machine “ /BI Publisher\BI Publisher Desktop\Template Builder for Word\config”

Save as this file as “xdo.cfg” in the same folder.

Verify the “Wingdings” family property is correctly pointing to the “fonts” directory in your machine or not.

You may also notice that “rtf-checkbox-glyph” property already available in .cfg file and which is set to “Wingdings;0254;0160”.
These two steps are important to show check boxes correctly.

7. Test your RTF template. You may notice check boxes displayed properly in the output.



After changing above property in “xdo.cfg” file and placed it under “ /BI Publisher\BI Publisher Desktop\Template Builder for Word\config”

Return to RTF template and click on preview again to verify the results.
 

Now RTF Template creation and setups steps required to generate check boxes are completed.
Create Data definition, Template and then upload your RTF template.

To complete font mappings at server side,

1. Log in as XML Publisher Administrator.

2. Navigate to Administration->Font Files->Create Font File.

3. Fields are Font Name and File.

For Font Name choose any descriptive name.

File will browse your PC to locate the font file.

4. Navigate to Font Mappings->Create Font Mapping Set.

5. Mapping name is the name you will give to a set of fonts.

6. Mapping code is the internal name you will give to this set.

7. Type: 'PDF Form' for PDF templates. 'FO to PDF' for all other template types.
 

 
  8. Create Font Mapping (this allows you to add fonts to a set).

 
9. Font Family is the exact same name you see in Word under Fonts.

If you don't use the same name the font will not be picked up at runtime.

10. Style and weight must also match how you use the font in windows.

Normal and Normal are good defaults.

11. Language and Territory should remain blank (NULL).






12. Navigate to Configuration General-> FO Processing->Font Mapping Set.
Can also be done at data def and template level under Edit Configuration.

Hierarchy is Site-> Data Def -> Template.
13. Select your new mapping set.

14. Make sure the font is not referenced under File->Properties->Custom in the RTF template file.

15. Under General set a Temporary Directory.
The font will be downloaded here under /fonts to be used at runtime, the first time the font is used.




16. Upload a template that uses your special font and test using preview or by submitting a concurrent request.