lørdag 17. oktober 2009

Monte Carlo, SharePoint, Energies Trading and Office 2007 userabilty.

Hi Guy's,

If you remember correctly I had previosuly created two posts showing Office 2007 Applications producing Monte Carlo risk simulations by using Application task panes and adhering to the Office 2007 fluent ribbon standards laid down my Microsoft.

I had to remove this screen casts due to popfly shutting down, so I want to blogg a little about what I have just finished for a Large scale energies and financial BI system here in Norway.

We have SQL Server Analysis, SharePoint, Excel Services, Performance Point and Oracle. Were using a combination of WCF and Web Services to communicate information. We are using Web Applications archeiecture and Office 2007 clients for UI Elements.

Our development enviroment is DB (SQL/PLSQL), .NET 3.5, WPF/Silverlight, oXML, VBA, VSTO, SharePoint API/WebServices.

More coming soon...

onsdag 7. oktober 2009

OCR SharePoint Style

Hi Folks,

How about a Workflow in SharePoint with built in OCR (Opitcal Character Recognition)?

There are a few solutions that provide this but after doing a little research I realised that the Office 2007 applications come with OCR scanning OOB. So I went in search of coding against this office component.

Turns out that a nice little NameSpace (using .NET of course) allows you to minipulate OCR on images. You must have Office 2007 client installed on the Server, so this is one draw back but then again I believe considering the amount you save its worth it.

So we start of by creating a SharePoint Worfklow in (STATE MACHINE/SEQUENTIAL) Visual Studio 2008, Associate it to the correct lists, add some actions and then when you get to your OCR scanning code part reference the following DLL's:

DocumentFormet.OpenXML - This one is from the OpenXML SDK from Microsoft.
MODI - This one is from Office 2003/7 Scanning software.

Add the following using statements:

using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml;

Add a Class wide variable:

MODI.Document md;

* If you dont have MODI available its becuase you probably didnt install it when configuring the installation of Office. If you need to goto Control pannel > add/remove programs > Office 2007 > Change then right click the Scanning software and select "intall now" option (not on "install on first time ran"!)

Bellow is a function that will allow you to perform OCR on a TIFF.

private void OCR(String Name)
md.OCR(MODI.MiLanguages.miLANG_NORWEGIAN, true, true);

string strText = String.Empty;

MODI.Image image = (MODI.Image)md.Images[0];
MODI.Layout layout = image.Layout;

for (int i = 0; i < layout.Words.Count; i++)
MODI.Word word = (MODI.Word)layout.Words[i];
if (strText.Length > 0)
strText += " ";
strText += word.Text;
// do something with the Words here...

Update soon,....