Saturday, January 23, 2010
Do you have Cognos 8 SDK issues?
Do you need support with your Cognos 8 SDK project? If so, then email us today at businessintelligencecentre@gmail.com.
Friday, October 9, 2009
Wednesday, October 7, 2009
Unleashing the Power of IBM Cognos SDK
Unleashing the Power of IBM Cognos SDKBy Deepesh K. Shrivastava, Wipro Technologies |
With increasing use of BI, users want quick access to information. BI is increasingly becoming pervasive across the organization. This demands BI capabilities embedded across different business functions and delivery portals. It also requires intuitive, easy to use user interfaces. In such cases, when deployment of BI capabilities is not just limited to trained analytical or power users; and BI offering require better usability, adherence to corporate branding look & feel standards, or integration along with other business functions like ordering, IBM Cognos SDK capabilities comes to rescue.
IBM Cognos SDK is a very powerful toolset to extend capabilities of the Cognos platform and for providing different integration & deployment options. Cognos SDK is built using industry standard protocols SOAP, WSDL.
Wipro's 'Customer Self-Service BI' framework has been built over the IBM Cognos SDK and provides simplified interface to SDK services as façade. This framework also integrates other Web 2.0 functions including AJAX.
When it comes to customer facing applications, organizations have elaborate set of branding look & feel requirements and any customer facing BI is not exception to it. Such solutions also require high level of scalability and intuitive usability. Organizations also wants any such BI offering to be made available within their e-commerce portal and at times, wants BI functions to be embedded alongside other business functions.
'Customer Self-Service BI' framework leveraging IBM Cognos SDK offers seamless integration possibility and leverages organizations existing investment into any branded e-commerce portal. Following are the key components of such integration –
- Corporate portal or web application
- 'Customer Self-Service BI' framework
- IBM Cognos SDK
- IBM Cognos BI platform
--
BI CENTRE
http://bicentre.blogspot.com
Tuesday, October 6, 2009
Wednesday, July 1, 2009
Remote Cognos Development Opportunity
We can assist with model development, report development, SDK coding, testing, QA, technical documentation and even project management.
Feel free to contact us today to discuss your needs.
email: businessintelligencecentre@gmail.com
Monday, November 24, 2008
SDK - SSO for Series 7 gateway namespace using CSharp
using System.Collections;
using System.Web.Services;
using cognosdotnet_2_0;
namespace SetCredential
{
///
/// Summary description for Class1.
///
class SetCredential
{
private cognosdotnet_2_0.CognosReportNetBinding oCrn = null;
propEnum [] props = {propEnum.defaultName, propEnum.searchPath};
public SetCredential(string endPoint)
{
oCrn = new CognosReportNetBinding();
oCrn.Url = endPoint;
oCrn.Credentials= System.Net.CredentialCache.DefaultCredentials;
}
//
// get a list of the packages for the logged in user
//
public void getPackageList()
{
try
{
baseClass [] objInMyFolders = oCrn.query("//package",
props, new sort[]{}, new queryOptions());
int temp = 1; // If you've made it to here, SSO is working. Examine objInMyFolders to see the packages
}
catch (Exception e)
{
Console.Write("\n" +e.GetBaseException());
}
}
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
String endPoint = "http://localhost/c84GA/cgi-bin/cognos.cgi";
SetCredential packageList = new SetCredential(endPoint);
packageList.getPackageList();
}
}
}
Thursday, October 16, 2008
Monday, June 2, 2008
Access Manager LDAP -- add new user
Monday, May 12, 2008
New C8 SDK Utility --- Cognos 8 Modification Check
· Search the Content Store for items that have been modified after a selected date value
For example, if you were looking for all reports that were modified on June 3rd, 2008 then you would select the date June 2nd, 2008. The code will search for all items that have been modified after the selected date value from the date control.
The results of the search are then rendered to a text box control.
Friday, May 2, 2008
next Cognos SDK utility
Email us today if you would like to be notified when this utility has been completed.
Saturday, April 12, 2008
Cognos 8 SDK -- ContentManagerService passing authentication
CAMPassport property.
In an SDK application, the CAM Passport does not automatically propagate to other services that might be used within the application. Since the ContentManagerService is the only service than can logon and logoff, there needs to be ability to assign the CAM Passport to other services that the SDK application might require (such as the ReportService). This assignment is done simply by copying the BIBusHeader of the ContentManagerService to the BIBusHeader of the other service, thereby making that service an authenticated service.
Cognos 8 SDK -- Logging on
If anonymous access is allowed, the Cognos 8 SDK application will be granted the same rights and permissions as the Anonymous user from the Cognos namespace. If anonymous access is not allowed and a Cognos 8 SDK application does not login, an exception will occur when the SDK application tries to perform an action such as querying the content store or running a report.
All logons and logoffs are performed through the ContentManagerService using the logon() and logoff() methods. None of the other Cognos 8 services can perform a logon or logoff operation.
Sunday, March 2, 2008
Cognos 8 SDK -- example of capturing reporting history
{
boolean blnError = false;
Vector reportHistories = getReportHistories();
String reportName = "";
PropEnum props[] = new PropEnum[]{PropEnum.searchPath, PropEnum.defaultName, PropEnum.detail, PropEnum.detailTime, PropEnum.severity};
Sort sort = new Sort();
sort.setOrder(OrderEnum.ascending);
sort.setPropName(PropEnum.defaultName);
Sort[] sortOrder = new Sort[]{sort};
try
{
if(reportHistories.size() > 0)
{
for(int i =0; i < reportsearchpath =" (String)reportHistories.get(i) + "//historyDetail";
reportName = getReportName(reportSearchPath);
BaseClass bc[] = cmService.query(new SearchPathMultipleObject(reportSearchPath ), props, sortOrder, new QueryOptions());
if(bc != null && bc.length > 0)
{
for(int j =0; j < historydetail =" (HistoryDetail)bc[j];" blnerror =" true;">" + reportName + "" +
" " + historyDetail.getDetailTime().getValue().getTime() + "" +
" " + historyDetail.getDetail().getValue() + "";
}
}
}
}
}
}
catch(Exception e)
{ System.out.println("RunJobNowAndCaptureError::reportJobStatus()");
e.printStackTrace();
}
return blnError;
}
Monday, February 25, 2008
Cognos SDK -- cube drill down
item.use = "[great_outdoors_company].[Years].[Years].[Year]->:[PC].[@MEMBER].[20050101-20051231]";
item.inclusive = true;
drillOptionParameterValues d1 = new drillOptionParameterValues();
d1.name = drillOptionEnum.down;
d1.value = parameters;
drillOptions[0] = d1;
{
if (this.rptService == null)
{
this.rptService = rptService;
}
String reportPath = "/content/package[@name='Great Outdoors Company']/report[@name='MyTestReport']";
String savePath = "c:\\temp";
parameterValue[] parameters = new parameterValue[1];
asynchReply response;
searchPathSingleObject reportPathObj = new searchPathSingleObject();
reportPathObj.Value = reportPath;
try
{
option[] runOptions = new option[6];
runOptionBoolean saveOutput = new runOptionBoolean();
saveOutput.name = runOptionEnum.saveOutput;
saveOutput.value = false;
runOptions[0] = saveOutput;
// Specify the output format.
runOptionStringArray outputFormat = new runOptionStringArray();
outputFormat.name = runOptionEnum.outputFormat;
outputFormat.value = new String[] { "HTML" };
runOptions[1] = outputFormat;
//Set the report not to prompt as we pass the parameters if any
runOptionBoolean rop = new runOptionBoolean();
rop.name = runOptionEnum.prompt;
rop.value = false;
runOptions[2] = rop;
runOptionInt maxRows = new runOptionInt();
maxRows.name = runOptionEnum.verticalElements;
maxRows.value = 20;
runOptions[3] = maxRows;
option[] drillOptions = new option[1];
drillOptionParameterValues d1 = new drillOptionParameterValues();
d1.name = drillOptionEnum.down;
d1.value = parameters;
drillOptions[0] = d1;
//Set the option to always have the primaryRequest in the response
asynchOptionBoolean includePrimaryRequest = new asynchOptionBoolean();
includePrimaryRequest.name = asynchOptionEnum.alwaysIncludePrimaryRequest;
includePrimaryRequest.value = true;
runOptions[4] = includePrimaryRequest;
runOptionLanguageArray roOutputFormat = new runOptionLanguageArray();
roOutputFormat.name = runOptionEnum.outputLocale;
String[] fmt = { "en-us" };
roOutputFormat.value = fmt;
runOptions[5] = roOutputFormat;
//Run the report
response = this.rptService.run(reportPathObj, new parameterValue[] { }, runOptions);
//If response is not immediately complete, call wait until complete
if (!(response.status == (asynchReplyStatusEnum.complete)))
{
while (!(response.status == asynchReplyStatusEnum.complete))
{
//before calling wait, double check that it is okay
if (hasSecondaryRequest(response, "wait"))
{
response =
this.rptService.wait(
response.primaryRequest,
new parameterValue[] { },
new option[] { });
}
else
{
Console.Write("Error: Wait method not available as expected.");
return;
}
}
//check if output is ready
if (outputIsReady(response))
{
response =
this.rptService.getOutput(response.primaryRequest, new parameterValue[] { },
new option[] { });
}
else
{
Console.Write("output is not ready!");
}
}
String data = getOutputPage(response);
// Write the report output to file system
Console.Write("Writing the output of the original report..");
StreamWriter sw = File.CreateText(savePath + "\\original.html");
sw.Write(data);
sw.Flush();
sw.Close();
//Drill down in the report
//set up drill down parameter.
simpleParmValueItem item = new simpleParmValueItem();
item.use = "[great_outdoors_company].[Years].[Years].[Year]->:[PC].[@MEMBER].[20050101-20051231]";
item.inclusive = true;
parmValueItem[] pvi = new parmValueItem[1];
pvi[0] = item;
parameters[0] = new parameterValue();
parameters[0].name = "Year";
parameters[0].value = pvi;
response = this.rptService.drill(response.primaryRequest, parameters, drillOptions);
if (!(response.status == (asynchReplyStatusEnum.complete)))
{
while (!(response.status == asynchReplyStatusEnum.complete))
{
//before calling wait, double check that it is okay
if (hasSecondaryRequest(response, "wait"))
{
response =
this.rptService.wait(
response.primaryRequest,
new parameterValue[] { },
new option[] { });
}
else
{
Console.Write("Error: Wait method not available as expected.");
return;
}
}
//check if output is ready
if (outputIsReady(response))
{
response =
this.rptService.getOutput(response.primaryRequest, new parameterValue[] { },
new option[] { });
}
else
{
Console.Write("output is not ready!");
}
}
data = getOutputPage(response);
// Write the report output to file system
Console.Write("Writing the output of the drill down report..");
StreamWriter sw2 = File.CreateText(savePath + "\\drilldown.html");
sw2.Write(data);
sw2.Flush();
sw2.Close();
// release the conversation to free resources.
this.rptService.release(response.primaryRequest);
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message.ToString());
Console.WriteLine(ex.StackTrace);
}
}
Tuesday, February 19, 2008
Cognos 8 SDK -- prompt page with optional parameters
// parameter values
ParmValueItem pvi[] = new ParmValueItem[1];
// If you pass an empty string to an optional parameter
// it will assume that you want to match an empty string in
// the filter. To get the desired behaviour, pass an empty
// parameter value
if (!inputValue.equalsIgnoreCase("")) pvi[0] = item1;
// Assign the values to the parameter.
params[i] = new ParameterValue();
params[i].setName(prm[i].getName());
params[i].setValue(pvi);
Thursday, February 14, 2008
display the contents of a folder in the Public Folder using C# and SDK
baseClass[] bc = crn.query( "/content/folder[@name='ABCDEFG']//report", props, s, qo );
Tuesday, February 12, 2008
Cognos SDK Guide by BI Centre Sample?
Saturday, February 2, 2008
Output.aspx.cs -- Displaying the report results
try
{
_frmData = Request.Form;
_selectedPkg = _frmData.GetValues("hidPkgName").GetValue(0).ToString();
_selectedRpt = _frmData.GetValues("hidRptName").GetValue(0).ToString();
_path = "/content/package[@name='" + _selectedPkg + "']/report[@name='" + _selectedRpt + "']";
asynchDetail[] _paramDetail = _cogSDK.GetParams(_selectedPkg,_selectedRpt,_rptService);
asynchDetailParameters _params = (asynchDetailParameters)_paramDetail[0];
int _pCount =_params.parameters.Length;
parameterValue[] _pv = _cogSDK.resolvePrompts(_frmData, _pCount);
string[] reportFormat = {"HTML"};
strHTML = _cogSDK.executeReport(_path, _pv, _rptService, reportFormat, false);
Response.Write(strHTML);
}
catch(Exception ex)
{
_ErrMsg = ex.Message.ToString();
Response.Write(_ErrMsg);
}
return;
We have already seen that the executeReport() will return a string variable value of the report’s output. This is achieved by applying an asynchReply variable to the Report Service’s .run() method.
try
{
spSingle.Value = reportSearchPath;
asynchReply C8reply = reportService.run(spSingle, pv ,arrRunOpts);
if (C8reply != null)
{
strHTML = getOutputPage(C8reply);
return strHTML;
}
else
{
return null;
}
}
catch (SoapException exSoap)
{
ExHandler exCognos = new ExHandler(exSoap);
return _ErrMsg = exCognos.Details + " :-: " + exCognos.Message + " :-: " + exCognos.Severity + " :-: " + exCognos.ErrorCode;
}
catch (Exception ex)
{
return _ErrMsg = ex.Message.ToString();
}
Output.aspx.cs will finally pass this string value to the page’s Reponse.Write() and render the dataset to the end user.
Thursday, January 24, 2008
Run a report with prompts -- CognosSDK.cs
Note that our executeReport() method is looking for a Boolean value to state whether or not to prompt. When we want the prompt page then we set this Boolean value to True.
public string executeReport(string reportSearchPath,parameterValue[] pv, reportService1 reportService, string[] strFormat, bool blnPrompt){
………… method body………
…………
…………
}
The executeReport() method contains an asynchReply variable that is used to capture the conversation context of the request.
asynchReply C8reply = reportService.run(spSingle, pv ,arrRunOpts);
We will then pass the C8reply variable as an input parameter to the getOutputPage() method. This method will be used to populate a string variable with a string representation of the prompt page's HTML. It is this value that is written to PromptPage.aspx and displays the report's prompt page to the end user.
strHTML = getOutputPage(C8reply);
public string getOutputPage(asynchReply response)
{
asynchDetailReportOutput reportOutput = null;
try
{
for (int i = 0; i < response.details.Length; i++)
{
if (response.details[i] is asynchDetailReportOutput)
{
reportOutput =
(asynchDetailReportOutput)response.details[i];
break;
}
}
}
catch (SoapException exSoap)
{
ExHandler exCognos = new ExHandler(exSoap);
return _ErrMsg = exCognos.Details + " :-: " + exCognos.Message + " :-: " + exCognos.Severity + " :-: " + exCognos.ErrorCode;
}
//text based output is split into pages -- return the current page
return reportOutput.outputPages[0].ToString();
}
Before we display the prompt page to the end user we want make some modifications to the HTML that was returned. Our CustomizeHTML() helper function is used to update the HTML in order to work with our sample web solution. The main change will involve adding our own customized finish button to the prompt page to control the form's submission to Output.aspx. This will also enable us to add our own JavaScript function to the button's onClick() event. This is achieved in the CognosSDKHelper.js file.
Cognos 8 SDK google search
New C8 SDK Utility --- Cognos 8 Modification Check
· Search the Content Store for items that have been modified after a selected date value
For example, if you were looking for all reports that were modified on June 3rd, 2008 then you would select the date June 2nd, 2008. The code will search for all items that have been modified after the selected date value from the date control.
The results of the search are then rendered to a text box control.