<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>Serge&#039;s Technology View &#187; Crystal Reports</title>
	<atom:link href="http://blog.dragonsoft.us/tag/crystal-reports/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dragonsoft.us</link>
	<description>Talk about Technologies, Software Architecture and Management</description>
	<lastBuildDate>Tue, 31 Jan 2012 01:43:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Crystal Reports 2010 &#8211; rumors are out</title>
		<link>http://blog.dragonsoft.us/2010/03/01/crystal-reports-2010-rumors-are-out/</link>
		<comments>http://blog.dragonsoft.us/2010/03/01/crystal-reports-2010-rumors-are-out/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 13:18:16 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[.net 3.5]]></category>
		<category><![CDATA[64 bit runtime]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[crystal reports 2010]]></category>
		<category><![CDATA[excel 2007 export]]></category>
		<category><![CDATA[new features]]></category>
		<category><![CDATA[sap]]></category>
		<category><![CDATA[visual studio 2010]]></category>
		<category><![CDATA[wpf]]></category>
		<category><![CDATA[wpf viewer]]></category>
		<category><![CDATA[xlsx support]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=1121</guid>
		<description><![CDATA[It has been two years since Crystal Reports 2008 was released. It feels old now &#8211; no support for new .Net technologies, no support for new export formats, etc. So question is &#8211; when we would see any of this? &#8230; <a href="http://blog.dragonsoft.us/2010/03/01/crystal-reports-2010-rumors-are-out/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It has been two years since Crystal Reports 2008 was released. It feels old now &#8211; no support for new .Net technologies, no support for new export formats, etc.</p>
<p>So question is &#8211; when we would see any of this?</p>
<p>Accordingly to <a onclick="this.href='http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/u/251930783';" href="http://weblogs.sdn.sap.com/pub/u/251930783" target="_top">Blair Wheadon</a>,  Product Manager in the Volume Business Unit at SAP, our <a href="http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14514" target="_blank">cries may be answered relatively soon</a>.</p>
<p>Post is a nice summary and I hope features discussed would be in the final product.</p>
<p>Few highlights I pick for myself and with comments:</p>
<ul>
<li><em>Crystal Reports Basic will no longer be included in Visual Studio 2010<br />
</em>Finally! Every time I have to set-up Visual Studio environment, I have to make sure I do not bring CR Basic along since I have a full version instead.<br />
Do not worry &#8220;<em>Crystal Reports for Visual Studio 2010 will be provided by SAP as a free download, no registration required</em>&#8220;.<br />
<em>We are committed to have a beta version at the time that Visual Studio 2010 goes GA. A production release will be no later than Q3 2010</em></li>
<li>There are slight changes in Licensing&#8230; as usual, read it through.</li>
<li><em>64-bit run-time support.<br />
</em>Good! Platform independent code for .Net applications.</li>
<li><em>New WPF Viewer<br />
</em>Even better! No more .Net 2.0 assemblies (I hope)</li>
<li><em>New XLSX export to take advantage of the big grid for data-only Excel exports<br />
</em>Finally! 64K page limit is inconvenient, to say the least.</li>
</ul>
<p>You can read about other more or less important improvements in Blair&#8217;s post, but these are answers for questions I was looking for.</p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2012 <strong><a href="http://blog.dragonsoft.us">Serge&#039;s Technology View</a></strong>. This Feed is for personal non-commercial use only.</span>]]></content:encoded>
			<wfw:commentRss>http://blog.dragonsoft.us/2010/03/01/crystal-reports-2010-rumors-are-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crystal Reports 2008 and ASP.Net : speed up the first session</title>
		<link>http://blog.dragonsoft.us/2009/09/23/crystal-reports-2008-and-asp-net-speed-up-first-session/</link>
		<comments>http://blog.dragonsoft.us/2009/09/23/crystal-reports-2008-and-asp-net-speed-up-first-session/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 12:21:04 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[Fun stuff with C#]]></category>
		<category><![CDATA[Web-design]]></category>
		<category><![CDATA[.net 2.0]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[certificate revocation List]]></category>
		<category><![CDATA[code access security]]></category>
		<category><![CDATA[crl]]></category>
		<category><![CDATA[crl.verisign.net]]></category>
		<category><![CDATA[crystal reports viewer]]></category>
		<category><![CDATA[generatePublisherEvidence]]></category>
		<category><![CDATA[Slow start up]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=1010</guid>
		<description><![CDATA[Did you ever noticed that after restart of the IIS ASP.Net page which has Crystal Reports Viewer would take much longer to come up? Some of it is expected since on initial start up, a number of Crystal assemblies and objects &#8230; <a href="http://blog.dragonsoft.us/2009/09/23/crystal-reports-2008-and-asp-net-speed-up-first-session/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Did you ever noticed that after restart of the IIS ASP.Net page which has Crystal Reports Viewer would take much longer to come up?</p>
<p>Some of it is expected since on initial start up, a number of Crystal assemblies and objects need to be created and this does take time.<br />
I want to emphasize that discussion below is related to the first run of any reports. We have to actually restart/reset IIS to see problem again.</p>
<blockquote><p>Note: There was a question about IIS&#8217; Application Pools recycling which could cause similar effect. Make sure your application pool <a href="http://support.microsoft.com/kb/332088" target="_blank">is set properly</a>.</p></blockquote>
<p><strong>Setting up a playground</strong></p>
<p>Let&#8217;s assume ASP.Net pages were already migrated to use .Net 3.x and look at what happen behind the scene.</p>
<p>Remember that after restart IIS starts from ground up. This means several things in respect to our page content:</p>
<ul>
<li>.Net assemblies need to be preloaded and validated if necessary.<br />
Since Crystal Reports 2008 comes as .Net 2.0-based core and we may already moved to .Net 3.x, CR2008 Engine and some additional files need to be loaded and validated aside from one which already used by any previously loaded pages.</li>
<li>For each session engine would create a cached version of RPT file in temp folder.</li>
<li>Some code would have to be brought to the client machine for Viewer to operate properly.</li>
<li>Database connection established, data retrieved, processed, paged and sent to the client Viewer.</li>
</ul>
<p>That about it, now we ready to work with reports. Please notice that after that initial load, any other reports would come up faster. We could even close the browser or use another browser (ex. go from IE to FF) and it would be still faster than the first time, so there is something important about the first step above&#8230;</p>
<p><strong>Combing the sand</strong></p>
<p>Let&#8217;s try to break the IIS initialization process to get more detailed view.</p>
<p>Since we already had some ASP.Net pages loaded before coming to CR related page, we could disregard .Net core initialization procedure. It is there on IIS side: used and ready.</p>
<p>Ok, next thing is CR engine related stuff. There is some 5Mb of files in <strong>crystalreportviewers12</strong> folder to support CR Viewer in ASP.Net and we need to send some of them over the network. In addition to that there is Crystal Reports Engine assemblies which need to be loaded by IIS at the time of the first use. And this is our spot to dig.</p>
<p>If we try and trace what exactly going on we would notice that aside from IIS loading a few dozen assemblies, there is also process associated with trying connect to CRL.VERISIGN.NET.</p>
<p><strong>What is it?</strong></p>
<p>&#8220;Problem&#8221; is that assemblies are Authenticode signed and therefore need to be verified or it technical terms they need to be checked against <a href="http://technet.microsoft.com/en-us/library/bb457027.aspx" target="_blank">Certificate Revocation List (CRL)</a> by <a href="http://msdn.microsoft.com/en-us/library/system.security.policy.publisher.aspx" target="_blank">Publisher</a> for <a href="http://msdn.microsoft.com/en-us/library/930b76w0.aspx" target="_blank">Code Access Security (CAS)</a>.</p>
<p>Default behavior is that they need to be verified by the certificate authority. If certificate is not present on the same machine (I have my doubts that SAP doing anything about that, but I could be wrong), validation need to be done via central repository mentioned above, or if machine does not have network/internet access the .NET thread might timeout waiting to connect.</p>
<blockquote><p>Yes, by performing strong name signing of assemblies or placing the CA certificate on the same machine issue would be avoided, but it seems not being a case.</p></blockquote>
<p><strong>Building the castle</strong></p>
<p>Since assemblies are provided by SAP, we cannot remove digital signature and it is a hassle to keep certificates current by obtaining them from CA every time they expire. Let&#8217;s concentrate on the Publisher mentioned above and turn it off.</p>
<blockquote><p><em>It is all-or-nothing solution since it would require turning off CRC for the entire IIS.</em></p></blockquote>
<p>When working with regular .Net apps, it can be done on the app level (assuming <a href="http://support.microsoft.com/kb/936707" target="_blank">we already have fix for .Net 2.0</a>) by adding the following section in &lt;Application&gt;.exe.config</p>
<pre class="brush: xml; title: ; notranslate">&lt;configuration&gt;
  &lt;runtime&gt;
    &lt;generatePublisherEvidence enabled=&quot;false&quot;/&gt;
  &lt;/runtime&gt;
&lt;/configuration&gt;</pre>
<p>This new element described in <a href="http://msdn.microsoft.com/en-us/library/bb629393.aspx" target="_blank">this MSDN article</a>. Interesting note there (why not to turn it then by default? Oh, security concerns&#8230; UAC anyone?):</p>
<blockquote><p>We recommend that services use the <span><span>&lt;generatePublisherEvidence&gt;</span></span> element to improve startup performance. Using this element can also help avoid delays that can cause a time-out and the cancellation of the service startup.</p></blockquote>
<p>Since there is no such config file for our ASP.Net app (web.config would not work here, because it defines settings that are only AppDomain wide and we need process wide for aspnet_isapi.dll being the hosting environment for the runtime), we would have to turn code access security (CAS) publisher policy off for the entire IIS.<br />
There are two options:</p>
<ul>
<li>Create a file called w3wp.exe.config (for IIS6, or aspnet_wp.exe.config for IIS5). This will affect all .NET based web applications on the system.</li>
<li>Or to specify this in machine.config, but then this affects every .NET application on the machine and is not available for override in individual Apps.</li>
</ul>
<p><strong>Adding the summer cabin</strong></p>
<p>There is one more step which could be taken to improve performance by preloading some of the core assemblies while site visitor is doing something else.<br />
I wouldn&#8217;t go into much details here, since it is implementation/application environment specific, but just give a hint:</p>
<ul>
<li>some other place in application, create a background process which would create CR document object, load some not essential report file, retrieve some data and then disapear without the trace. This would allow Crystal Reports Engine being initialized in the background offsetting time needed for the actual CR related page load. Don&#8217;t force garbage collection though, this may cancel desired effect.</li>
</ul>
<p><strong>Results</strong></p>
<p>In some situation I observed 50% to 70% drop in start-up time&#8230;<br />
Have fun!</p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2012 <strong><a href="http://blog.dragonsoft.us">Serge&#039;s Technology View</a></strong>. This Feed is for personal non-commercial use only.</span>]]></content:encoded>
			<wfw:commentRss>http://blog.dragonsoft.us/2009/09/23/crystal-reports-2008-and-asp-net-speed-up-first-session/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Expiration of CrystalReport Viewer pages with long running queries</title>
		<link>http://blog.dragonsoft.us/2009/06/23/expiration-of-crystalreport-viewer-pages-with-long-running-queries/</link>
		<comments>http://blog.dragonsoft.us/2009/06/23/expiration-of-crystalreport-viewer-pages-with-long-running-queries/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 19:58:14 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[crystal reports viewer]]></category>
		<category><![CDATA[crystalreportviewer]]></category>
		<category><![CDATA[long running query]]></category>
		<category><![CDATA[page expired]]></category>
		<category><![CDATA[timeout]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=988</guid>
		<description><![CDATA[Wow! It worked&#8230; I continue my journey with Crystal Reports Viewer (CRV) inside ASP.Net pages. Topic of this post is to discuss problems and solutions related to long running queries in CRV. I would like to thank Daniel Paulsen from &#8230; <a href="http://blog.dragonsoft.us/2009/06/23/expiration-of-crystalreport-viewer-pages-with-long-running-queries/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wow! It worked&#8230;</p>
<p>I continue my journey with Crystal Reports Viewer (CRV) inside ASP.Net pages.<br />
Topic of this post is to discuss problems and solutions related to long running queries in CRV.</p>
<p>I would like to thank Daniel Paulsen from SAP team for his help resolving the issue discussed below.</p>
<p><strong>What are we talking about here?</strong></p>
<p>As it usually happens at some point there is to much data/not optimal query/broken indexes/etc and it is takes significant time to return a result for CR report. As a result ASP.Net page with CRV start to throw errors, acts erratically, and overall strange.</p>
<p>Since we know that it is ASP.net and CRV uses page state and session information then we have usual suspects - <a href="http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.timeout.aspx" target="_blank">session timeout</a> and <a href="http://msdn.microsoft.com/en-us/library/e1f13641.aspx" target="_blank">execution timeout</a>.</p>
<p>Easy? Not so fast&#8230; Lets time our query &#8211; if it is more then 10 but less then 20 minutes then reason is not an ASP.Net timeout, but CR Engine timeouts.</p>
<p><strong>Crystal Reports Engine Timeouts</strong></p>
<p>Aside from timeouts imposed by .net infrastructure, there are two others which are introduced by Crystal Report itself.</p>
<p><strong>Symptoms:</strong></p>
<ul>
<li>Error similar to &#8216;Request timed out because there has been no reply from the server in N ms&#8217;</li>
<li>First Page of the report is displayed but attempt to go to the next page gives JS error related to invalid object ID</li>
<li>If report require parameter entry, they are requested again</li>
</ul>
<p><strong>Cause:</strong></p>
<p>Crystal Reports by default has a timeout of 10 minutes (600,000 ms) before deciding that no data is returned by the query.<br />
Depend on how code behind is implemented for the report page, timeout error may cause different problems and be hidden.</p>
<p><strong>Solution:</strong></p>
<p>Per Daniel&#8217;s suggestion I have changed the following settings to a bigger number and it did solve the problem for me</p>
<pre class="brush: plain; title: ; notranslate">HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\Report Application Server\Client SDK\CorbaAdapter\WaitReplyTimeout = 600000
and
HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\Report Application Server\InprocServer\EnterpriseRequestTimeout = 600000</pre>
<p><strong>Final Note:</strong></p>
<p>There are other settings which are allowed to be set for the CR engine as described in <a href="http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm" target="_blank">Developer&#8217;s Guide for CR 2008</a> under &#8220;<strong>Configuring your Web.Config file</strong>&#8220;. It worth to know about some of them.</p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2012 <strong><a href="http://blog.dragonsoft.us">Serge&#039;s Technology View</a></strong>. This Feed is for personal non-commercial use only.</span>]]></content:encoded>
			<wfw:commentRss>http://blog.dragonsoft.us/2009/06/23/expiration-of-crystalreport-viewer-pages-with-long-running-queries/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to set default file name for export from CrystalReportViewer in ASP.Net</title>
		<link>http://blog.dragonsoft.us/2009/04/07/how-to-set-default-file-name-for-export-from-crystalreportviewer-in-aspnet/</link>
		<comments>http://blog.dragonsoft.us/2009/04/07/how-to-set-default-file-name-for-export-from-crystalreportviewer-in-aspnet/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 20:20:57 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[crystalreportviewer]]></category>
		<category><![CDATA[set default export file name]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=921</guid>
		<description><![CDATA[I have had nice discussion about a new Crystal Reports based web-site today. And everything seems to be fine&#8230; Except users want to see a proper default name for the exported files&#8230; Environment: Crystal Reports 2008 engine IIS 7 ASP.Net &#8230; <a href="http://blog.dragonsoft.us/2009/04/07/how-to-set-default-file-name-for-export-from-crystalreportviewer-in-aspnet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have had nice discussion about a new Crystal Reports based web-site today. And everything seems to be fine&#8230; Except users want to see a proper default name for the exported files&#8230;</p>
<p>Environment:</p>
<ul>
<li>Crystal Reports 2008 engine</li>
<li>IIS 7</li>
<li>ASP.Net 3.0 page with CrystalReportViewer (CRV) being used to show report passed by parameter</li>
</ul>
<p>When trying export as PDF (just an example), CRV defaults the name of the file to <em>CrystalReportViewer1.pdf.<br />
</em>Not very nice since associated RPT name is <em>MyVeryOwnReport.rpt</em> and I have many other which I would expect export file at least inherit.</p>
<p>One would expect that Viewer would have a property allowing specify default export name. Not so fast&#8230; there is no such thing today exists.</p>
<p>After some head scratching and research, it just happen that Default Export File Name is actually based of the ID property value of the CRV which is still named as CrystalReportViewer1.</p>
<p>Options?</p>
<ol>
<li>Rename ID value of the control as something else. Still, if we use just one page and load reports dynamically, then it would not help much.
<pre class="brush: csharp; title: ; notranslate">// ReportPreview.aspx file
&lt;CR:CrystalReportViewer ID=&quot;MyVeryOwnExportFile&quot; /&gt;</pre>
</li>
<li>Another option is to populate Default Export file name in the code
<pre class="brush: csharp; title: ; notranslate">// ReportPreview.aspx.cs file
protected void Page_Init(object sender, EventArgs e)
{
     ...
    // Load report here
    ...
    CrystalReportViewer1.ID = &quot;MyVeryOwnExportFile&quot;;
}</pre>
<p>It is important to have it set before any code would use it to manipulate a page view state and create references.</p>
</li>
<li>Trying <a href="http://msdn.microsoft.com/en-us/library/aa288404(VS.71).aspx" target="_blank">manually set export options</a> for the Report instance, would not help much unfortunately since viewer would disregard it.</li>
<li>Off course there is always an option of coding export functionality yourself and bypass built-in logic&#8230;</li>
</ol>
<p>This concludes another Crystal Reports dance session.</p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2012 <strong><a href="http://blog.dragonsoft.us">Serge&#039;s Technology View</a></strong>. This Feed is for personal non-commercial use only.</span>]]></content:encoded>
			<wfw:commentRss>http://blog.dragonsoft.us/2009/04/07/how-to-set-default-file-name-for-export-from-crystalreportviewer-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Crystal Reports Extension Methods Library</title>
		<link>http://blog.dragonsoft.us/2009/03/03/crystal-reports-extension-methods-library/</link>
		<comments>http://blog.dragonsoft.us/2009/03/03/crystal-reports-extension-methods-library/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 12:05:04 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[check for parameter]]></category>
		<category><![CDATA[export into file]]></category>
		<category><![CDATA[extension methods]]></category>
		<category><![CDATA[get parameters as text]]></category>
		<category><![CDATA[set new database connection]]></category>
		<category><![CDATA[Set parameter]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=838</guid>
		<description><![CDATA[After using Crystal Reports for many years what always strikes me is that some of the methods available via API are not generic enough and require unnecessary repeated coding for simple things. Lately all my development, when in comes to reports, &#8230; <a href="http://blog.dragonsoft.us/2009/03/03/crystal-reports-extension-methods-library/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After using Crystal Reports for many years what always strikes me is that some of the methods available via API are not generic enough and require unnecessary repeated coding for simple things.</p>
<p>Lately all my development, when in comes to reports, is based on Crystal Reports 2008  engine within ASP.Net/C# environment. While there are many improvements in the functionality available to developers, there are still things which could be done easier. So what do we do to make our job easier? We develop set of special classes, wrappers and libraries which would simplify work with Crystal Reports API.</p>
<p>But disadvantage of introducing yet another helper class, is that it is another helper class. We are loosing simple inheritance of the new functionality in API and make code even more complex.<br />
But there is a nice feature in .Net which helps avoid problem above - <a href="http://blogs.msdn.com/abhinaba/archive/2005/09/15/467926.aspx" target="_blank">Extension Methods</a> - it allows attach additional functionalities to an existing type/class even if you do not have access to the source for it.</p>
<p>Idea is then to keep using Crystal Report&#8217;s <em>ReportDocument</em> class and build on top of it by providing extra methods that can be useful when you want to integrate Crystal Reports in your .Net application.</p>
<blockquote><p><strong>Note #1.</strong> If you have ideas or suggestions for new methods, please let me know.<br />
<strong>Note #2.</strong>This is work in progress and new versions would be available in the future. You can always download the <a title="CrystalReportExtensions" href="http://www.dragonsoft.us/lib/crystal/CrystalReportExtensions.zip" target="_blank"><strong>latest version here</strong></a>.<br />
<strong>Note #3.</strong> Library is developed and tested for Visual Studio 2008 and Crystal Reports 2008 with SP1.<br />
<strong>Note #4</strong>. Code is self-documented using XMLDoc.</p></blockquote>
<p>In order to introduce new methods into your code, simply compile a provided assembly and add reference in your code. After that you should see new methods listed below available for each ReportDocument instance.</p>
<p>Currently included:</p>
<pre class="brush: csharp; title: ; notranslate">// Assign the connection info to all tables in the report
public static void AssignTableConnections(this ReportDocument reportDocument, ConnectionInfo  connectionInfo)
// Close opened report, otherwise throw exception
public static void CloseReport(this ReportDocument reportDocument)
// Export report into file of specified format
public static void Export(this ReportDocument reportDocument, string fileName,  CrystalDecisions.Shared.ExportFormatType exportFormatType)
// Checks if specified parameter is present in the report
public static bool HasReportParameter(this ReportDocument reportDocument, string paramName)
// Function returns list of parameters descriptions with associated
// values for specified report instance in the form of HTML code block
//  which then can be used in the report to display current parameter
public static string GetReportParamsAsText(this ReportDocument reportDocument)
// Set specified report parameter
public static void SetReportParameter(this ReportDocument reportDocument, string paramName, object paramValue)
// Load report and prepare database connection using provided Server, Database Names, and login info
public static void OpenReport(this ReportDocument reportDocument, string reportFile,  ConnectionInfoType type, string serverName, string databaseName,  bool integratedSecurity, string userName, string password)
public static void OpenReport(this ReportDocument reportDocument, string reportFile, ConnectionInfoType type, string serverName, string databaseName, string userName, string password)
public static void OpenReport(this ReportDocument reportDocument, string reportFile, ConnectionInfoType type, string serverName, string databaseName)
// Purge saved report data if present
public static void PurgeSavedData(this ReportDocument reportDocument)</pre>
<hr/><span style="font-size: 7pt">Copyright &copy; 2012 <strong><a href="http://blog.dragonsoft.us">Serge&#039;s Technology View</a></strong>. This Feed is for personal non-commercial use only.</span>]]></content:encoded>
			<wfw:commentRss>http://blog.dragonsoft.us/2009/03/03/crystal-reports-extension-methods-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip: Get report parameters as text from Crystal Reports in C#</title>
		<link>http://blog.dragonsoft.us/2008/10/31/tip-get-report-parameters-as-text-from-crystal-reports-in-c/</link>
		<comments>http://blog.dragonsoft.us/2008/10/31/tip-get-report-parameters-as-text-from-crystal-reports-in-c/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 15:12:36 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[get parameters as text]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=563</guid>
		<description><![CDATA[I am starting a new set of posts presenting small code snippets in C# you could use when working with Crystal Reports in Visual Studio. And the first one is &#8220;GetReportParamsAsText&#8220;. Very simple but very handy function which allows to &#8230; <a href="http://blog.dragonsoft.us/2008/10/31/tip-get-report-parameters-as-text-from-crystal-reports-in-c/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am starting a new set of posts presenting small code snippets in C# you could use when working with Crystal Reports in Visual Studio.</p>
<p>And the first one is &#8220;<strong>GetReportParamsAsText</strong>&#8220;. Very simple but very handy function which allows to include report parameters values in your ASP.Net page without actually displaying the report.<br />
This version works only with Discrete Value parameters. </p>
<pre class="brush: csharp; title: ; notranslate">/// Function returns list of paramaters descriptions with
/// associated values for specified report
public string GetReportParamsAsText(ReportDocument reportDocument)
{
    if (reportDocument == null) return &quot;Report not specified&quot;;
    string result = &quot;&quot;;
    string description;
    string valueText;
    ParameterDiscreteValue value;
    foreach (ParameterFieldDefinition prm
                  in reportDocument.DataDefinition.ParameterFields)
    {
        try
        {
            if (prm.CurrentValues.IsNoValue) continue;
            if (prm.CurrentValues[0] is ParameterDiscreteValue)
            {
                value = (ParameterDiscreteValue)prm.CurrentValues[0];
                if (description.StartsWith(&quot;Enter &quot;))
                {
                    description = description.Remove(0, 6);
                }
                valueText = value.Value.ToString();
            }
            else
            {
                valueText = &quot;[not supported param type]&quot;;
            }
            result += &quot;&lt;strong&gt;&quot; + description + &quot;&lt;/strong&gt; &quot; + valueText + &quot;
&quot;;
        }
        catch
        {
            // Ignore any errors
        }
    }
    return result;
}</pre>
<hr/><span style="font-size: 7pt">Copyright &copy; 2012 <strong><a href="http://blog.dragonsoft.us">Serge&#039;s Technology View</a></strong>. This Feed is for personal non-commercial use only.</span>]]></content:encoded>
			<wfw:commentRss>http://blog.dragonsoft.us/2008/10/31/tip-get-report-parameters-as-text-from-crystal-reports-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with Crystal Reports 2008</title>
		<link>http://blog.dragonsoft.us/2008/09/30/getting-started-with-crystal-reports-2008/</link>
		<comments>http://blog.dragonsoft.us/2008/09/30/getting-started-with-crystal-reports-2008/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 18:34:22 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[crystal reports 2008]]></category>
		<category><![CDATA[installation problem]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=466</guid>
		<description><![CDATA[One of my projects is to maintain application which creates export files off the Crystal Reports reports. There is a little post about my experience migrating to CR 2008. Just a little background I am using Crystal Reports since 1997. &#8230; <a href="http://blog.dragonsoft.us/2008/09/30/getting-started-with-crystal-reports-2008/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of my projects is to maintain application which creates export files off the Crystal Reports reports. There is a little post about my experience migrating to CR 2008.</p>
<h3>Just a little background</h3>
<p>I am using Crystal Reports since 1997. As you can see it has been a long time. It was and is the primary platform for me to create and maintain reports. Just to be fair, it is not the only platform I am using. Over the years as a developer (Delphi/C#/ASP) I have tried many different reporting solutions: PRT, text, Crystal Reports 6 through 2008, ReportBuilder, RAVE, MS Reporting Services, ad-hoc reports using Windows canvas, HTML, etc. It is always fun.<br />
But for some time I am advocating use of CR in regular development.</p>
<p>To start with, CR is a industry standardized product and can be utilized in many different environments (Visual Studio, Delphi IDE, COM, HTML, etc) and evolution of the product has gone a long way &#8211; you can find a lot of information about the product, about how to use and deploy it.</p>
<p>What always struck me was that even though a product is widely used, there is always some small details which you need to know when it comes to use, integration or deployment. One would think that everything should be smooth, but things are still happening with every new version.</p>
<h3>Starting point</h3>
<p>As I mentioned earlier, I am maintaining the project which was written in C# (VS 2003) and was utilizing Crystal Reports 8.5 (yes, that old).</p>
<p>I have finally got &#8220;go for it&#8221; to move everything to VS 2008 and CR 2008.</p>
<p>Now brace yourself&#8230;</p>
<h3>Dos, and don&#8217;ts</h3>
<p>As you can see, we have to install a new software (ideally removing old versions first and cleaning up &#8220;dead wood&#8221; after). Then&#8230;</p>
<p>First of all, prepare to spend some time and figure out why initial installation does not work. It just doesn&#8217;t (see below).<br />
If you&#8217;ve got a new media with CR 2008, make sure that you have CR 2008 with SP0 (yes, it is a SP&#8221;zero&#8221;).<br />
If you don&#8217;t, then do not even bother to install it. Instead, get an updated version.</p>
<p>Reason?</p>
<p>Visual Studio 2008 comes with CR 2008 Basic edition which comes with v.10 assemblies for CR support. After installing regular CR 2008 on top of it you would most likely have a problem since version you would want to use is actually version 12 (and it is available for you), but even though it would be there it would not work properly in VS (<a href="http://weblogs.asp.net/guybarrette/archive/2008/03/17/will-the-real-crystal-reports-2008-stand-up.aspx" target="_blank">read more here</a>).</p>
<p>This is where you need CR 2008 with SP0 &#8211; when installed, it will actually clean up the mess and resolve issue with versions and will leave you with proper one only &#8211; version 12.</p>
<h3>Where?</h3>
<p>If you did not get media with SP0 or you do not have time to wait for it to arrive, there is a place to download it. It is not trivial to find on the SAP&#8217;s web-site (BusinessObjects are now part of SAP), <a href="http://www.thedatafarm.com/blog/" target="_blank">Julie Lerman&#8217;s</a> <a href="http://www.thedatafarm.com/blog/2008/09/05/WhereTheHellIsTheCrystalReports2008SP0DownloadAnyway.aspx" target="_blank">blog post</a> would be of big help to you &#8211; read it, follow the steps, or just <a href="https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm" target="_blank">download proper version from SAP web-site</a>.</p>
<blockquote><p>To advertise a little bit more, Julie has some other articles available at ASPAlliance:</p>
<ul>
<li><a href="http://aspalliance.com/1564_What_Visual_Studio_Developers_Should_Know_About_Crystal_Reports_2008" target="_blank">What Visual Studio Developers Should Know About Crystal Reports 2008</a></li>
<li><a href="http://aspalliance.com/1744_Lessons_Learned_Sorting_out_Crystal_Reports_2008_Versioning_Service_Packs_and_Deployment" target="_blank">Lessons Learned: Sorting out Crystal Reports 2008 Versioning, Service Packs and Deployment</a></li>
<li><a href="http://aspalliance.com/1483_Writing_a_Viewer_Utility_for_Crystal_Reports" target="_blank">Writing a Viewer Utility for Crystal Reports</a></li>
</ul>
</blockquote>
<p>You could also obtain SP0 via auto-update CR feature, but I have had experienced some strange problems with ti where setup would stop in the middle and not finish properly. Plus, you do not have to install a product just to find out that you have to reinstall it (suggested update is a full setup). And after all you may need to uninstall everything after you download an update.</p>
<h3>Ready, set, go</h3>
<p>OK, now you have a proper version to work with. But before you install it, please make sure you have installed support for CR 2008 in VS 2008 (remember a famous Basic edition?). You need VS templates from it. CR 2008 would have installed/replaced some of them but not all of them come with CR 2008.</p>
<p>Now everything would work nicely in VS 2008 for you.</p>
<h3>Future writing</h3>
<p>This is a first post in this category and I am going to post more about other useful things on use of CR 2008 in your applications. Stay tuned.</p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2012 <strong><a href="http://blog.dragonsoft.us">Serge&#039;s Technology View</a></strong>. This Feed is for personal non-commercial use only.</span>]]></content:encoded>
			<wfw:commentRss>http://blog.dragonsoft.us/2008/09/30/getting-started-with-crystal-reports-2008/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

