Navigation

Wednesday 16 April 2008

Displaying an Access Report in a Web Part

ok .. so who uses Microsoft Access anymore ???
 
You might be surprised that the Report Designer is becoming increasingly popular now that the ability to link to SharePoint data has been added in. From any SharePoint list you should be able to select "Actions" and then "Open in Access" .. which then gives you the option of taking a copy of the data, or (even better) creating a link to the data in SharePoint (allowing you to report and query the SharePoint data direct from the SharePoint database!!)
 
This of course opens up the possibilities of non-technical end users creating rich reports using nothing more than Microsoft Access and a couple of out of the box web parts.
 
 
I must give a nod of thanks to the guys over at ProgrammingMSAccess, their samples on embedded Snapshots are the ones I am using in my web part.
So .. how can we get up and running?
 
First, add a Content Editor Web Part. Enter the following code into the Source of the web part (by modifying the web part, and using the built-in source editor).
<OBJECT ID="SnapshotViewer" WIDTH=800 HEIGHT=600
CLASSID=
"CLSID:F0E42D60-368C-11D0-AD81-00A0C90DC8D9">
<PARAM NAME="_ExtentX" VALUE="16722">
<PARAM NAME="_ExtentY" VALUE="11774">
<PARAM NAME="_Version" VALUE="65536">
<PARAM NAME="SnapshotPath"
VALUE=
"http://webserverURL/folder/snapshotfilename.snp">
<PARAM NAME="Zoom" VALUE="0">
<PARAM NAME="AllowContextMenu" VALUE="-1">
<PARAM NAME="ShowNavigationButtons" VALUE="-1">
</OBJECT>

The only part you have to change is the "VALUE" attribute for the "SnapShotPath" node (I've highlighted it for you to make it easy ;)). This needs to be a URL that points to the SnapShot file (preferably in a Document Library in your SharePoint Site - Anyone viewing this report will need Read access to it.).

That is pretty much all there is to it. Feel free to play about with the "Width" "Height" "AllowContextMenu" and "ShowNavigationButtons" ... I'm sure they are all pretty straightforward! ;)

One final note - All users who want to view the report must have Snapshot Viewer for Microsoft Access installed on their workstation (otherwise the web part will just be blank).

Example Report - Shown on a standard Web Part Page:

 Snapshot Image



No comments:

Post a Comment

This blog has been moved to www.martinhatch.com

Note: only a member of this blog may post a comment.