(c) 2002 Visual Studio magazine 
Fawcette Technical Publications

Issue: May 2002
Section: Database Design
Author: Josh Lane
Filename: vs0205dd

- It is assumed that the Web Service will be installed on the same machine as the client software.  If this is not true, you will need to modify the Web Service reference in the ReportServiceSmartProxy project to point to the correct Web Service.

- Run the "remote reporting.sql" script on your SQL Server machine.  The script must be run on the Northwind sample database.

- Create a new IIS virtual directory called "RemoteReports" and extract the contents of RemoteReports.zip into the folder it points to.

- Extract ReportServiceSmartProxy.zip and RemoteReports_project.zip into their own folders. These contain the Visual Studio.NET projects you will use to debug and customize the sample code.

- Open and build both projects. Be sure to customize the SQL connection string on line 44 of ReportService.asmx.cs in the RemoteReports project.

- Note that each time you build the ReportServiceSmartProxy.dll, you'll need to either copy it into the Global Assembly Cache (look up GACUtil.exe or 'Global Assembly Cache' in the .NET docs) or re-set the reference to it in the Excel macro VBA project (it loses the reference each time you rebuild the DLL). Either one is tedious, but I can't find a good work-around. If you choose to use the GAC, be sure to remove your old DLL from the GAC before adding your new one. This isn't absolutely necessary, but you probably don't want to clog up your machine's GAC with outdated assemblies.

- Copy RemoteReportService.xla into <system drive>:\Documents and Settings\<USERNAME>\Application Data\Microsoft\AddIns.

- Start Excel

- Navigate to Tools->Addins menu... check "Run Reports", then "ok" (only have to do this once, next time you run Excel the toolbar will show up by default)

- Click custom toolbar button "Run Remote Report Engine"

- Two valid username/password combos...

	- ndavolio/nancy
	- afuller/8839$

- To debug the Excel macro, navigate to Tools->Macro->Visual Basic Editor... single-click on 'RemoteReportService.xla'... here you can re-set the reference to ReportServiceSmartProxy.dll by navigating to Tools->References.  You can also debug into the code for Form1, which does all the data retrieval and formatting.

- If you want to debug the smart proxy code, start Excel (make sure to reset the reference to the proxy DLL if you've rebuilt it, or copy the new version into the GAC), open the ReportServiceSmartProxy project and navigate to Debug->Processes. Find EXCEL.ExE in the list, and click 'Attach'.  Set some breakpoints in the proxy code.  Now execute the macro in Excel, and you should hit your breakpoints.  Occasionally it takes two trys for me to hit the breakpoints... I'm not sure if this is a beta bug, or pilot error.

- To debug the Web Service, follow a similar procedure to above, but open the RemoteReports project and attach to inetinfo.exe.
