Monthly Archives: January 2014

Using Prompt API for IBM Cognos BI Report Studio

Prompt API for IBM Cognos BI

Prompt API for IBM Cognos BI

Default values for report prompts? It doesn’t sound very difficult does it? Well as far as the default values are static you can define them easily with your report properties but in the real business world there’s no such thing as static. Change is just around the corner and so we need to have more dynamic reporting solutions. Making dynamic default values for report prompts is something that should be a out-of-the-box-feature (as it is in Microsoft SQL Server Reporting Services for example) but with IBM Cognos BI Report Studio it has been about making some JavaScript/HTML/DOM hacks. Now they’ve released Prompt API for IBM Cognos BI to tackle down this issue. Well, it’s still Javascript but at least there is a documented API how to use it. Let’s give it a shot.

In my simple example I’ve created a report with two prompts and one HTML Item. The first “kkprompt”-prompt fetches the default value that is going to be selected in the another prompt. You can later on hide the first prompt box because it doesn’t need any user interaction. Now, to get the “defaultselprompt” prompt working with dynamic default value we need to add the following code inside the HTML Item.

prompt_api_code

And that’s pretty much it! I’m still amazed that this kind of feature is behind some javascript code and not available in the prompt box properties but hey, maybe in the next major release?

-GD

Advertisement

SQL Server 2012 Integration Services DLL Hell: Microsoft Visual Studio Tools for Applications Runtime 3.0

One of the major drawbacks of the SQL Server Integration Services (SSIS) is the mixture of 32bit and 64bit environments:

  • Design & development time environment (SQL Server Data Tools) is running in 32bit though you can debug the package in 64bit mode
  • Production packages can be run in 32bit or 64bit whatever you choose in the package properties

Well, there are moments when this arrangement feels like a gift from god but for me it was once again a real pain in the ass. I was recently working in a fresh installation of SQL Server 2012 and Data Tools. When I was trying to edit a Script Task in my SSIS package I faced the following error message:

Could not load file or assembly ‘Microsoft.VisualStudio.Tools.Applications.Core

Fresh installation and everything seems like to be in order but no, the script editor won’t open up. After investigation I found out that when the moon and the stars are aligned perfectly there is a small possibility that you miss one assembly file if the installation of SQL Server and related components is done in the wrong order. The thing is that to be able to run the package in both 32bit and 64bit there has to be same assemblies respectively: ones for 32bit and the others for 64bit. My problem was that I was missing the 32bit version of Microsoft.VisualStudio.Tools.Applications.Core.

From the “Add / Remove Applications” of Windows I noticed that yes, I have the Microsoft Visual Studio Tools for Applications x64 Runtime 3.0 but what i was missing was the x32 version of the assembly. So grabbing the MSI installer file from the installation media (redist/VSTA/runtime/x86/VSTA_RT30.msi) and installing it fixed the problem.

Beware of DLL hell!