Sharepoint Thumbnails and AssetUploader.aspx

We recently had a consultant build a web part for us that displayed thumbnails from images in a document library. In digging around in the code they gave us I discovered that they used a page built into Sharepoint called AssetUploader.aspx (in 12\TEMPLATE\LAYOUTS\AssetUploader.aspx, available off any web at _layouts\AssetUploader.aspx). This page is a rather handy. It’s specifically designed to take a URL of an available image, resize it, and spit out a thumbnail. You can use it in any page or web part in Sharepoint by creating an IMG tag like this:

1
<img src=”http://www.blogger.com/_layouts/AssetUploader.aspx?Size=Medium&ImageURL=/mysitecollection/mysite/MyImagesDocumentLibrary/IMG1234.jpgalt=”My Image” />

If you use a size of ‘Small’, it will make the largest dimension of the image 70 pixels, and if you use anything other than small (Medium, Large, etc.), it will make the largest dimension of the image 140 pixels.
It worked wonderfully in our test environment, but once we brought it into production, it broke. All we saw were little generic white document icons - no thumbnails. Yikes!

Read More

NAV Automation Object

I took me a good while, but I finally managed to get my first automation object created, compiled, and made visible in NAV. Stefano Demiliani provided most of the guidance that I needed on this, as well as a few postings on mibuso, but there were a few other tricks I picked up on in the process that I figured I’d share here. Also, since I couldn’t find one anywhere else, I figured I’d post a complete Visual Studio sample project.

You can download the sample project at http://bitsofinsanity.blob.core.windows.net/public/NavAutomation.zip

Please note that I am far from an expert on COM objects - I figured out just enough to get my code to compile and work, but it’s highly likely that my work is suboptimal, so if anyone has any ideas for improvement, please share them.

I suppose I should explain what I’m talking about. Microsoft Dynamics NAV is an ERP system that contains and manages our Finances, Accounting, HR, Events, and more. It has tables of data (backed by SQL Server), forms to display the data, reports, and more. Each of these object types can have code behind it controlling what it does. However, the extensibility is limited to using COM objects, which are called ‘Automation Objects’ in NAV. But so long as you can create a COM object properly, you can insert it into a table or form and, through that COM object, you can do whatever the .Net framework allows you to do.

Read More