TODATE function's possible error

I have observed todate function error couple of days back situation is like this.

One of our report consist dashboard prompt on Quarter and other columns, default quarter is set to current quarter using repository variable, report does not have any date dimension columns to display, we have one measure in this report as QTD_Amount related column in RPD defined as “ifnull(ToDate(sum(ifnull(Order_Total , 0)), [Level Quarter]) , 0)” in this situation report works as expected.

Even if I chose some other quarter using Dropdown works fine or Dash Board prompt changed to Multi Select control on Quarter and choosing “All Choices” works fine, but when I select “all choices” in dropdown then it gives following error.

Odbc driver returned an error (SQLExecDirectW).

Error Details Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P

State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 22036] Level in TODATE function (Quarter) must be a rollup of (or equivalent to) the measure level (Year). (HY000)

Report expects quarter column( level) or in other terms sql-group by expects quarter. To overcome this error we need to add level column of todate to report and hide that column if you don’t want to display.

Hope it helped.

Obiee Web Services – Using .net and C#

From many days I was thinking to blog on Web Services using .net, today I could able to make it.
If you want to see what are all available web services in Bi Server then just browse this url in any browser http:///analytics/saw.dll?WSDL you will be able to see all available services.
Here is a very basic code (kind of hello world) in C# which will logon user to BI server and get the report results.
To do that, go to report's advanced tab collect Request XML, then create project in visual studio and web reference to project as show in fig.
As per our requirement we need following class objects to achieve our task
SAWSessionService, ReportRef, XmlViewService.
Here is code which will authenticate user and gets report results as xml string.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using saw = Obiee_Services.web_Reference;
using System.IO;
using System.Data;

namespace Obiee_Services
{
class HelloWorld
{
static void Main(string[] args)
{
var sawservice = new saw.SAWSessionService();
//Give user credentials who has soap access.
var sessionID = sawservice.logon("Administrator", "");

var repRef = new saw.ReportRef();
//Pass report name along path and Request XML to ReportRef object
repRef.reportPath = @"/users/administrator/#cachehitsbyusers";
repRef.reportXml = "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"xmlVersion=\"200705140\"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"xmlns:sawx=\"com.siebel.analytics.web/expression/v1\">\" \"columnID=\"c1\"/>formula=\"SUM(S_NQ_ACCT.NUM_CACHE_HITS)\"columnID=\"c4\"/>";
var xmlViewService =new saw.XmlViewService();
var xMLQueryExecutionOptions = new saw.XMLQueryExecutionOptions();
xMLQueryExecutionOptions.maxRowsPerPage=100;
xMLQueryExecutionOptions.refresh = true;
//Pass report parameters if you have
var reportParams = new saw.ReportParams();
//Execute XML Query
var queryResults = xmlViewService.executeXMLQuery(repRef, saw.XMLQueryOutputFormat.SAWRowsetSchemaAndData, xMLQueryExecutionOptions,reportParams, sessionID);
//Output as you required
System.console.write(queryResults.RowSet);
sawservice.logoff(sessionID);
}
}
}


There are around 10 main classes and each has its own functionality.

"HtmlViewService" to embed Oracle BI HTML results into ASP or JSP or Web Portals
"IBotService" to execute Oracle iBots programmatically
"JobManagementService" to manage all jobs related things
"MetadataService" to retrieve description of columns, tables, and subject areas etc
"ReplicationService" to provide methods for replicating catalog
"ReportEditingService"to merges arguments with services data as users needed
"SAWSessionService" provides authentication related stuff
"SecurityService" to identifying accounts and there privileges
"WebCatalogService" for navigating and managing the Presentation Catalog
"XmlViewService" retrieve results from BI Web Services in XML format

http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/b31769.pdf this pdf covers all available class and respective methods exposed to end users.

--Hope you have enjoyed.

Funny Error: htmlreportgenerator

I was writing Direct Database Query while doing this, I have come across following funny error
"View Display Error Assertion failure: nFields > 0 at line 1214 of ./project/webreportgenerators/htmlreportgenerator.cpp
Error Details Error Codes: OQ78YWIW"
I have provided proper connectionpool name, proper query still i could see above error.
Funny part is, in criteria I have provided all proper information, clicked on result tab saw error, went back to criteria did nothing, again clicked on Results tab, this time query worked fine.

Even i have tried ByPassCache still same as above only.

Handy tools to analyse web page


If you want to analyze which script files or which css files are being used while accessing Obiee Dash board pages then good to go with FireBug or if you want to analyse request response headers, time analysis among request responses,tcp connections, network latancy etc in detailed then go with HTTP Aanalyzer.



Case Statement (Bins) filter.


If we have a requirement to have case statement on column and it has some filtering condition on it. Filtering cannot be achievable by make use of presentation case statements or Bins, but using repository it’s possible.
Create a new logical column with required case statement in repository pull it on to Presentation, this will works fine with all filters.
Just to demonstrate I have made a dash board page with page prompt and report. Page prompt consist rpd case statement column and also presentation case column. Report consists of same above columns and one measure in a table.
Now if you try selecting any value in presentation case prompt, report will not effected with selection where as rpd -coulmn will be works fine.
Under line concept is using rpd column formula will be placed in physical SQL’s Where clause as well as Select, contrast Bins(presentation case) – column will put case statement in only SQL’s Selection clause.

Hope helpful to you

On detail report - popup(new window) link

Today I have a requirement to show popup link (new window) on detail page, tricky part is popup link has to appear on detail report but not on main report page.

To achieve this,
Use Static Text view along compound view of report with following Java Script and also enable Contains HTML Markup check box.

[br/]
<--script type="text/javascript">function newPopup(url) {popupWindow = window.open(
url,'mywindow')}
<--a href="JavaScript:newPopup('path_to_dashboard_url_or_any_other_url');">Click Here to open in new Window </a--!>
[br/]

If we want to customize pop up window properties we can accomplish in following ways.Java Script API “Window” has all these properties which can be set through above function.
Status, toolbar, location, menubar, directories, resizable, scrollbars, height and width.
Sample example:
window.open ("http://tipsonobiee.blogspot.com",
"mywindow","menubar=0, resizable=1, width=350, height=250, location=1, toolbar=0, scrollbar=0");


Case Insensitive search

Some times performing case insensitive search through connection pool(alter session set NLS_SORT=BINARY_CI, alter session set NLS_COMP=LINGUISTIC) is not a feasible way.
Suppose in some report, user wants to have case sensitive search/filter, in this situation above solution is not feasible.

In those cases following method will be useful.

Make a filter using advanced sql option with reference column as uppercase column and also presentation variable.

In detail,

1).Create prompt assign default value as %%(to display each and every row) and also assign a variable to this.
2) Create report, in the report create a filter using advanced – Convert this filter to SQL option, now in this edit box make reference column as upper case and also variable.

In this way we can achieve case insensitive search problem.