<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>LifeCycle Solutions, LLC - Weblog</title>
  <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/" />
  <link rel="self" href="http://blog.lifecycle-solutions.com/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2010-05-06T13:59:48.7237713-05:00</updated>
  <author>
    <name>LifeCycle Solutions, LLC</name>
  </author>
  <subtitle>Technical Writing</subtitle>
  <id>http://blog.lifecycle-solutions.com/</id>
  <generator uri="http://dasblog.info/" version="2.2.8279.16125">DasBlog</generator>
  <entry>
    <title>SharePoint 2010 PowerShell Kung-Fu: Email Farm Web Analytics</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/2010/05/06/SharePoint2010PowerShellKungFuEmailFarmWebAnalytics.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,88ed8e4a-40b2-42d7-ba41-4117353d7b07.aspx</id>
    <published>2010-05-06T13:59:48.7237713-05:00</published>
    <updated>2010-05-06T13:59:48.7237713-05:00</updated>
    <category term="PowerShell" label="PowerShell" scheme="http://blog.lifecycle-solutions.com/CategoryView,category,PowerShell.aspx" />
    <category term="SharePoint" label="SharePoint" scheme="http://blog.lifecycle-solutions.com/CategoryView,category,SharePoint.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
SharePoint 2010 has fairly rich Web Analytics and usage reporting functionality. 
You can see plenty of useful stats and charts across your farm.  However, at
farm level, it’s missing an important feature – email subscriptions.  In site
collection admin, you can subscribe to stats for a given site collection, but in Central
Admin (AFAIK), you can’t set up email subscriptions on the overall farm stats, or
stats for an entire web app.
</p>
        <p>
Hopefully, this feature will be added in the future, but as a quick fix, I whipped
together a wonderful hack that can be used to scrape-and-send just about any of the
reports- or other content as well.
</p>
        <div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">$wc = <span style="color: #0000ff">new</span>-<span style="color: #0000ff">object</span> net.webclient</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">$cred = [System.Net.CredentialCache]::DefaultCredentials;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">$wc.Credentials = $cred</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">$reportMarkup = $wc.DownloadString(<span style="color: #006080">"http://yourcentraladmin/_layouts/WebAnalytics/Report.aspx?t=SummaryReport&amp;l=wa&amp;Id=http%3a%2f%2fyourserver%2f&amp;WebAppName=YourWebApp&amp;DURATION=7&amp;CD=false&amp;SHOWANALYZETAB=1"</span>)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">$reportStart = $reportMarkup.IndexOf(<span style="color: #006080">'&lt;table
class="ms-listviewtable"'</span>)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">$reportEnd = $reportMarkup.IndexOf(<span style="color: #006080">'&lt;/table&gt;'</span>,
$reportStart) + 8</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">$reportMarkup = $reportMarkup.Substring($reportStart, $reportEnd - $reportStart)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">Send-MailMessage -To you@yourcompany.com -From sharepoint@yourcompany.com -Subject <span style="color: #006080">"Web
Analytics"</span> -Body $reportMarkup -BodyAsHtml -SmtpServer smtpiron</pre>
          </div>
        </div>
        <p>
This script just downloads the page, scrapes the relevant area, and sends it off as
email.  To use, you’ll need to fix up the url, scraping code, and mail addresses
as needed, then schedule in scheduled tasks.
</p>
        <p>
With a little more effort, you could even scrape together an ‘admin’ report to give
you a quick glance at the most relevant Central Admin content such as health, analytics,
and search crawl info.
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=88ed8e4a-40b2-42d7-ba41-4117353d7b07" />
      </div>
    </content>
  </entry>
  <entry>
    <title>SharePoint PowerShell Kung-Fu: Compare Folders to Fix a Bum Web Front-End</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/2010/03/22/SharePointPowerShellKungFuCompareFoldersToFixABumWebFrontEnd.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,f682e9b7-2bfa-4129-89d0-edd4ed3120b2.aspx</id>
    <published>2010-03-21T21:07:40.0856005-05:00</published>
    <updated>2010-03-21T21:07:40.0856005-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ve been working on a large SharePoint 2010 rollout and learning quite a bit about
managing the farm using PowerShell.  I’ve never been much of a console junkie
– we have _Graphical_ User Interfaces for a reason, right?  But, it’s always
good to have an extra tool in the belt, so when one of my Web Front Ends was refusing
to serve up a site, and the SharePoint log was being less than helpful, I came up
with some PS to compare it to a working server and was able to fix my problem.
</p>
        <p>
The error I was seeing was that a certain site returned a ‘404 file not found’ error
browsing to the root of one of the sites, but only from one web front-end.  By
putting an entry in my host file and trying the 3 web front-ends, I isolated the server. 
Looking in the logs, even with verbose logging, only revealed an ‘Unknown SPRequest
error occurred’.
</p>
        <p>
The next step, then, was to compare the failing server with a working one.  If
you aren’t familiar with SharePoint’s architecture – it manages copying supporting
files between multiple servers for failover, scale, and redundancy.  If you aren’t
familiar with SharePoint’s headaches, that process is apparently harder than it sounds,
and occasionally, files will be missing from servers.  The end result is that
requests that hit one server may fail, while requests to another succeed. 
</p>
        <p>
I’m sure there are utilities I could have used to do this, but after a little sleuthing,
I came up with the following PowerShell to compare the default sharepoint folders
on the two servers:
</p>
        <div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">$prod01 = dir <span style="color: #006080">'C:\Program
Files\Common Files\Microsoft Shared\Web Server Extensions\14'</span> -recurse | ?{$_.mode
-match <span style="color: #006080">"d"</span>}</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">$prod02 = dir <span style="color: #006080">'\\spprod02\c$\Program
Files\Common Files\Microsoft Shared\Web Server Extensions\14'</span> -recurse | ?{$_.mode
-match <span style="color: #006080">"d"</span>}</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">Compare-Object $prod01 $prod02</pre>
          </div>
        </div>
        <p>
This stores the directory listing, containing only folders, of one server in one variable,
and of the second server in another variable.  Compare-Object then compares the
two, and spits out the results.  In my case- a feature that had failed to deploy
to the second server.  Redeploying fixed the issue, and immediately the ‘404
file not found’ error went away.
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=f682e9b7-2bfa-4129-89d0-edd4ed3120b2" />
      </div>
    </content>
  </entry>
  <entry>
    <title>PDC 2009 News</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/2009/11/18/PDC2009News.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,ee77c6db-c5fc-4871-88cd-55c9bd5d6ac4.aspx</id>
    <published>2009-11-18T16:02:54.1629518-06:00</published>
    <updated>2009-11-18T16:07:33.9552734-06:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I didn’t make it to PDC 2009, but have been watching the twitter feeds, rss, and live
videos to be sure I’m up on all the latest goodies.  Unfortunately, that <a href="http://microsoftpdc.com/WhatsHappening/Attendees-Receive-a-FREE-Acer-Tablet-PC-Today">won’t
get me a free multitouch tablet PC</a>, but here are some of the other cool things
that have come out of this year’s conference so far:
</p>
        <ul>
          <li>
            <a href="http://www.microsoft.com/surface/Pages/Technical/Learn.aspx">General availability
of Surface SDK</a>.  You used to have to pay $10k for a big ass table and the
rights to develop for it.  Now you can just download the SDK and go crazy. 
Of course, you’ll still need the table if you want to actually use your app. 
</li>
          <li>
            <a href="http://pinpoint.microsoft.com/en-US/Dallas">Microsoft code-name “Dallas”</a> aggregates
quality content for you to mash up and use in your apps, providing strongly-typed
classes to let you query and work with things like crime stats, GIS info, and news. 
</li>
          <li>
            <a href="http://pinpoint.microsoft.com/en-US/">Microsoft Pinpoint</a> is a new ‘app
store’ for various windows apps and services. 
</li>
          <li>
            <a href="http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx">Windows Server
AppFabric</a> helps you build scalable web and composite apps by providing caching,
Workflow, WCF, and other services for your .NET apps. 
</li>
          <li>
Several new <a href="http://code.msdn.microsoft.com/Project/ProjectDirectory.aspx?TagName=WebAppToolkits">Web
App Toolkits</a> to give you a head start on common web apps. 
</li>
          <li>
A <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=413E88F8-5966-4A83-B309-53B7B77EDF78&amp;displaylang=en">training
kit</a>,  update to the Azure SDK and <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=bce4ad61-5b76-4101-8311-e928e7250b9a&amp;utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+MicrosoftDownloadCenter+%28Microsoft+Download+Center%29&amp;utm_content=Twitter">Microsoft
Sync support for SQL Azure</a></li>
          <li>
A <a href="http://www.microsoft.com/windowsazure/tco/">ROI calculator for Azure</a>. 
</li>
          <li>
            <a href="http://www.silverlight.net/getstarted/silverlight-4-beta/">Silverlight 4
Beta</a>
          </li>
        </ul>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=ee77c6db-c5fc-4871-88cd-55c9bd5d6ac4" />
      </div>
    </content>
  </entry>
  <entry>
    <title>eCommerce in the Cloud: Running NopCommerce on Azure</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/2009/09/30/eCommerceInTheCloudRunningNopCommerceOnAzure.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,40062c69-8d94-4444-84a1-2a55595ca745.aspx</id>
    <published>2009-09-30T00:34:39.0413122-05:00</published>
    <updated>2009-09-30T00:34:39.0413122-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://www.nopcommerce.com/">NopCommerce</a> is a well-written open source
eCommerce application based on .NET and SQL Server. It’s clean, full-featured, but
not bulky and unwieldy like some of it’s competitors. <a href="http://www.microsoft.com/azure/">Azure</a>,
if you aren’t familiar with it, is Microsoft’s upcoming ‘Cloud Computing’ platform,
which allows customers to run .NET applications in Microsoft’s massive data centers
with advanced load balancing and high availability.  One key feature of Azure,
and cloud computing in general, is that the hosting can be scaled to meet demand. 
If demand is high, then with literally one button click, you can make the application
run on 2,3, or 20 instances (which can be thought of as servers, though they are technically
virtual server instances).  You pay only for the instances and bandwidth you
use at any given time.
</p>
        <p>
In eCommerce, this has a very practical implications: you can ramp up the site at
peak shopping times, such as holidays, and scale back when not as many people are
hitting the site.  In addition, the organization need not invest in servers and
IT to maintain them and can focus on their business instead of complex tasks like
database backups, load balancing, and clustering infrastructure.  With Azure’s
pricing model, this functionality is within the reach of mom-and-pop stores as well
as larger companies.
</p>
        <p>
That explains a little why NopCommerce in the cloud is cool.  But how hard is
it to do?  Well, I was able to get NopCommerce running on Azure in just a few
hours with relatively little fuss.  In a real project, there would of course
be all of the normal issues, such as setting up products, design, and such, but Azure
was really not much more difficult than your typical hosting provider.  Here’s
how I went about it.
</p>
        <p>
          <strong>Creating a SQL Azure Database</strong>
        </p>
        <p>
Azure offers several different flavors of data access.  The easiest to work with
is probably SQL Azure, which is essentially a slightly modified version of SQL 2008. 
To set this up, you simply click ‘Create Database’ on the SQL Azure management page,
and enter in a database name.  SQL Azure gives you connection strings to use
in your app, with the default ADO.NET or even ODBC and OLEDB providers.  I had
to adjust these connection strings (removing the ‘tcp:’ prefix).
</p>
        <p>
          <a href="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/eCommerceintheCloudRunningNopCommerceonA_13A8B/image_10.png">
            <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/eCommerceintheCloudRunningNopCommerceonA_13A8B/image_thumb_4.png" width="690" height="358" />
          </a>
        </p>
        <p>
Once set up, it’s possible to connect SQL Server Management Studio (after jumping
through a few minor hoops), or as I did, run the <a href="http://sqlazuremw.codeplex.com/">SQL
Azure Migration Wizard</a> to copy a database from my PC to SQL Azure.  This
tool is nice, but in the version I used had a few bugs that I think are now fixed. 
A few SQL Server features aren’t supported in SQL Azure, so you have to tweak most
DB scripts to run.  The wizard does this for you, but misses some. Fortunately,
the errors are easy to fix:
</p>
        <ul>
          <li>
‘text’ and ‘image’ are not supported.  Use varchar(max) and varbinary(max) instead. 
</li>
          <li>
ROWGUID is not supported.  Use DEFAULT NewId() 
</li>
          <li>
Some SQL Server metadata information is not available.  This meant <a href="http://www.danielroot.info/2009/09/dotnetnuke-on-azure-not-quite-ready.html">DotNetNuke
could not function as-is against SQL Azure</a>. 
</li>
        </ul>
        <p>
One the wizard completes, the database is deployed to the cloud, but contains no data. 
I used SQL Management Studio to script the data as INSERT statements (Generate Scripts…turn
off all scripts except ‘Script Data’) and run them against the SQL Azure instance.   
</p>
        <p>
To test, I changed the connection string in nopCommerce’s configuration, and it worked! 
</p>
        <p>
          <strong>Creating a New Cloud Web App</strong>
        </p>
        <p>
          <a href="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/eCommerceintheCloudRunningNopCommerceonA_13A8B/image_8.png">
            <img style="border-right-width: 0px; margin: 0px 5px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="left" src="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/eCommerceintheCloudRunningNopCommerceonA_13A8B/image_thumb_3.png" width="403" height="288" />
          </a>You
don’t simply FTP files to Azure.  Instead, they are packaged in a custom format
that contains some service configuration information.  (Also, applications are
not just Web apps – Worker apps, similar to windows services, can be packaged and
deployed as well).  With Azure Tools for VS installed, I added a ‘Web Cloud Service’
named ‘AzureNopCommerceStore’ to the existing NopCommerce solution. 
</p>
        <p>
I copied the references and files from the ‘NopCommerceStore’ ran.  Somewhat
to my surprise, everything built and ran, which underscores that this is the same
ASP.NET you’re already used to –not a different, scary language or something like
ASP.NET MVC (which, by the way is also supported in Azure).  A few bugs did arise,
though.  Azure apps run in a limited trust environment in which some functionality
is not permitted.  If you’ve developed in Medium Trust, you know the sorts of
restrictions, but these are a even more restricted.  <a href="http://msdn.microsoft.com/en-us/library/dd179369.aspx">A
list of restrictions is available here</a>, but in NopCommerce, the mostly revolved
around code that generates bitmaps and tries to save them to disk, causing a FileIOPermissions
error.
</p>
        <p>
This makes sense – if deployed to multiple instances, writing a file to one instance
will not be ‘synced’ up to the other instances.  Instead, you are supposed to
store files like this in Azure Blob Storage.  However, in interest of time, I
opted to instead generate pictures on the fly, and not cache them to disk at all. 
I wrote a quick page to do this, and modified ‘PictureManager’ to accommodate. 
</p>
        <p>
With that out of the way, the app ran with no errors (that I’ve found yet, anyway).
</p>
        <p>
          <strong>Publishing to the Cloud</strong>
        </p>
        <p>
At this point, NopCommerce is running with one foot in the cloud.  It’s running
against a SQL Azure Database in Microsoft’s datacenters, but the app itself is running
on a little simulated cloud on my laptop.  To get the app running in production,
you right click the ‘AzureNopCommerceStore’ and click ‘publish’.  Visual Studio
builds, then creates two files – a package containing all of the web pages, etc.,
and a configuration file.  The Azure website is opened to a page that allows
uploading these files.  Once uploaded, the deployment can be run and the app
is ‘live’ on Azure.
</p>
        <p>
One particularly nice feature here is that the publishing infrastructure allows for
a ‘Staging’ and ‘Production’ environment.  The package can be uploaded to Staging,
tested, then with a single click, transferred over to Production.  Brilliant.
</p>
        <p>
          <a href="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/eCommerceintheCloudRunningNopCommerceonA_13A8B/image_14.png">
            <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/eCommerceintheCloudRunningNopCommerceonA_13A8B/image_thumb_6.png" width="543" height="282" />
          </a> 
</p>
        <p>
I only get one Azure hosting service to play with in the CTP so it may go away if
I decide to try something else out, but for now, you can see it running here:
</p>
        <p>
          <a title="http://danielazure.cloudapp.net/default.aspx" href="http://danielazure.cloudapp.net/default.aspx">http://danielazure.cloudapp.net/default.aspx</a>
        </p>
        <p>
          <strong>How to Build 20 Servers in 1 Click</strong>
        </p>
        <p>
One more cool thing I want to show here.  The promise of Azure is that the hosting
service can be adjusted as needed to meet demand.  You can imagine in current
scenarios if you needed to set up load balancing for an app, you would order another
server, install software, deploy your app, etc. all in a few weeks at best. 
If you have a virtual environment, you would provision another server in a few minutes
and deploy your app, which is nice, and essentially what Azure does behind the scenes. 
But check out the UI for it:
</p>
        <p>
          <a href="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/eCommerceintheCloudRunningNopCommerceonA_13A8B/image_16.png">
            <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/eCommerceintheCloudRunningNopCommerceonA_13A8B/image_thumb_7.png" width="608" height="316" />
          </a>
        </p>
        <p>
By changing ‘Instance count=”1”’ to “20” and clicking ‘Save’, I get 20 virtual instances
serving up my site.  I did ‘2’ and it took about 5 minutes to provision. 
As I understand it, future releases will support growing and shrinking instances automatically,
but for now this is pretty close.
</p>
        <p>
          <strong>Conclusion</strong>
        </p>
        <p>
A few things still remain to be done.  I haven’t fully tested, especially around
payment gateways and the like, so there still may be bugs to resolve.  Also,
I’m not certain how SSL and custom domains work, though I imagine they are supported. 
Finally, to really take advantage of Azure, it may make sense to move away from SQL
Azure, which is limited to 10GB of data, to one of the other storage options. 
This would require more code, but should be feasible.  For all of the hype, in
my mind Azure and other cloud offerings really are just next generation hosting providers,with
some services such as “infinite” storage and security federation added.  Instead
of waiting hours or days for dedicated servers or shared hosting, highly available
hosting is provisioned in minutes.  From a developer perspective, working with
Azure required some know-how and coding, but in general it is not much more difficult
than working with other hosting providers.  If you’re a developer and haven’t
tried it yet, give it a shot today.
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=40062c69-8d94-4444-84a1-2a55595ca745" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Help Your SharePoint Users Help Themselves</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/2009/07/24/HelpYourSharePointUsersHelpThemselves.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,7a84f51b-dab8-4d9b-ae2c-1972fb70b412.aspx</id>
    <published>2009-07-24T10:53:20.7352528-05:00</published>
    <updated>2009-07-24T10:55:23.1324718-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <div style="float:left; width:405px;">
          <a href="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/HelpYourSharePointUsersHelpThemselves_9A2D/image_2.png">
          </a>
          <a href="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/HelpYourSharePointUsersHelpThemselves_9A2D/image_4.png">
            <img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/HelpYourSharePointUsersHelpThemselves_9A2D/image_thumb_1.png" width="404" height="166" />
          </a>
          <img style="border-right-width: 0px; margin: 0px 10px 0px 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" align="left" src="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/HelpYourSharePointUsersHelpThemselves_9A2D/image_thumb.png" width="405" height="228" />
        </div>
        <p>
This is just a quick and pretty obvious tip, but worth posting I think.  We recently
rolled out a SharePoint solution for a customer and as an afterthought I added a Wiki
called 'About this Site' to the home site.  As I identified areas in training
that they might need help remembering, I added pages to the wiki with very short steps
to do various tasks.  In addition, I showed them how to add their own articles. 
Each took just a few minutes to add, and in the end, they had easily accessible documentation
on their particular SharePoint install.  I wondered if they'd use it, but I was
pleasantly surprised when I logged in and saw 'Last Modified by:' wasn't me! 
SharePoint can be pretty daunting to new users, and even old ones.  By adding
documentation using the customer's name and terminology familiar to the customer,
we made the site much more approachable.
</p>
        <p>
As a bonus, I was able to export the wiki as a template and can now re-use it elsewhere,
though I'll need to take care to change the customer name everywhere as needed. 
I may look into putting one of these up publicly and building up a generic reusable
wiki templates to install as starting places for various common SharePoint scenarios.
</p>
        <p>
This idea extends to non-SharePoint apps as well.  I'm trying this concept to
document some ASP.NET MVC apps for customers.  Those haven't rolled out yet,
but the customer seems to like the idea so far.
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=7a84f51b-dab8-4d9b-ae2c-1972fb70b412" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Azure Pricing Now (finally) Available</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/2009/07/14/AzurePricingNowFinallyAvailable.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,a8033d13-19df-4792-8dff-63d8d2e64c5b.aspx</id>
    <published>2009-07-14T09:24:33.1024506-05:00</published>
    <updated>2009-07-14T09:24:33.1024506-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
It's been a long time coming, but Azure's <a href="http://blogs.msdn.com/windowsazure/archive/2009/07/14/confirming-commercial-availability-and-announcing-business-model.aspx">pricing
model is now available</a>.  
</p>
        <p>
Windows Azure:
</p>
        <ul>
          <li>
Compute @ $0.12 / hour 
</li>
          <li>
Storage @ $0.15 / GB stored 
</li>
          <li>
Storage Transactions @ $0.01 / 10K 
</li>
        </ul>
        <p>
SQL Azure: 
</p>
        <ul>
          <li>
Web Edition – Up to 1 GB relational database @ $9.99 
</li>
          <li>
Business Edition – Up to 10 GB relational database @ $99.99 
</li>
        </ul>
        <p>
.NET Services: 
</p>
        <ul>
          <li>
Messages @ $0.15/100K message operations , including Service Bus messages and Access
Control tokens 
</li>
        </ul>
        <p>
Bandwidth across all three services will be charged at $0.10 in / $0.15 out / GB
</p>
        <p>
This translates to a minimum of about $90 to $100 for a small single-server forms-on-data
app in the cloud. This is very competitive pricing compared to Amazon E3 windows instances,
which run about $1/hour and up, and comparable to low-end dedicated server hosting
plans.  In addition, Microsoft is announcing initiatives to enable private cloud
services via System Center and public cloud services by licensing and other efforts
aimed at hosting services like MaximumASP.
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=a8033d13-19df-4792-8dff-63d8d2e64c5b" />
      </div>
    </content>
  </entry>
  <entry>
    <title>How To Render Reporting Services Reports From ASP.NET MVC</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/2009/06/08/HowToRenderReportingServicesReportsFromASPNETMVC.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,e87b551b-c06a-40c9-8d58-25825609a200.aspx</id>
    <published>2009-06-08T17:14:41.6968921-05:00</published>
    <updated>2009-06-08T17:14:41.6968921-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Frequently, I'll have add-on reports that we don't necessarily want to deploy to a
full Reporting Services installation.  I don't need the scheduling or other features
of Reporting Services and would rather just run them in-application and return the
result.  To this end, I've written a "WebReportRender" class that takes
an .rdlc and renders it as a PDF to the browser.  In WebForms, this meant some
goo to render the Http headers to trigger a file download in the browser. I've wrapped
all that nicely and it's served me well the past few years. Now,  ASP.NET MVC
adds a nice FileContentResult which wraps some of this goo for you.  To reuse
WebReportRender in  ASP.NET MVC, I had to add methods to just output the byte
array without the Http Headers:
</p>
        <div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> System;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> System.Collections.Generic;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> System.IO;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> System.Linq;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> System.Net.Mail;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> System.Text;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> System.Web;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> Microsoft.Reporting.WebForms;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">namespace</span> LifeCycle.Reporting</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
Assists in executing and rendering Reporting Service reports.</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;/summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> WebReportRenderer
: IDisposable</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#region</span> Private
fields</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">private</span>
              <span style="color: #0000ff">string</span> fullReportPath;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">private</span>
              <span style="color: #0000ff">string</span> downloadFileName;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">private</span> LocalReport
reportInstance;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">private</span> MemoryStream
reportMemoryStream;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">private</span>
              <span style="color: #0000ff">string</span> reportMimeType;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#endregion</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#region</span> Constructor</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
Initializes a new instance of the &lt;see cref="WebReportRenderer"/&gt;
class.</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;/summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="reportPath"&gt;The report path.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="downloadFileName"&gt;Name of the download file.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span> WebReportRenderer(<span style="color: #0000ff">string</span> reportPath, <span style="color: #0000ff">string</span> downloadFileName)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">if</span> (HttpContext.Current
== <span style="color: #0000ff">null</span>) <span style="color: #0000ff">throw</span><span style="color: #0000ff">new</span> InvalidOperationException(<span style="color: #006080">"This
class is only for use from web applications."</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">this</span>.downloadFileName
= downloadFileName;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            fullReportPath = HttpContext.Current.Server.MapPath(reportPath);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> (System.IO.FileStream
reportFile = <span style="color: #0000ff">new</span> System.IO.FileStream(fullReportPath,
System.IO.FileMode.Open, FileAccess.Read))</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                reportInstance = <span style="color: #0000ff">new</span> LocalReport();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                reportInstance.LoadReportDefinition(reportFile);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#endregion</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#region</span> Properties</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
Gets the report instance.</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;/summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;value&gt;The report instance.&lt;/value&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span> LocalReport
ReportInstance</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            get</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">return</span> reportInstance;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#endregion</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#region</span> Public
Methods</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
Renders the current ReportInstance to the user's browser as a PDF download.</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;/summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="pdfDeviceInfoSettings"&gt;The PDF device info settings (see
http://msdn2.microsoft.com/en-us/library/ms154682.aspx).&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;returns&gt;&lt;/returns&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span> Warning[]
RenderToBrowserPDF(<span style="color: #0000ff">string</span> pdfDeviceInfoSettings)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            CreateStreamCallback callback = <span style="color: #0000ff">new</span> Microsoft.Reporting.WebForms.CreateStreamCallback(CreateWebBrowserStream);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            Warning[] warnings;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            HttpContext.Current.Response.ContentType = <span style="color: #006080">"application/octet-stream"</span>;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            HttpContext.Current.Response.AddHeader(<span style="color: #006080">"Content-Disposition"</span>, <span style="color: #006080">"attachment;
filename=\""</span> + downloadFileName + <span style="color: #006080">"\""</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            reportInstance.Render(<span style="color: #006080">"PDF"</span>, <span style="color: #0000ff">null</span>,
callback, <span style="color: #0000ff">out</span> warnings);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">return</span> warnings;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
Renders the current ReportInstance to the user's browser as a PDF download.</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;/summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;returns&gt;&lt;/returns&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span> Warning[]
RenderToBrowserPDF()</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">return</span> RenderToBrowserPDF(<span style="color: #0000ff">null</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
Renders the current ReportInstance to an email with a file attachment containing the
report.</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;/summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="pdfDeviceInfoSettings"&gt;The PDF device info settings (see
http://msdn2.microsoft.com/en-us/library/ms154682.aspx).&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="toAddress"&gt;To address.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="fromAddress"&gt;From address.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="subject"&gt;The subject.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="body"&gt;The body.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;returns&gt;&lt;/returns&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span> Warning[]
RenderToEmailPDF(<span style="color: #0000ff">string</span> pdfDeviceInfoSettings, <span style="color: #0000ff">string</span> toAddress, <span style="color: #0000ff">string</span> fromAddress, <span style="color: #0000ff">string</span> subject, <span style="color: #0000ff">string</span> body)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            CreateStreamCallback callback = CreateMemoryStream;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            Warning[] warnings;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            reportInstance.Render(<span style="color: #006080">"PDF"</span>,
pdfDeviceInfoSettings, callback, <span style="color: #0000ff">out</span> warnings);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            reportMemoryStream.Seek(0, SeekOrigin.Begin);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            var client = <span style="color: #0000ff">new</span> SmtpClient();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> (var
message = <span style="color: #0000ff">new</span> MailMessage(fromAddress, toAddress,
subject, body))</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> (var
attachment = <span style="color: #0000ff">new</span> Attachment(reportMemoryStream,
reportMimeType))</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                attachment.Name = downloadFileName;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                message.Attachments.Add(attachment);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                client.Send(message);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">return</span> warnings;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">byte</span>[]
RenderToBytesPDF()</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">string</span> mimeType;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">string</span> encoding;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">string</span> fileNameExtension;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">string</span>[]
streams;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            Warning[] warnings;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">return</span> reportInstance.Render(<span style="color: #006080">"PDF"</span>, <span style="color: #0000ff">null</span>, <span style="color: #0000ff">out</span> mimeType, <span style="color: #0000ff">out</span> encoding, <span style="color: #0000ff">out</span> fileNameExtension, <span style="color: #0000ff">out</span> streams,</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">out</span> warnings);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">byte</span>[]
RenderToBytesExcel()</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">string</span> mimeType;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">string</span> encoding;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">string</span> fileNameExtension;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">string</span>[]
streams;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            Warning[] warnings;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">return</span> reportInstance.Render(<span style="color: #006080">"EXCEL"</span>, <span style="color: #0000ff">null</span>, <span style="color: #0000ff">out</span> mimeType, <span style="color: #0000ff">out</span> encoding, <span style="color: #0000ff">out</span> fileNameExtension, <span style="color: #0000ff">out</span> streams,</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">out</span> warnings);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
Renders the current ReportInstance to an email with a file attachment containing the
report.</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;/summary&gt; </span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="toAddress"&gt;To address.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="fromAddress"&gt;From address.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="subject"&gt;The subject.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="body"&gt;The body.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;returns&gt;&lt;/returns&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span> Warning[]
RenderToEmailPDF(<span style="color: #0000ff">string</span> toAddress, <span style="color: #0000ff">string</span> fromAddress, <span style="color: #0000ff">string</span> subject, <span style="color: #0000ff">string</span> body)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">return</span> RenderToEmailPDF(<span style="color: #0000ff">null</span>,
toAddress, fromAddress, subject, body);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#endregion</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#region</span> Private
Methods</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
Formats the current response output and returns the output stream suitable for rendering
to the browser as a file download.</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;/summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="name"&gt;The name.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="extension"&gt;The extension.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="encoding"&gt;The encoding.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="mimeType"&gt;Type of the MIME.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="willSeek"&gt;if set to &lt;c&gt;true&lt;/c&gt; [will seek].&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;returns&gt;&lt;/returns&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">private</span> Stream
CreateWebBrowserStream(<span style="color: #0000ff">string</span> name, <span style="color: #0000ff">string</span> extension,
System.Text.Encoding encoding, <span style="color: #0000ff">string</span> mimeType, <span style="color: #0000ff">bool</span> willSeek)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">return</span> HttpContext.Current.Response.OutputStream;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
Creates a memory stream that can be used by the report when rendering to an email
attachment.</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;/summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="name"&gt;The name.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="extension"&gt;The extension.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="encoding"&gt;The encoding.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="mimeType"&gt;Type of the MIME.&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;param name="willSeek"&gt;if set to &lt;c&gt;true&lt;/c&gt; [will seek].&lt;/param&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;returns&gt;&lt;/returns&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">private</span> Stream
CreateMemoryStream(<span style="color: #0000ff">string</span> name, <span style="color: #0000ff">string</span> extension,
System.Text.Encoding encoding, <span style="color: #0000ff">string</span> mimeType, <span style="color: #0000ff">bool</span> willSeek)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            reportMemoryStream = <span style="color: #0000ff">new</span> MemoryStream();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            reportMimeType = mimeType;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">return</span> reportMemoryStream;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#endregion</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#region</span> IDisposable
Members</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
Performs application-defined tasks associated with freeing, releasing, or resetting
unmanaged resources.</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #008000">///
&lt;/summary&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Dispose()</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">if</span> (<span style="color: #0000ff">this</span>.reportInstance
!= <span style="color: #0000ff">null</span>) <span style="color: #0000ff">this</span>.reportInstance.Dispose();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">if</span> (<span style="color: #0000ff">this</span>.reportMemoryStream
!= <span style="color: #0000ff">null</span>) <span style="color: #0000ff">this</span>.reportMemoryStream.Dispose();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #cc6633">#endregion</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }   </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
          </div>
        </div>
        <p>
Using WebReportRenderer from ASP.NET MVC is simple:
</p>
        <div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">byte</span>[]
result;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> (var
renderer = <span style="color: #0000ff">new</span> WebReportRenderer(<span style="color: #006080">@"~\Report.rdlc"</span>, <span style="color: #006080">"Report.pdf"</span>))</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">       var adapter = <span style="color: #0000ff">new</span> ReportTableAdapter(); </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">       renderer.ReportInstance.DataSources.Add(<span style="color: #0000ff">new</span> ReportDataSource(<span style="color: #006080">"ReportDataSet_Report"</span>,
adapter.GetData()));</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">       ReportParameter p0 = <span style="color: #0000ff">new</span> ReportParameter(<span style="color: #006080">"p0"</span>,
someValue);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">       renderer.ReportInstance.SetParameters(<span style="color: #0000ff">new</span>[]
{p0});</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">       result = renderer.RenderToBytesPDF();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">return</span> File(result,<span style="color: #006080">"application/pdf"</span>, <span style="color: #006080">"Report.pdf"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
          </div>
        </div>
        <p>
This isn't something you'd use for high volume reports, or if you need advanced delivery
or scheduling capabilities.  But for one-off reports that only a few people will
ever use, it works pretty well.
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=e87b551b-c06a-40c9-8d58-25825609a200" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Four ASP.NET MVC Rules of Thumb</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/2009/05/05/FourASPNETMVCRulesOfThumb.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,7bb16a3e-516f-489a-b8c9-ab03761286fd.aspx</id>
    <published>2009-05-05T15:26:34.389898-05:00</published>
    <updated>2009-05-05T15:26:34.389898-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
We've been cranking out a couple of ASP.NET MVC applications for a client in the past
few weeks.   I really feel the framework has helped us achieve greater separation
of concerns and testability in these line-of-business type apps.  I recently
went back to a Web Forms app, and was interested that my MVC work had really helped
inform that as well.  I found myself taking better care of my rendered HTML and
separating logic much better.  It's been fun to work with, but there was a little
learning curve, so below are a few rules of thumb I picked up along the way. 
As the title suggests, these are not rules per-se, but things that can tend to help
in ASP.NET MVC development.
</p>
        <p>
          <strong>#1 - Favor smaller controllers over larger ones</strong>  - Our first
controller attempt lumped several concepts into one class and wound up with about
20 or so action methods on one class- all only tangentially related.  This made
the default routes wordy and non-intuitive, and the "one big controller"
difficult to debug and read.  In future projects, and when refactoring theses,
we broke the app into more narrowly-scoped controllers.  For example prefer an
"EmployeeVacationController" over a catch-all "EmployeeController"
with action methods for Vacation and other Employee "stuff".  This
rule would really apply to most custom-written classes- Keep It Simple and limit classes
to a <a href="http://en.wikipedia.org/wiki/Single_responsibility_principle">Single
Responsibility</a>!
</p>
        <p>
          <strong>#2 - Consider using ViewModel classes</strong> - Most MVC examples show directly
using a model class, such as a LINQ-to-SQL or Entity Framework class.  The Visual
Studio wiring for MVC even steers you into this concept with it's default "Add
View" code-generation, which lets you quickly gen up views based on a single
model class.  However, in real-world-apps you often need more than just a single
table's data to build out a page.  Some examples get around this by stuffing
secondary data into ViewData, but a better way to do this is to create a "roll-up"
class to contain properties for _everything_ your view will need.  This has the
added benefits of being more strongly-typed, supporting intellisense, being testable,
and defining exactly what a view needs.  Here's an example:
</p>
        <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
          <div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> TerminalIndexViewModel</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">{</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">public</span> Terminal
TerminalInfo { get; set; }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"> </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">public</span> IEnumerable&lt;FuelUsage&gt;
LatestUsage { get; set; }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #0000ff">public</span> IEnumerable&lt;FuelDelivery&gt;
LatestDeliveries { get; set; }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">public</span> InventorySummary
CurrentInventorySummary { get; set; }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">}</pre>
          </div>
        </div>
        <p>
This does mean the default code-gen isn't as useful- for example, it wouldn't gen
up anything useful for an action that returned the above class.  You can get
around this by creating your own code-gen in T4, or temporarily using the "main"
model type (ie 'TerminalInfo') to generate the page and tweaking to to work with your
ViewModel class.  This is an emerging pattern for Silverlight and WPF as well.  <a href="http://blog.jeffhandley.com/archive/2008/10/21/viewmodel-pattern.aspx">More
on ViewModels</a>.
</p>
        <p>
          <strong>#3 - Consider separating application logic into classes separate from the
controller</strong>.  As an <a href="http://www.danielroot.info/2009/03/one-thing-i-still-don-get-about-mvc.html">earlier
post of mine demonstrates</a>, it's easy to begin thinking of controllers as just
business logic classes.  But they're not.  They are classes whose purpose
is to coordinate sending and receiving model data to/from the views to business logic. 
For all but the most simple forms-on-data apps, this means the controller should call
out to another class to do things like query a data layer or perform calculations. 
In these apps, we've had luck using a <a href="http://en.wikipedia.org/wiki/Visitor_pattern">Visitor
pattern</a>.  The controller creates the visitor instance and has it "visit"
the model to perform some complex business-specific calculations.  These visitors
are extremely testable, since they are not at all concerned with data access or UI
wiring.
</p>
        <p>
          <strong>#4 - Set up client-side 'conventions' using JQuery.</strong>  Instead
of wiring up individual page elements in each view, establish some 'conventions' for
your app's client-side behavior using a little jQuery in script referenced from your
site.master.  For example this snippet will set up rules for how we want textboxes,
dates, delete buttons, and messageboxes to behave accross the entire app:
</p>
        <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
          <div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">$(document).ready(<span style="color: #0000ff">function</span>()
{</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">          $(<span style="color: #006080">".initialfocus"</span>).focus();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">          $(<span style="color: #006080">".shortdate"</span>).datepicker();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">          $(<span style="color: #006080">".longdatetime"</span>).datepicker();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">          $(<span style="color: #006080">".print"</span>).click(<span style="color: #0000ff">function</span>()
{ window.print(); });</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">          $(<span style="color: #006080">".delete"</span>).click(<span style="color: #0000ff">function</span>()
{ <span style="color: #0000ff">return</span> confirm(<span style="color: #006080">"This
record will be deleted. Are you sure you want to continue? Click 'Ok' to delete this
record or 'Cancel' to stay on this page."</span>); });</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">          $(<span style="color: #006080">".messagebox"</span>)</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">              .animate({ opacity: 1.0 }, 5000)</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">              .fadeOut(<span style="color: #006080">"slow"</span>); </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      });</pre>
          </div>
        </div>
        <p>
With the above in site.master, setting the initial focus in any view is just a matter
of setting the css tag:
</p>
        <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
          <div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">input</span>
              <span style="color: #ff0000">type</span>
              <span style="color: #0000ff">="textbox"</span>
              <span style="color: #ff0000">class</span>
              <span style="color: #0000ff">="initialfocus"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
          </div>
        </div>
        <p>
  I <a href="http://www.danielroot.info/2009/02/jquery-use-convention-over.html">blogged
about this previously</a>, and it's made the app's client-side behavior very consistent.
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=7bb16a3e-516f-489a-b8c9-ab03761286fd" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Finally, Easy Documentation is Back!</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/2009/03/24/FinallyEasyDocumentationIsBack.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,8a9b06cf-75fe-471e-9c92-fac02c019275.aspx</id>
    <published>2009-03-24T15:47:45.7291145-05:00</published>
    <updated>2009-03-24T15:47:45.7291145-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/FinallyEasyDocumentationisBack_DEB7/image_4.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 5px 0px 0px; border-right-width: 0px" height="216" alt="image" src="http://blog.lifecycle-solutions.com/content/binary/WindowsLiveWriter/FinallyEasyDocumentationisBack_DEB7/image_thumb_1.png" width="318" align="left" border="0" />
          </a> Ages
ago, NDoc- a jDoc clone- was the best free .NET documentation-generating application
in town.  For various reasons, that project shut down, and Microsoft released
it's internal documenting system, <a href="http://blogs.msdn.com/sandcastle/">Sandcastle</a>,
to the public.  However Sandcastle by itself is non-trivial to understand and
implement.  It's designed to gen up the entire MSDN documentation site, so it
can be overwhelming for creating docs for your small line-of-business app.
</p>
        <p>
Enter <a href="http://www.codeplex.com/SHFB">Sandcastle Help File Builder</a>. 
This gem brings back the simplicity and open source spirit of NDoc, and adds some
functionality from Sandcastle to provide a great documenting solution for small or
large projects. I'd checked it out in earlier versions, but it's come a long way.
It even has a console app, which can easily be integrated into your continuous integration
process.   In addition, you can add documents other than the typical xml-doc
and build a true compiled help that a developer may actually use.
</p>
        <p>
Here's how we set ours up:
</p>
        <ul>
          <li>
A solution has a _FileReferences project for file-based dll references and other non-compiled
code.  (Build is false for all Build configurations).  This project contains: 
<ul><li>
a Help folder that  contains .htm files and the compiled .chm file 
</li><li>
a .shfbproj file that manages the documentation project. 
</li></ul></li>
          <li>
In the .shfbproj: 
<ul><li>
A site map has been added to build the table of contents.  It has nodes pointing
to each .htm file. 
</li><li>
The solutions' projects have been added as Documentation Sources. 
</li></ul></li>
          <li>
An automated process downloads the solution from source control, checks out the .shfbproj
and .chm, runs the console app to generate a new .chm, and checks everything back
in. 
</li>
        </ul>
        <p>
This way, the documentation is constantly updated and available in source control
alongside the project!
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=8a9b06cf-75fe-471e-9c92-fac02c019275" />
      </div>
    </content>
  </entry>
  <entry>
    <title>"Failed to generate a user instance of SQL Server... " error message</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/2009/03/20/FailedToGenerateAUserInstanceOfSQLServerErrorMessage.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,887c9805-bd85-45fe-be0d-3e41bfea722f.aspx</id>
    <published>2009-03-20T17:47:24.9490448-05:00</published>
    <updated>2009-04-02T10:32:38.7102737-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I came across this run-time error message while trying to run a web app project from
Visual Studio 2008: 
<br /><br /><i>"Failed to generate a user instance of SQL Server due to a failure in starting
the process for the user instance. The connection will be closed." 
<br /></i><br />
The app has a connectionString pointing to a SQL Server 2005 Express instance, so
I checked to make sure the instance service was running and it was.  As any good
computer shade tree mechanic would do, I restarted the service hoping for the best,
but nothing changed. 
<br /><br />
So as always, Google to the rescue.  <a href="http://blogs.msdn.com/joestagner/archive/2008/03/12/sql-express-failed-generate-a-user-instance.aspx">Joe
Stagner in this blog entry</a> describes what he did to fix the problem when he experienced
it.  I deleted the corresponding folder under <i>username</i> and it worked! 
If I had more time I'd try to dig some more for an explanation on why this happens
and why the fix works, but we'll leave that exercise for another day.  For now
I'm just glad it works. 
<br /><br />
Standard disclaimer: make sure you have data backed up before you go deleting things
willy-nilly.  This fix worked for Joe Stagner and it worked for me, but there's
no guarantee it won't fubar your SQL Server Express instance. 
<br /><br /><strong>Update</strong>: Depending on your version of Windows, this folder may not
be under 'Documents and Settings', but rather: C:\Users\USERNAME\AppData\Local\Microsoft\Microsoft
SQL Server Data\SQLEXPRESS  Again, Your Mileage May Vary. 
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=887c9805-bd85-45fe-be0d-3e41bfea722f" />
      </div>
    </content>
  </entry>
</feed>