Archive for February, 2009

Feb 25 2009

CRM 4 iFrame Printing

Published by under Programming,Software

Last year I was working with a client to develop some ISV add-ins for Microsoft Dynamics CRM.  Recently I was alerted to the fact that one of them – a seperate aspx page that loads in an iFrame on the account details panel – wasn’t printing correctly.

It displayed correctly in the normal view form, appeared correctly on the print preview form but when actually printed it was collapsed down to one or two pixels high.

After doing a bit of research, I found this post by Vince Bullinger, in which he gets around the problem by, as far as I can tell, modifying a core CRM css file.  Whilst this will work, it should be noted that any modification to core CRM files is not supported and will almost certainly break or be lost by updates and hotfixes.

Another problem with the code Vince Bullinger gives is that the iFrames a fixed height and that applies to ALL ISV iFrames.  However, with this knowledge I was able to  come up with my own solution that uses a bit of Javascript to ensure that iFrames are printed and at the correct height to display all the content:

<%@ Page Language="C#" AutoEventWireup="true"
    CodeBehind="Summary.aspx.cs" Inherits="CRMWeb.SummaryStatus.Summary" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Summary Status</title>
    <style type="text/css">
        #pageWrapper
        {
            position: absolute;
            top: 0;
            left: 0;
        }
    </style>
</head>
<body>
    <div id="pageWrapper">
    <form id="form1" runat="server">
        <!-- content goes here -->
    </form>
    </div>
    <script language="javascript" type="text/javascript">
        var dh = document.getElementById("pageWrapper").offsetHeight;
        document.parentWindow.frameElement.height = dh;
        document.parentWindow.frameElement.style.display = "block";
        document.parentWindow.frameElement.style.height = dh + "px";
    </script>
</body>
</html>

This solutions requires that you surround the content of your page with a div, in this case <div id=”pageWrapper”></div>.  This is used by the block of Javascript at the end.

The purpose of the Javascript is to use the pageWrapper div to find out the height of the content.  This height is then used to set the height of the iFrame that contains the page and to set the display style of the iFrame to block.

It probably doesn’t require the iFrame height and the iFrames style.height both being set but I decided to take a belts and braces approach.

In addition to ensuring the iFrame content is printed, I am also planning on implementing the code on Vince Bullingers page for loading a specific css stylesheet for printing.

kick it on DotNetKicks.com

2 responses so far

Feb 11 2009

Microsoft Enterprise Search Roadmap

Published by under .NET,Programming,Software

When I first started developing with SharePoint in June last year the last thing that was on my mind was Enterprise Search.  I had considered it the sort of technology that you just plug in a magic box and it just did all the work for you.

Recently, however, I have been involved in developing a customised search solution using Microsoft Office SharePoint Server (MOSS) to allow a client to search client and non-client related documentation within their organisation.   What I rapidly discovered is that enterprise search is not a plug-and-play affair.  A lot of thought needs to go into the meta data that is used to define the taxonomy of the data (in this documents) and also how users are going to interact with search and how to make sure they get the information they need.

I have also recently been on a training course at FAST Search,which was acquired by Microsoft in April 2008.  The course was both an introduction to the structure of FAST ESP and also an in-depth look into customising the internal, both feeding content into the indexing engine of FAST ESP and building a rich user experience for getting content from the FATS ESP search engine.

The two activities have really awaken me to how powerfull enterprise search can be in empowering users to find information which previously they either may not have know how to access or, more likely, simply hadn’t known existed.  Whilst I was learning about FAST Search, it was generally anticipated that it would be included with the next generation of MOSS.  Today that was confirmed at FASTForward ’09 when Microsoft announced its roadmap for enterprise search which has two initial streams, firstly FAST Search for Internet Business which is mainly aimed at internet retail businesses – like you’d use to find products on Amazon.  The second, and more interesting for me, stream is FAST Search for SharePoint, which will integrate FAST Search more closely with SharePoint and would be used for the type of internal information discovery that I have been working on recently.

Mark Harrisson also noted on his blog that Microsoft is going to be offering ESP for SharePoint immediately which is

a special offering that allows customers to purchase high-end search capabilities today, with a defined licensing path to FAST Search for SharePoint when it becomes available.

I haven’t been able to find out more information about ESP for SharePoint, but it certainly looks like it could be an interesting product to get hold of.  I the mean time I’m keen to continue working with MOSS Enterprise Search and have just the right project lined up to flex my new found love of search on.

No responses yet

Feb 02 2009

Snow fun!

Published by under Current Affairs

Today Guernsey has seen it’s heaviest snow fall in approximately 18 years. The BBC has been taken over by stories about snow in the UK and facebook seems to be clogged up with students and workers taking the day off.

It would appear, however, that not everyone is happy with the snow. Several news reports have included people grumbling about how the country wasn’t prepared.

Whilst I agree that the Met office was forecasting snow and therefore the gritters could have been out earlier but you can’t get them out too early or the melting snow will wash the salt off or, if it’s dry, the salt will be blown off.

In terms of snow ploughs, you need a significant amount of snow in order to prevent damage to the roads. The same for snow chains or studded tyres, if the isn’t a layer of ice the Tarmac gets shredded and then the same people will be complaining about the quality of the road surface.

With regards trains, the main problem, as far as I’m aware, is freezing points. It is possible to upgrade all the points but, again, is it worth it for an event that happens every 10-15 years? It is potentially possible to do it during a planned maintenance cycle. However I suspect the are more pressing matters for the money to be spent on.

Quite frankly, I enjoy the snow and work doesn’t rule my life so much that I panic and get frustrated just because I can’t get to the office. I also noticed today that people out walking were actually more pleasant to each other. Even 4×4 drivers were offering people walking a lift!

One response so far