↓ Skip to main content
The technical notebook of Bryan Avery

Ideas worth sharing.

Practical notes on software architecture, cloud platforms, security and AI. Written from real engineering experience, with an eye on what actually works.

A little about me

Latest articles

553 articles in the archive

Writing to the Event Log from your Application

·1 min
Have you tried to write to the Event Log from within your application? It's not hard to write to the Event Log these days, in fact .Net makes it quite easy. Where the issue come is when you deploy your application you find the the operating environment does not have enough permissions. I found a good article this morning on how to over come this by Rory Primrose

Implementing a Data Processing Extension

·5 mins
Introduction I will take you through how to deploy your own Custom Data Process Extension for SQL Server Reporting Server 2005, both on the server and for use within your development environment. Background I've been using and writing Reports for SQL Server Reporting Services for some time now, and it has come time to write my own Security Implementation for the reports. In order for me to do this, I needed to find out how to change the Data Sources within Reporting Services. I did find some resource information on Microsoft TechNet: Implementing a Data Processing Extension. I found this article both useful and hard to follow, hence I have written this CodeProject article to help you get up and going as quickly as possible. Prerequisites I assume you are familiar with SQL Reporting Services, what they are, design, and installation. For more info about this subject, click here. You should have SQL Reporting Services 2005 already installed. Visual Studio 2005 with SQL Server Reporting Services Report Templates installed. Compile the Custom Data Source Extension After loading the source code, you will need to reference the "Reporting Services Interfaces". In my case, it is located in: C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.ReportingServices.Interfaces.dll; however, this may differ for your installation. Once you have made the reference, you should be able to compile the application. Installation of the Custom Data Source After downloading the source above for the custom data processing extension, you must install it to enable access. The installation process is performed in two steps: Installing and configuring the extension. Configuring extension security. This particular extension is used both by the Reporting Server and within the Visual Studio 2005 Report Designer; both have a different location for configuration, either on the server or your development machine. However both configurations are very similar. Development Installation Two configuration files are required to be changed in order for you to be able to see your Custom Data Source from within the development environment. These files typically are held in C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies; these files are: RSReportDesigner.config RSPreviewPolicy.config Copy your assembly First, you need to copy the Custom Data Source files to the "PrivateAssemblies" folder, as this is where they are referenced. Setup the configuration file The RSReportDesigner.config holds the reference to the Extension. The following needs to be added to the <Data> tag within the <Extension> tag: Collapse <Extension Name="CUSTOM_DATASOURCE" Type="DataSourceExtension.DataSetConnection, DataSourceExtension" /> In order for the designer to use the Custom Data Source, you need to add the following to the <Designer> tag, usually situated just below the <Data> tag: Collapse <Extension Name="CUSTOM_DATASOURCE" _Type="Microsoft.ReportingServices.QueryDesigners.GenericQueryDesigner,Microsoft.ReportingServices.QueryDesigners"/> You will notice that this time we are pointing to the standard Microsoft Generic Query Designer. This is because we are trying to build a Custom Data Source Extension and not a Query Designer. What you should end up with is a RSReportDesigner.config file, looking something like this: Collapse <Configuration> <Add Key="SecureConnectionLevel" Value="0" /> <Add Key="InstanceName" Value="Microsoft.ReportingServices.PreviewServer" /> <Add Key="SessionCookies" Value="true" /> <Add Key="SessionTimeoutMinutes" Value="3" /> <Add Key="PolicyLevel" Value="rspreviewpolicy.config" /> <Add Key="CacheDataForPreview" Value="true" /> <Extensions> <Render> <Extension Name="XML" Type="Microsoft.ReportingServices.Rendering.XmlDataRenderer.XmlDataReport,Microsoft.ReportingServices.XmlRendering" /> <Extension Name="CSV" Type="Microsoft.ReportingServices.Rendering.CsvRenderer.CsvReport,Microsoft.ReportingServices.CsvRendering" /> <Extension Name="IMAGE" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.ImageReport,Microsoft.ReportingServices.ImageRendering" /> <Extension Name="RGDI" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.RemoteGdiReport,Microsoft.ReportingServices.ImageRendering" Visible="false" /> <Extension Name="PDF" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.PdfReport,Microsoft.ReportingServices.ImageRendering" /> <Extension Name="HTML4.0" Type="Microsoft.ReportingServices.Rendering.HtmlRenderer.Html40RenderingExtension,Microsoft.ReportingServices.HtmlRendering" Visible="false" /> <Extension Name="HTML3.2" Type="Microsoft.ReportingServices.Rendering.HtmlRenderer.Html32RenderingExtension,Microsoft.ReportingServices.HtmlRendering" Visible="false" /> <Extension Name="MHTML" Type="Microsoft.ReportingServices.Rendering.HtmlRenderer.MHtmlRenderingExtension,Microsoft.ReportingServices.HtmlRendering" /> <Extension Name="EXCEL" Type="Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer,Microsoft.ReportingServices.ExcelRendering" /> </Render> <Data> <Extension Name="SQL" Type="Microsoft.ReportingServices.DataExtensions.SqlConnectionWrapper,Microsoft.ReportingServices.DataExtensions" /> <Extension Name="OLEDB" Type="Microsoft.ReportingServices.DataExtensions.OleDbConnectionWrapper,Microsoft.ReportingServices.DataExtensions"/> <Extension Name="OLEDB-MD" Type="Microsoft.ReportingServices.DataExtensions.AdoMdConnection,Microsoft.ReportingServices.DataExtensions"/> <Extension Name="ORACLE" Type="Microsoft.ReportingServices.DataExtensions.OracleClientConnectionWrapper,Microsoft.ReportingServices.DataExtensions"/> <Extension Name="ODBC" Type="Microsoft.ReportingServices.DataExtensions.OdbcConnectionWrapper,Microsoft.ReportingServices.DataExtensions"/> <Extension Name="XML" Type="Microsoft.ReportingServices.DataExtensions.XmlDPConnection,Microsoft.ReportingServices.DataExtensions"/> <Extension Name="RS" Type="Microsoft.ReportingServices.DataExtensions.RSDPConnection,Microsoft.ReportingServices.DataExtensions"/> <Extension Name="CUSTOM_DATASOURCE" Type="DataSourceExtension.DataSetConnection, DataSourceExtension" /></Data> <Designer> <Extension Name="SQL" Type="Microsoft.ReportingServices.QueryDesigners.VDTQueryDesigner,Microsoft.ReportingServices.QueryDesigners"/> <Extension Name="OLEDB" Type="Microsoft.ReportingServices.QueryDesigners.VDTQueryDesigner,Microsoft.ReportingServices.QueryDesigners"/> <Extension Name="OLEDB-MD" Type="Microsoft.ReportingServices.QueryDesigners.ASQueryDesigner,Microsoft.ReportingServices.QueryDesigners"/> <Extension Name="ORACLE" Type="Microsoft.ReportingServices.QueryDesigners.VDTQueryDesigner,Microsoft.ReportingServices.QueryDesigners"/> <Extension Name="ODBC" Type="Microsoft.ReportingServices.QueryDesigners.VDTQueryDesigner,Microsoft.ReportingServices.QueryDesigners"/> <Extension Name="XML" Type="Microsoft.ReportingServices.QueryDesigners.GenericQueryDesigner,Microsoft.ReportingServices.QueryDesigners"/> <Extension Name="RS" Type="Microsoft.ReportingServices.QueryDesigners.SMQLQueryDesigner,Microsoft.ReportingServices.QueryDesigners"/> <Extension Name="CUSTOM_DATASOURCE" Type="Microsoft.ReportingServices.QueryDesigners.GenericQueryDesigner,Microsoft.ReportingServices.QueryDesigners"/></Designer> </Extensions> </Configuration> Security configuration The security is held in the RSPreviewPolicy.config file, which is in the same folder as the configuration file (RSReportDesigner.config). This file provides the security policy for SQL Server Reporting Services and allows access to your DLL. Collapse <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="Customer_DataSource"Description="Code group for my Custom DataSource for data processing extension"><IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\DataSourceExtension.dll"/> </CodeGroup> Server Installation To configure the Custom Data Extension on the server where your reports will be running, is a case of following the above, except you'll find the configuration files held in a different location, and depending on the installation, they appear in different places. On my installation file, they are all held in C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin and the configuration files are held inC:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer, with the names of the configuration files being: rsreportserver.config rssrvpolicy.config As this is a server install, you will not need to make or add the <Designer> tag. Testing of the Custom Data Source Extension In order to test the Custom Data Source Extension, you will need to generate either a report or a Shared Data Source that points to the new custom Data Source Extension. Create a new project within Visual Studio 2005, select a "Business Intelligence Project", and select the "Report Server Project Wizard" from the list of templates. On the new data type list, you should see "Custom DataSource Extension". If, however, you don't, but you do see CUSTOM_DATASOURCE, this means that the configuration has not picked up your DataSourceExtension.dll, and you will need to check over the configuration files. Enter a connection string, like the following: "FileName=C:\bottles.xml", you'll find this file at the top in the download section. Click next, this will take you to the "Design a Query" screen. Enter the following query: "select * from company", as shown below: Click Next, and then continue until you have finished creating a report. You should now be able to run the report with the new Custom DataSource Extension that you can customise and shape to your own needs. Points of Interest Now that you have it running and working, it is worth going over how to debug the Custom Data Extension. I was not intending to cover this in this article, and will reference you to Microsoft TechNet on Debugging Data Processing Extension Code, as this should provide you with sufficient information on how to setup debugging. History First release.

Simple PayPal

·1 min
Simple connection and Controls to make those PayPal payment easier I created this simple set of controls to make it easier to add PayPal simple buttons, all you need is a PayPal account and the buttons can point to allow you to make payment. Please feel free to test out the BuyNow button in to my account b_avery@yahoo.com, all funds welcome. Currently I am only adding features as and when I need them, but feel free to make comments or requests in the Discussions and Issue Tracker sections Source can be found at CodePlex Other sources worth look at are : Use of the PayPal payment system in ASP.NET http://www.codeproject.com/KB/aspnet/UsePayPalPaymentInASPNET/

Report Viewer

·4 mins
 Having a number of SSRS reports is all well and good, but if the end users can not see the reports it is useless, therefore we need to generate a method of viewing the reports via a small application.

Dynamic Data

·1 min
With the release of .Net 3.5 SP1 comes ASP.NET Dynamic Data. Dynamic Data is a great tool to generate an administration website for your data access, enabling you to get at the data in a very simple method.

Pod Casts on the move

·1 min
I am always after good pod casts to listen to when you are not busy, driving the car or on the train. So I thought I'd start to compile a list of worth listening to Pod Casts

Changing Membership provider

·1 min
Need to change the membership provider programmatically? string username = "user"; string password = "password"; MembershipUser membershipUser = Membership.Providers["SqlMembershipProviderOther"].GetUser(username); membershipUser.ChangePassword(membershipUser.ResetPassword(), password); Also worth checking out here 

Increase Development by increasing the speed of Visual Studio

·1 min
Like Windows Vista, you can perform a number of changes to increase the performance of Visual Studio. First make sure you have the latests Service Pack installed. Under Options, make sure Animation environment tools. If you don’t use the Navigation bar, then turn this off. Make sure Track changes of off. In Options, Text Editor and uncheck Track Changes. Track Active Item in Solution Explorer, remove this, it can be found in Options, Projects and Solutions. (Don’t do this for a VB application) Disable AutoToolboxPopulate, this is found in Options, Windows Forms Designer Disable the Startup screen by selecting Show Empty Environment When loading Visual Studio, disable the splash screen “devenv.exe /nosplash”

Code Style Enforcer

·1 min
 Make sure your code is styled correctly Code Style Enforcer is a DXCore plug-in for Visual Studio 2005 / 2008 that checks the code against a configurable code standard and best practices. It is developed for C#, but some of the rules will also work for VB .NET, though not tested. The code standard is currently configurable with the following rules…[more]

Client Application Services in VS2008

·1 min
Just ran in to an issue of security when having many web applications. I needed all the web application to use the same security access, after a little research I found that Client Application Services in VS2008 works a treat, as it has been written to handle security in the cloud.

ZoomIt

·1 min
Can't read what is on the screen, or need to highlight something to someone, you don't have to be running presentation to have this tool. ZoomIt is screen zoom and annotation tool for technical presentations that include application demonstrations. ZoomIt runs unobtrusively in the tray and activates with customizable hotkeys to zoom in on an area of the screen, move around while zoomed, and draw on the zoomed image. I wrote ZoomIt to fit my specific needs and use it in all my presentations.

.NET Framework 3.5 SP1 and 4.0 Poster

·1 min
Here is a list of what is new in .NET 3.5 SP1 and what is to come in .NET 4, also this is a nice example of deep zoom, just zoom in to what you would like to see.

App.Config Custom Configuration

·1 min
I wrote this small POC, with a little help from samples around the Internet, to retrieve a custom configuration from the application config file (such as web.config) It uses the Microsoft classes ConfigurationSection, ConfigurationElementCollection, and ConfigurationElement

Is LINQ to SQL about to be killed off?

·1 min
Are you developing using LINQ to SQL, and like all good technologies you just want to keep using them, well it looks like Microsoft will be pulling the plug on LINQ to SQL, over the fact the LINQ to Entities will continue forwards in future releases.

LINQ Samples

·1 min
I found this very good examples of LINQ samples, I can’t remember where I got it from, so I have upload to my Blog for safe keeping. LINQ Samples.zip (4.27 mb) I found another LINQ samples which include LINQ to Objects LINQ to SQL LINQ to XML LINQ to XML Part II LINQ to DataSet LINQ to Entities I got it from Charlie Calvert’s Community Blog, and I have placed them here on my Blog for safe keeping. MarchCtpSamples-v04.zip (3.78 mb)

New .Net Logo

·1 min
After 8 years, Microsoft are rebranding .Net, and here is the new Logo For more details click here