Skip to Content
First things first, what are publications?

Publications are set of objects that can be scheduled and distributed to multiple recipients on a regular basis.  With XI 3.1 publications now support Desktop Intelligence, Web Intelligence, and Crystal Reports documents.  They can also be delivered in multiple formats to various recipients. 

This particular sample uses an already existing publication containing multiple Crystal Reports and takes advantage of the PDF merge functionality (which does exactly that, it will merge all the Crystal Reports into a single pdf file) as well as the zip plugin (which then zips the output) and sends it to the administrators Enterprise inbox.

Now we can cover the issues that I ran into when trying to implement this functionality.  Hopefully it will save you some time in your project.

Make sure you use the correct query:

If you query for the publication using the path:// it will not return all of the properties of the publication and will not work.
I decided to use the standard Select * query and all was well.

‘query for the publication and get it as an infoobject

‘Does not work
‘rh = biPlatform.Get(“path://InfoObjects/Root Folder/MyPublications/testPublication”, oGetOptions)

‘Does work
 rh = biPlatform.Get(“query://{Select * from ci_infoobjects where si_name = ‘testPublication’ and si_instance = 0}”, oGetOptions)

Make sure to add the plugins in the correct order:

If you want to use both the zipplugin and pdfmerge plugin at the same time (ie to merge pdfs and zip them) then the order is important.
The pdfmerge must be the first object in the PostProcessingEventHandler array that is passed to the publications PostProcessingEventHandlers object.
If you add the zip plugin first it will not turn the output into a pdf.

Watch out for the Format info issue:

If you use formatInfo(0).Format = FormatTypeEnum.PDF it will return a string of 1 and will fail with an invalid format type. This looks like an issue with the SDK.
You must hard code crxf_pdf:0 for pdf.

 

The full page code in VB.NET

I hope this was of help to some of you looking for more information into publications and the web services sdk.

Be sure to check out the Developer Library at http://www.sdn.sap.com/irj/boc/sdklibrary

Here you will find samples as well as documentation on the various Business Objects SDK’s, including web services.

Good luck!

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. RUC ..

    Hi

    Will this code work for Web Intelligence ??

    We planning on Merging PDF as Publication completes for each Sales Representative.

    Please advise

    (0) 

Leave a Reply