Archive for July, 2009

Javascript Export HTML table to MS Excel (JScript)

Here’s a little code snippet to export an HTML table to MS Excel through utilising ActiveXObject(“Excel.Application”) from Internet Explorer.

The JavaScript (in this case utilising Microsoft’s JScript) runs over the table displayed pulling out the relevant data and exporting into the instantiated copy of Excel. This is a working example based loosely on Microsoft’s http://support.microsoft.com/kb/234774 Knowledgebase Article “How to automate Excel from an HTML Web page by using JScript”.

Worth noting is that the garbage collection between the JScript and MS Excel doesn’t work too well and more often than not one can be left with the instantiated copy of MS Excel still in memory (see it in the Task Manager). One must manually remove these instances.

Perhaps dynamically inputting a module to clean up from within MS Excel on the workbook deactivating might clear this up – not tried this though!?

  • Share/Bookmark

Organisational Expectations of an Intranet

Organisations anticipate a return on the investment involved in implementing Intranets expressed in financial terms or intangible benefits; an expectation their Intranet will either save money, enhance efficiency or both.

Organisations however, are not cohesive bodies with unified needs or interests; instead they are formed by individuals, each with their own intrinsic self-interest and motivations for working within the framework of an organisation. Organisational expectations when broadly defined conflict with the behaviour of users. Users’ expectations are practical, organisations expectations strategic ultimately providing an inherent tension between these different formulations of expectation.

The expectations then that organisations have of Intranets introduce inherent conflicts in their function. Intranets are expected to do several things simultaneously under the umbrella of a single resource: to merge the communicative function and the informative function; to do things cheaper and do things better; to disseminate new information and store old information.

Organisations often expect Intranets to take over existing functions, such as the dissemination of information without affecting the nature of those functions. For example, paper resources migrated to Intranets with little or no modification.

Ensuing Information Wasteland

Strategic expectations of organisations then create conflict in the implementation of Intranets from the tension between the qualities of information; a confusion between the communicative function and an informative function.

This single platform for all information needs becomes a confusing aggregate of differing types of information with different functions and different characteristics, all presented to the user as if they are of the same value – confusing end user expectations of information retrieval and in turn deflating the original assumption that an Intranet will “either save money, enhance efficiency or both”!

An examination of these “end-user” expectations are required to enable alignment with organisational expectations.

  • Share/Bookmark

Export Access to Excel with Custom Headers

Have you noticed how the “out the box” solution to export your dataset from MS Access to MS Excel doesn’t give much room to give custom headers to your worksheet?

Through utlising ActiveX you can instantiate a copy of MS Excel in memory to add in your own custom headers etc. prior to exporting your MS Access dataset into the worksheet.

The below code example shows you how to add 5 custom headers to your sheet. Just add in your own SQL query where it is indicated.

  • Share/Bookmark

Google margin

Is it just me or has google added a margin around their search results? An ID of ‘gsr’ on the body tag appears to apply ‘margin: 3px 8px;’ bumping the results in at each side!

Clocked this on Tuesday night and thought it was a mistake with my setup or someone at google had screwed something up and it’d flip back – but no! Here we are and I’ve either gone mad or the margin is here to stay! I find it quite disconcerting to behonest.

Nah! Here’s to progressive development. Change is a good thing. . .  even if it’s some whitespace!

  • Share/Bookmark