cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR : Cannot get data set while connecting to BI.

Former Member
0 Kudos

Hi,

I am trying to connect to BI trouggh my application. I am following one of the document which i got from SDN. But now i am getting ERROR : Cannot get data set while connecting to BI. Can any one tell me why i am getting this error.

when i tried to excecute first time it gave the same error for the bellow given Querry. But after that it got excecuted. Then again It gave the same error. But it got excecuted twise like that after that it dint get excecuted once also.

Querry: SELECT

[Measures].MEMBERS ON AXIS(0) ,

NON EMPTY [0VENDOR].MEMBERS ON AXIS(1)

FROM [0PUR_C01/0PUR_C01_DB_Q04];

Regards,

H.V.Swathi

Edited by: H.V Swathi on Jun 1, 2009 1:33 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Can you elaborate on the approach you followed to connect to BI.

Are you using BIApplicationFrame UI element in WebDynpro or You are directly navigating to BEx Iveiw?

Regards,

Charan

Former Member
0 Kudos

HI,

Thanks for ur reply.

NO

i am using this part of code to display the result in IFrame.

IConnectionFactory connectionFactory = null;
	IBIConnection connection = null;
	IBIDataSet dataset = null;
//	   get the MDX statement entered by the User
	String mdxStatement = wdContext.currentContextElement().getMDXQ();
	wdComponentAPI.getMessageManager().reportSuccess("mdxStatement  "+mdxStatement.toString());
//	   Declare a stringbuffer to store the HTML Code
	StringBuffer l_strXmlFile = new StringBuffer();
	wdComponentAPI.getMessageManager().reportSuccess("l_strXmlFile  "+l_strXmlFile.toString());
	try {
//	   ********************************************************
//	   Connect to BW System
//	   ********************************************************
	Context initctx = new InitialContext();
//	   Perform JNDI lookup to obtain connection factory
	   wdComponentAPI.getMessageManager().reportSuccess("l_strXmlFile eeeeee ");
	connectionFactory =
	(IConnectionFactory) initctx.lookup(
	"deployedAdapters/SDK_XMLA/shareable/SDK_XMLA");
//	   Establish connection using default connection properties
	   wdComponentAPI.getMessageManager().reportSuccess("connectionFactory  "+connectionFactory);
	connection =
	(IBIConnection) connectionFactory.getConnectionEx(null);
	wdComponentAPI.getMessageManager().reportSuccess("connection  "+connection);
	IBIOlap olap = ((IBIConnection) connection).getOlap();
	wdComponentAPI.getMessageManager().reportSuccess("olap  "+olap);
//	********************************************************
//	Execute the MDX statement and retrieve the data set
//	using the execute method of the IBIOlap interface.
//	********************************************************
 dataset = olap.execute(mdxStatement);
 wdComponentAPI.getMessageManager().reportSuccess("dataset  "+dataset);
 } catch (Exception e) {
 e.printStackTrace();
 wdComponentAPI.getMessageManager().reportException(
 e.getLocalizedMessage(),
 true);
 } finally {
 try {
 connection.close();
 } catch (Exception e1) {
//	TODO Auto-generated catch block
 e1.printStackTrace();
 }
 }
if (dataset == null) {
 wdContext.currentContextElement().setResult_Visibility(
 WDVisibility.NONE);
 } else {
 wdContext.currentContextElement().setResult_Visibility(
 WDVisibility.VISIBLE);
//	********************************************************
//	Render the data set.
//	********************************************************
 l_strXmlFile
 .append("<html>")
 .append("<head></head>")
 .append("<body>");
//	Display the MDX that has been executed.
 l_strXmlFile
 .append("<p><b>MDX Statement that was executed:</b><br> ")
 .append("<span class=\"code\">")
 .append(mdxStatement)
 .append("</span> </p>");
 try {
 BIDataSetTableModel table =
 new BIDataSetTableModel(dataset, false);
 l_strXmlFile.append("<p>Result set:</p>");
 l_strXmlFile.append(
 "<table width=700 border=1 cellpadding=0 cellspacing=0>");
 int row = table.getRowCount();
 int col = table.getColumnCount();
 for (int i = 0; i < row; i++) {
 l_strXmlFile.append("<tr>");
 for (int j = 0; j < col; j++) {
 BITableItem item = (BITableItem) table.getValueAt(i, j);
 l_strXmlFile.append("<td class=\"headCenter\">"); l_strXmlFile.append(Helpers.escape(item.toString()));
 l_strXmlFile.append("</td>");
 }
 l_strXmlFile.append("</tr>");
 }
 l_strXmlFile.append("</table>");
 l_strXmlFile.append("</body></html>"); } catch (BISQLException e2) {
//	TODO Auto-generated catch block
 e2.printStackTrace();
 }
//	read the stringbuffer into bytes
 byte[] l_byteData = null;
 try {
 l_byteData = l_strXmlFile.toString().getBytes("UTF-8");
 } catch (UnsupportedEncodingException e) {
 wdComponentAPI.getMessageManager().reportException(
 e.getLocalizedMessage(),
 false);
 }
//	Create a web resource and set the value of the
//	context variable "IFrameData" to it's URL
 IWDCachedWebResource l_File =
 WDWebResource.getWebResource(
 l_byteData,
 WDWebResourceType.HTML);
 try {
 wdContext.currentContextElement().setIFrameData(
 l_File.getURL());
 } catch (WDURLException e1) {
 wdComponentAPI.getMessageManager().reportException(
 e1.getLocalizedMessage(),
 false);
 }
 }

Reagards,

H.V.Swathi

Former Member
0 Kudos

Hi,

Why are you using IFrame (Which is deprecated). For BI - WebDynpro integration you need to use BIApplicationFrame UI element.

And your code is not clear..

Regards,

Charan

Former Member
0 Kudos

Hi,

IFrame is deprecated. You need to use BIApplicationFrame to connect to BI system.

Pls post the code clearly.

Regards,

Charan