Archive | Web Dev

Integrating OBIEE with SharePoint Server (MOSS + OBIEE)

A colleague of mine is huge on Microsoft SharePoint (MOSS) and with good reason; It is Microsoft’s #2 best sold licensed software product behind Microsoft Office. It is a collaboration tool, a CMS, a document repository, and now with PeformancePoint 2007 rolled into the suite is will be an analytical tool. And, since quite a few organizations that have implemented SharePoint use it as their launchpad portal for all things internal (intranet) it only makes since to be able to integrate SharePoint with more powerful heterogeneous analytical tools like OBIEE. But the big question I have heard over the last few months is, “What is the best approach to integrating OBIEE into SharePoint?”.  In this blog post I will point you to a White Paper on the subject and some integration code you can use to get started with your integration.

Ultimately we need to look at the limitations of communicating with OBIEE as I describe below.
Read the full story

Posted in Business Intelligence, OBIEE, SharePointComments (0)

Consuming a Web Service in OBIEE Presentation Services using JQuery CDN

Understanding web services in general is a big benefit for anyone using integrated technologies today.  That includes any system that integrates a web client on a closed intranet network or open network with access to the world wide web.  Because OBIEE presentation services is ultimately a web-based tool using your favorite web browser one would hypothesize that utilization of web services could also be incorporated by bringing in external data or reading from network data sources. 

This post will show how to leverage presentation services to pull in a web service and integrate the web service data into our Dashboard.  This is a low level example just to get you thinking about the grand possibilities of the integration. 

The data we will consume stems from a Yahoo.com web service built inside an Answers report view.  It does not require any database integration or schema modifications. We will display it in the dashboard.  In the dashboard our final product looks like this:

Read the full story

Posted in Business Intelligence, JQuery, OBIEE, Potpourri, TutorialsComments (4)

JavaScript - Find the Text Between Two Words

Using basic JavaScript and Regular Expressions I was looking for a way to parse any text string and capture only a segment of text within that string.  This is really a scenario of parsing. 

Logically to do what I needed one must know in advance what the preceeding and subsequent text or symbols of the desired text segment will be.  Typically this already pre-determined so that part was easy.  Once, I had that, I wrote a function using the “match” method of a JavaScript string variable to bump against the reg ex and poof the match method splits out an matching results into an indexed array.  I only want the first match so I call upon it to get my answers.

Here is the code, just wrap it in a <script> tag when you are ready to rock in roll.

var myText = "< ?xml version='1.0' encoding='utf-8'?><callbackstatusmsg xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns='http://tempuri.org/'><returnmsg>$j('#statusContainer').slideDown('slow');$j('#statusType').removeClass('error').addClass('good');$j('#statusMessage').html('Saved Successfully.');cancelMainFormOperation();</returnmsg>
<returnaction>approve sign up</returnaction><returncode>0</returncode>
<isdatacomplete>false</isdatacomplete>
</callbackstatusmsg>";

function parseReturnedXML(strToParse, strStart, strFinish)
{
alert("start test");

var str = strToParse.match(strStart + "(.*?)" + strFinish);

if (str != null) {
alert("Parsed Item: " + str[1]);
}
else
alert("The string result returned null for the matching.\nReturn blank, null, or the strToParse var if you want.");

alert("end test");
}

And here is the function call below. Just place it in the body of your HTML in another <script> tag or below the actual function in the main HEAD section script tag.

parseReturnedXML(myText, "<returnmsg>", "</returnmsg>");

 

Super Cool Note

I am absolutely no stranger to JavaScript but I finally paid attention to something that some of you may or may not already know. When you declare a variable in JS using the var declaration you variable then becomes an object (ex: var str;). At which point you the ability to hold other object variable data such as the array that stems from another object. In the example of above “strToParse” becomes an object var as it is passed as an argument into the function. It is inherently an object by being an argument. However, if we did not declare the variable “str” using “var” (which is allowed) we would get an error when trying to evaluate the match method call from strToParse. Try it yourself. Remove the var declaration and run your script to view the result. You can also use your favorite IDE that has intellisense to view the methods an object has when declared with var and when it has not been declared using var.

 

Conclusion

In the example above I used a hard-code XML string of data inside the function, but did leave a parameter, strToParse, so that the text we want to parse can be passed in the function call.  XML for the string to parse is not necessary, I just wanted to show that this Reg Ex usage works not just for alphanumeric characters but also symbols, etc.  Manimuplate the code anyway you see fit to work with your applications.

Posted in JavaScriptComments (1)

C# Convert Decimal to String

Microsoft usually has good documentation but on this particular topic I always felt that it was lacking. Here is the MS core documentation for converting a decimal to a string, http://msdn.microsoft.com/en-us/library/59095yyw.aspx.

I recently needed to ensure that I was only getting only two decimal places on a dollar amount as I converted it into a string and was going to write a nice lengthy post myself and then I found this really nice post over at csharp-examples (view post).

Mainly I was looking for the following syntax just to ensure that I was setting up things correctly:

// just two decimal places
String.Format("{0:0.00}", 123.4567);      // "123.46"
String.Format("{0:0.00}", 123.4);         // "123.40"
String.Format("{0:0.00}", 123.0);         // "123.00"

They have some other great custom formatting items as well. Check ‘em out.

Posted in C#.NETComments (0)

Simple SubSonic Project Collection Retrieve

Using the subsonic project ORM for .NET clearly has tons of benefits for DAL and BLL purposes.

A great way to get a list of records from the db is to use the collection object which is created for tables and view objects from the db.

Here are two examples of how to use the .Load() method and overload to get data in a collection for which you can loop through using a foreach() statement.

Using the Query Object with Collection Object

Query q = new Query(Views.Accounts);
q.WHERE("accountID", Comparison.Equals, _accountID.value.ToString());

AccountsCollection obj1 = new AccountsCollection();
obj1.Load(q.ExecuteReader());

Using only the Collection Object

AccountsCollection obj1 = new AccountsCollection().Where("accountID", Comparison.Equals, accountID.value.ToString()).Load();

 

Now, to loop through the Collection
Once the collection has been instantiated and the Load() method called a foreach() loop can take place to get the records.

if (obj1.Count > 0)
{
   foreach (Accounts x in obj1)
   {
      Console.Write("My Account Name is {0}", x.AccountName);
   }
}
else
   Console.Write("There are no accounts in the collection");

Posted in ASP.NET, Business Intelligence, Potpourri, SubSonic Project, Web DevComments (0)