<?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; asp.net</title>
	<atom:link href="http://blog.dragonsoft.us/tag/aspnet/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 2008 : hacking datetime parameter format &#8211; reloaded</title>
		<link>http://blog.dragonsoft.us/2008/12/31/crystal-reports-2008-hacking-datetime-parameter-format-reloaded/</link>
		<comments>http://blog.dragonsoft.us/2008/12/31/crystal-reports-2008-hacking-datetime-parameter-format-reloaded/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 19:59:53 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[change datetime parameter format]]></category>
		<category><![CDATA[crystal reports 2008]]></category>
		<category><![CDATA[crystal reports viewer]]></category>
		<category><![CDATA[datetime as date]]></category>
		<category><![CDATA[datetime entry format]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=713</guid>
		<description><![CDATA[Few weeks ago I have wrote on how to hack Crystal Reports 2008 ASP.Net Viewer control to suppress time part in the parameter calendar control. With release of Service Pack 1 for Crystal Reports 2008, suggested solution no longer works since &#8230; <a href="http://blog.dragonsoft.us/2008/12/31/crystal-reports-2008-hacking-datetime-parameter-format-reloaded/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.dragonsoft.us/wp-content/uploads/2008/12/step1.png"></a>Few weeks ago I have wrote on <a href="http://blog.dragonsoft.us/2008/12/16/crystal-report…rameter-formatcrystal/" target="_self">how to hack Crystal Reports 2008 ASP.Net Viewer control to suppress time part</a> in the parameter calendar control.</p>
<p>With release of Service Pack 1 for Crystal Reports 2008, suggested solution no longer works since structure of the files has been changed.</p>
<p>So I went digging around again. Forgot to mention last time, but in situations like this, scripting debugging supported in Visual Studio really helps (if you are not familiar with JS debugging check following links <a href="http://weblogs.asp.net/scottgu/archive/2007/07/19/vs-2008-javascript-debugging.aspx" target="_blank">[1]</a> <a href="http://www.asp.net/learn/3.5-videos/video-219.aspx" target="_blank">[2]</a> for more info.</p>
<blockquote><p>Note. It is interesting to observe how code is changing over time. And after some analisys, I would say that SAP development team is one click away from adding ability to suppress time parts for datetime parameters: only one thing missing &#8211; new property on parameter level which would allow specify how to treat it (date, time or datetime). Question is if they will decide to do so.</p></blockquote>
<p>I will be using Visual Studio 2008 and run against my WebDev.WebServer.</p>
<p>After creating simple CrystalReports ASP.Net application with report which has datetime parameter, lets see what exactly is happening here.</p>
<p><a href="http://blog.dragonsoft.us/wp-content/uploads/2008/12/step1.png" target="_blank"><img class="size-thumbnail wp-image-715" style="margin-right: 10px;" title="Step 1" src="http://blog.dragonsoft.us/wp-content/uploads/2008/12/step1-150x150.png" alt="Step 1" width="150" height="150" /></a> <a href="http://blog.dragonsoft.us/wp-content/uploads/2008/12/step2.png" target="_blank"><img class="size-thumbnail wp-image-720" style="margin-right: 10px;" title="Step 2" src="http://blog.dragonsoft.us/wp-content/uploads/2008/12/step2-150x150.png" alt="Step 2" width="150" height="150" /></a></p>
<p>Let&#8217;s run an application up to the point when engine would request parameter values being entered (<a href="http://blog.dragonsoft.us/wp-content/uploads/2008/12/step1.png" target="_blank">Img 1</a>).</p>
<p>And then let&#8217;s open Solution Explorer in Visual Studio (<a href="http://blog.dragonsoft.us/wp-content/uploads/2008/12/step2.png" target="_blank">Img 2</a>).<br />
You would notice a few JavaScript files, where one we were looking for - <strong>promptengine_calendar2.js</strong>.</p>
<p>While having page open, dbl-click on the file in Solution Explorer and look around. (In my case actual file location is <em>C:\Windows\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\crystalreportviewers12\prompting\js\</em>, but may vary.)</p>
<p>Internal Calendar control (which reside in Calendar.js file) relay on setShowTime method to manage visibility and behaviour of the calendar and this is where we will &#8220;hack&#8221; our way in.</p>
<p>As usual code below only highlights changes to the code in <em>promptengine_calendar2.js</em> file.<br />
This time I am making no changes to the data, only how it is displayed and extracted from the calendar control. And it seems to work much better then prior solution.<br />
Make sure you have the copy of original file backed up.</p>
<pre class="brush: jscript; title: ; notranslate">/** First, lets add one more variable to control data flow **/
    bobj.prompt.Calendar = function
    ...
       this.isDateTimeData = false;
    }
...
    /** While suppressing DateTime format we still need to know original type of the data **/
    setIsDateTime : function(isDateTime) {
       // this.isDateTime = isDateTime;
       this.isDateTimeData = isDateTime;
       this.isDateTime = false;
    },
...
    /** while suppressing time part, it is still need to be returned back in to parameter form **/
    _getStringValue : function(dateValue) {
        var format = this.isDateTime ? this.dateTimeFormat : this.dateFormat;
        if ((!this.isDateTime) &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; this.isDateTimeData) {
                format = format + ' 00:00:00';
        }
        return  bobj.external.date.formatDate(dateValue, format);     
       
    },</pre>
<p>Changes are very isolated and allows a) hide time entry box and b) properly return data back into parameter form.</p>
<p>This solution is generic and applies to all datetime parameters visible. As a result, calendar control become for date entry only, while resetting time portion. User can still enter time part if necessary, but on the page level.</p>
<p>Again, make sure that file with changes we just made is replaced everywhere. Depend on your development and production environment you may have few other locations for it.</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/12/31/crystal-reports-2008-hacking-datetime-parameter-format-reloaded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crystal Reports 2008, ASP.Net and impersonation</title>
		<link>http://blog.dragonsoft.us/2008/12/23/crystal-reports-2008-aspnet-and-impersonation/</link>
		<comments>http://blog.dragonsoft.us/2008/12/23/crystal-reports-2008-aspnet-and-impersonation/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 14:28:17 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[access denied]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[broken images]]></category>
		<category><![CDATA[crystal reports 2008]]></category>
		<category><![CDATA[iis temp folder access]]></category>
		<category><![CDATA[iis temp folder failures]]></category>
		<category><![CDATA[impersonation]]></category>
		<category><![CDATA[load report failed]]></category>
		<category><![CDATA[reportclientdocumentclass]]></category>
		<category><![CDATA[temp folder]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=677</guid>
		<description><![CDATA[We have created our perfect reporting solution using Crystal Reports 2008 viewer control, tested everything, and  deployed it into production environment&#8230; and it is working&#8230; until Friday night&#8230; Information below is provided for both IIS 6 and IIS 7 along &#8230; <a href="http://blog.dragonsoft.us/2008/12/23/crystal-reports-2008-aspnet-and-impersonation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We have created our perfect reporting solution using Crystal Reports 2008 viewer control, tested everything, and  <a href="http://blog.dragonsoft.us/2008/10/29/how-to-deploy-crystal-reports-2008-project-part-2/" target="_self">deployed it into production environment</a>&#8230; and it is working&#8230; until Friday night&#8230; <img src='http://blog.dragonsoft.us/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<blockquote><p>Information below is provided for both IIS 6 and IIS 7 along with 32 and 64 bit Windows environment. Make sure that proper reference is used.</p></blockquote>
<p>For some strange reasons, things usually happen when nobody anticipate it anymore (usually about a week after an initial deployment).<br />
In addition, <a href="http://en.wikipedia.org/wiki/Creep_(project_management)" target="_blank">Project creep</a> situation may occurs: after usual management meeting, requirements are changed and some security measures are to be introduced.</p>
<p>Easy! &lt;IMPERSONATE&gt; option of ASP.Net&#8230; and this is where it become interesting.</p>
<p>There is slight small issue, locally developer is usually an administrator of the machine, where in production, s/he just regular user.</p>
<p>More testing&#8230; everything would be fine in development infrastructure and not cause any problems. But being released some strange errors may occur.</p>
<p><strong>Examples:</strong></p>
<ul>
<li>&#8220;Load Report Failed&#8221;</li>
<li>&#8220;System.Runtime.InteropServices.COMException: Invalid file name&#8221;</li>
<li>&#8220;Exception Details: System.Runtime.InteropServices.COMException: <span class="searchTerm">Access</span> is <span class="searchTerm">denied</span>.&#8221;</li>
</ul>
<p><strong>Hint: </strong>When reviewing ASP.Net Stack Trace (debug/trace mode needs to be enabled), first line may contain the following text &#8221;CrystalDecisions &#8230; ReportClientDocumentClass.Open&#8221;.</p>
<p><em>What is going on here?</em></p>
<h3>ASP.Net impersonation</h3>
<p>In default situation, ASP.NET impersonation is turned off and the resources can be accessed using a &#8220;local system process&#8221; account. Nothing needs to be done here, since initial installation of the IIS would have addressed it.<br />
But when impersonation is turned on, ASP.NET executes every resource using the account of a specified user who is authenticated when the user makes the request. If you specify the IUSR_machinename account to be used as the user account, then ASP.NET will behave like previous versions of ASP, in providing access to the resources (<a href="http://msdn.microsoft.com/en-us/library/ms998351.aspx" target="_blank">more</a>).</p>
<p>IIS impersonates users with its own IUSR account.<br />
In the case of ASP.NET, impersonation is used to decide whether the user&#8217;s request should be executed using the account of the requested user, or that of a local system-process account that ASP.NET uses for anonymous requests.</p>
<p>There are some rules applied when combination of impersonation and anonymous access is used in ASP.Net application:</p>
<ol>
<li>Impersonation is enabled:
<ul>
<li>Anonymous access is enabled in IIS - the request is made using the IUSR_machinename account.</li>
<li>Anonymous access is disabled in IIS - the request is made using the account of the authenticated user.</li>
</ul>
</li>
<li>Impersonation is disabled:
<ul>
<li>Anonymous access is enabled in IIS &#8211; the request is made using the system-level process account.</li>
<li>Anonymous access is disabled in IIS - the request is made using the account of the authenticated user.</li>
</ul>
</li>
<li>In either case - permissions for the account are checked in the Windows Access Control List (ACL) for the resource(s) that a user requests, and a resource is only available if the account they are running under is valid for that resource.</li>
</ol>
<p>Lets assume that the following settings are used</p>
<pre class="brush: xml; title: ; notranslate">&lt;system.web&gt;
  &lt;identity impersonate=&quot;true&quot; /&gt;
 &lt;!-- WS: Allow only Authenticated users --&gt;
 &lt;authorization&gt;
 &lt;!-- allow users=&quot;*&quot;/ --&gt;
    &lt;deny users=&quot;?&quot; /&gt;
  &lt;/authorization&gt;
&lt;/system.web&gt;</pre>
<p>In this mode ASP.NET impersonates the current Web user. It gets this token from IIS which passes this account token on the ISAPI thread that originally fires off this request.</p>
<p>We can go further and impersonate the process directly by specifying its identity:</p>
<pre class="brush: xml; title: ; notranslate">&lt;identity impersonate=&quot;true&quot; password=&quot;password&quot; userName=&quot;username&quot; /&gt;</pre>
<p>In this case access to any resource would be performed in the context of the user specified, instead of user associated with the session.<br />
To ensure the proper context, it can be verified with the following code:</p>
<pre class="brush: csharp; title: ; notranslate">// Returns the security identity of the current running thread
System.Security.Principal.WindowsIdentity.GetCurrent().Name
// Returns the identity of the user which session is belong to
WindowsIdentity.GetCurrent().Name</pre>
<p>As you can see, we need to ensure that all accounts involved have sufficient rights to access resources involved.</p>
<blockquote><p>Before going further, check if including an impersonation account in the default <a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/12a3d96c-65ea-4210-96ad-86a801f6a88c.mspx?mfr=true" target="_blank">IIS_WPG</a> user group would be sufficient before setting more complex scenario.</p></blockquote>
<h3>Crystal Reports effect</h3>
<p>Being an insight process, Crystal Reports engine would also require access to some additional file resources:</p>
<ol>
<li>Location of the report files</li>
<li>Local TEMP folder as described below</li>
</ol>
<p>Why User TEMP folders is involved? Why would Crystal Reports control in IIS need to access it?</p>
<p>Short answer &#8211; because CR engine keeps cache of report files for the session.<br />
Do a little experiment, without impersonation enabled, check Temp folders when report is visible in the Viewer.<br />
You would notice files appear and disappear there:</p>
<ul>
<li><em><strong>&lt;Report Name&gt; {GUID}.rpt</strong></em> is a cache of the report file for the session</li>
<li><strong>~cpe{GUID}.rpt</strong> is a cache of the report data view</li>
</ul>
<p>The location of TEMP folder may vary: <em>C:\WINDOWS\Temp</em> for older versions of Windows, or more elaborate &#8221;<em>C:\Documents and Settings\&#8230;</em>&#8221; and &#8220;<em>C:\Users\&#8230;</em>&#8220; in latest versions.<br />
And in case of user account specific variation, one would have to guess which user related folder has to checked.  With impersonation enabled and finding context of the call, we can now properly determine the location and required access level:</p>
<ul>
<li>Associated account should be allowed create/modify/delete files in TEMP folder.</li>
<li>For IIS 7.0, Temp folder location would be different.<br />
Proper default location would be %windir%\serviceprofiles\networkservice\AppData\Local\Temp as described <a href="http://blogs.iis.net/bills/archive/2006/10/18/loadUserProfile-and-IIS7-_2D00_-understanding-temporary-directory-failures.aspx" target="_blank">here</a>.</li>
</ul>
<h3>Limit CR Engine access to TEMP folder</h3>
<p> Described is default behavior, which could be adjusted to limit access to more relevant location.</p>
<p>Visit the following location:</p>
<blockquote><p><strong>HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\Report Application Server\</strong><strong>InprocServer</strong></p>
<p>or in case of 64 bit Vista (not being familiar at first with new registry structure you may be surprised about this)</p>
<p><strong>HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Business Objects\Suite 12.0\Report Application Server\InprocServer</strong></p>
<p>then add/update the following value</p>
<p><strong>TempDir</strong>: String = &#8220;your folder&#8221;</p></blockquote>
<p>This will tell engine which folder to use. And then by granting proper permissions as discussed above it would solve the grand problem. Restart your web server and you should be good to go.</p>
<p>To validate that account has proper permissions for the folder specified, the following command can be used</p>
<blockquote><p>CACLS * /T &gt; output.txt<br />
being executed from command prompt it will create output.txt which contains list of permissions for the current folder</p></blockquote>
<h3>Notes:</h3>
<ol>
<li>Solution above can be used for any prior version of Crystal Reports, but may require minor adjustments.</li>
<li>Problem with permissions could also cause broken image links in the Viewer</li>
<li>Depend on configuration, permissions could be required for NETWORK SERVICE account and/or IIS_WPG group.</li>
</ol>
<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/12/23/crystal-reports-2008-aspnet-and-impersonation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Crystal Reports 2008 : hacking datetime parameter format</title>
		<link>http://blog.dragonsoft.us/2008/12/16/crystal-reports-2008-hacking-datetime-parameter-format/</link>
		<comments>http://blog.dragonsoft.us/2008/12/16/crystal-reports-2008-hacking-datetime-parameter-format/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 16:27:43 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[change datetime parameter format]]></category>
		<category><![CDATA[crystal reports 2008]]></category>
		<category><![CDATA[crystal reports viewer]]></category>
		<category><![CDATA[datetime as date parameter]]></category>
		<category><![CDATA[datetime entry format]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=668</guid>
		<description><![CDATA[One would think that this should be a no-brainer : ability to specify an edit format for date/time parameter in Crystal Reports. Not so fast&#8230; Problem is as following: ASP.Net Web client with Crystal Reports Viewer control is used. When &#8230; <a href="http://blog.dragonsoft.us/2008/12/16/crystal-reports-2008-hacking-datetime-parameter-format/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One would think that this should be a no-brainer : ability to specify an edit format for date/time parameter in Crystal Reports. Not so fast&#8230;</p>
<p>Problem is as following:</p>
<blockquote><p>ASP.Net Web client with Crystal Reports Viewer control is used.</p>
<p>When our report is based of some stored procedure which uses datetime parameter, it will inherit it as is and when report parameter entry form is displayed we would be asked to enter both date and time portion.</p></blockquote>
<p>While, in general, it is OK, some reports are really interested only in date part being entered and time should be always set to 00:00:00. So we are forced to type time every time because if it is not provided calendar control would try to set time part initially to current time.</p>
<p>After some research off the Internet, visiting SAP forums, it is appear to be engine limitation. But we would want to overcome it somehow.</p>
<p><em><strong>DISCLAIMER: solution below could only be used as a last resort and only if your business logic requires using date only params. And while it is only applies to calendar control, it is not per se a generic solution. This is a first &#8220;rough&#8221; attempt of achieving desired result and may lack some features otherwise expected.</strong></em></p>
<p><strong><em>It has been reported that solution above only works for current month. Since we are now using Crystal Reports 2008 with SP1, I would address this issue </em></strong><strong><em>in my new post below</em></strong><strong><em>.</em></strong></p>
<p><strong><em><span style="color: #ff0000;">IMPORTANT! With release of Service Pack 1 for Crystal Reports 2008, method blow is no longer applicable since structure of the files has changed. Please refer <a href="http://blog.dragonsoft.us/2008/12/31/crystal-report…ormat-reloadedcrystal-reports-2008-hacking-datetime-parameter-format-reloaded/" target="_self">to this new post for more information</a>.</span></em></strong></p>
<p>Otherwise, Where there is a will, there is a way&#8230;</p>
<p>Fortunately we have access to internals behind the parameter handlers in Crystal Report Viewer web control.</p>
<p>Navigate to one of following locations:</p>
<ul>
<li>C:\Inetpub\wwwroot\aspnet_client\system_web\2_0_50727\crystalreportviewers12\</li>
<li>C:\windows\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\crystalreportviewers12\</li>
<li>C:\Program Files\Business Objects\Common\4.0\crystalreportviewers12\</li>
</ul>
<p>and locate the file called <strong>allInOne.js</strong> &#8211; this is our victim. This file contains all JS code behind for CRV control which would be used by your web-site.</p>
<p><em><strong>IMPORTANT: always create a backup copy before making any modifications.</strong></em></p>
<p><span id="more-668"></span></p>
<p>Remember that our objective is to ensure that when calendar control is used time part of date/time value is always set as 00:00:00. Let&#8217;s add a new function to <strong>bobj.crv.Calendar</strong> object</p>
<pre class="brush: jscript; title: ; notranslate">/**
 * Reset time part of datetime to 00:00:00
 */
bobj.crv.Calendar._resetTime = function(date) {
    var newdate = this._copyDate(date);
    newdate.setHours(0);
    newdate.setMinutes(0);
    newdate.setSeconds(0);
    newdate.setMilliseconds(0);
    return newdate;
}</pre>
<p>In my case I have put it just before bobj.crv.Calendar.justInTimeInit = function()  (line 39792).</p>
<p>As you can see the main purpose of the function is create a copy of date value with time portion being reset to desired time.</p>
<p>Now we would be looking for any instance in the code where the following substring is present</p>
<blockquote><p><strong>_timeField.setValue</strong></p></blockquote>
<p>We would find 3 functions where the following adjustment would be made:</p>
<pre class="brush: jscript; title: ; notranslate">bobj.crv.Calendar.justInTimeInit = function() {
...
    // mod: reset time
    this.date = this._resetTime(this.date);
    // mod
    this._timeField.setValue(bobj.external.date.formatDate(this.date, this._curTimeFormat));
...
}
...
bobj.crv.Calendar.justInTimeInit = function(){
...
    // mod: reset time
    this.date = this._resetTime(this.date);
    // mod
    this._timeField.setValue(bobj.external.date.formatDate(this.date, this._curTimeFormat));
...
}
...
bobj.crv.Calendar._onTimeChange = function() {
...
    if (date) {
        this._curTimeFormat = format;
        // mod: reset time
        date = this._resetTime(date);
        // mod
        this.date.setHours(date.getHours());
...
    else {
        // mod: reset time
        this.date = this._resetTime(this.date);
        // mod
...
}
...
bobj.crv.Calendar.setDate = function(date) {
    // mod: assign and reset time
    this.date = this._resetTime(date);
...
}</pre>
<p>After all changes above are done, we would get a calendar control which &#8220;keeps time at bay&#8221;. This only affects calendar itself and not an edit control associated with the parameter. As a result we can still adjust time if choose to do so.</p>
<p>Last step would be to ensure that all allInOne.js file instances are in sync and we got desired functionality.</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/12/16/crystal-reports-2008-hacking-datetime-parameter-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net/WF : New built-in .Net Charting control</title>
		<link>http://blog.dragonsoft.us/2008/11/26/aspnet-new-build-in-net-charting-control/</link>
		<comments>http://blog.dragonsoft.us/2008/11/26/aspnet-new-build-in-net-charting-control/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 18:14:38 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Fun stuff with C#]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web-design]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[asp:chart]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[chart support in .Net]]></category>
		<category><![CDATA[charting]]></category>
		<category><![CDATA[Dundas]]></category>
		<category><![CDATA[winforms]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=620</guid>
		<description><![CDATA[I was always for a &#8220;built-in&#8221; support of features in modern development environment. Even if it comes in basic form, we, as programmers, should have ability to do &#8220;basic&#8221; stuff without 3rd party involvement. There are plenty of 3rd party solutions &#8230; <a href="http://blog.dragonsoft.us/2008/11/26/aspnet-new-build-in-net-charting-control/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was always for a &#8220;built-in&#8221; support of features in modern development environment. Even if it comes in basic form, we, as programmers, should have ability to do &#8220;basic&#8221; stuff without 3rd party involvement.</p>
<p>There are plenty of 3rd party solutions on the market which would help you include some kind of charting support with your ASP pages and WinForms applications &#8211; <a href="http://www.softwarefx.com/sfxNetProducts/ChartFX/wpf/" target="_blank">ChartFX</a>, <a href="http://www.componentart.com/charting/" target="_blank">ComponentArt&#8217;s Charting</a>, <a href="http://www.dundas.com/Products/Chart/NET/index.aspx" target="_blank">Dundas Chart</a> - these are just few from many available on the market today.</p>
<p>As it turned out, Microsoft has decided to add out-of-the-box support for Charting as well - <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=130f7986-bf49-4fe5-9ca8-910ae6ea442c&amp;DisplayLang=en" target="_blank">&lt;asp:chart runat=&#8221;server&#8221;/&gt;</a>.<br />
Read about it here - <a href="http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx" target="_blank">New ASP.NET Charting Control: &lt;asp:chart runat=&#8221;server&#8221;/&gt;</a> by Scott Guthrie &#8211; everything you need to know about the .Net 3.5 framework new addition.</p>
<p>For  additional information also visit Alex Gorev&#8217;s <a href="http://blogs.msdn.com/alexgor/archive/2008/11/07/microsoft-chart-control-vs-dundas-chart-control.aspx" target="_blank">blog</a>.</p>
<p><strong>Note 1</strong>: Even though caption says it is ASP.Net solution, in the original you would find link to WinForms sample as well.<br />
<strong>Note 2</strong>: Do not worry about Dundas copyright &#8211; &#8220;Microsoft acquired Dundas Data Visualization Intellectual Property in April 2007.&#8221;</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/11/26/aspnet-new-build-in-net-charting-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to deploy Crystal Reports 2008 project &#8211; part 2</title>
		<link>http://blog.dragonsoft.us/2008/10/29/how-to-deploy-crystal-reports-2008-project-part-2/</link>
		<comments>http://blog.dragonsoft.us/2008/10/29/how-to-deploy-crystal-reports-2008-project-part-2/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 15:03:16 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[404 2 1260]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[bobj is undefined]]></category>
		<category><![CDATA[crystal reports 2008]]></category>
		<category><![CDATA[crystal reports 2008 runtime]]></category>
		<category><![CDATA[crystal reports runtime]]></category>
		<category><![CDATA[deploy crystal reports]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=543</guid>
		<description><![CDATA[Introduction From part 1 of this article, you got list of steps in order to deploy Crystal Reports 2008 project created in Visual Studio 2008. Next step is to choose deployment strategy, prepare installation script and then install it on IIS server. There is &#8230; <a href="http://blog.dragonsoft.us/2008/10/29/how-to-deploy-crystal-reports-2008-project-part-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>From <a href="http://blog.dragonsoft.us/2008/10/09/how-to-deploy-crystal-reports-2008-part-1/" target="_self">part 1</a> of this article, you got list of steps in order to deploy Crystal Reports 2008 project created in Visual Studio 2008.</p>
<p>Next step is to choose deployment strategy, prepare installation script and then install it on IIS server.<br />
There is enough written about deployment process from within Visual Studio so let&#8217;s give some people credit for their work - for example, please check <a href="http://www.15seconds.com/issue/030806.htm" target="_blank">this article</a> &#8211; I am going to use it as a base.</p>
<p>All things considered there is still a variation to that process specific to Crystal Reports.</p>
<p><em>Note: Make sure you have latest runtime available for you &#8211; visit <a href="http://resources.businessobjects.com/support/additional_downloads/runtime.asp#08" target="_blank">SAP download page</a> - as of 10/19/2009 runtime version available is 12.2 .</em></p>
<p><span id="more-543"></span></p>
<h3>Preparing the installation</h3>
<p>Deploying standalone .Net application should not be a problem using standard procedure, but with ASP.Net application some problems may arise&#8230;</p>
<p>Lets go with Windows Installer approach.</p>
<p>One thing to add to the steps presented in the article above &#8211; ensure proper Crystal Report run-time is installed.</p>
<p>If you have followed steps from <a href="http://blog.dragonsoft.us/2008/10/09/how-to-deploy-crystal-reports-2008-part-1/" target="_self">part 1</a> of this article, you now have proper version of runtime installed in VS2008.</p>
<p>After you have created your Web-Setup project and followed all the steps, go to project properties and click <strong>Prerequisites</strong>. What you need to look for here is two lines:</p>
<blockquote>
<ul>
<li>Crystal Reports Basic for Visual Studio 2008</li>
<li>Crystal Reports 2008</li>
</ul>
</blockquote>
<p>We are interested in the second option.<br />
Please notice, this would mean (in default scenario) that during installation your setup would attempt to download redistribution package from SAP web-site.</p>
<p>Build, copy, install&#8230;</p>
<h3>Installation notes</h3>
<p><em>Note: Steps below are based off IIS 6 installation of ASP.Net project.</em></p>
<p>Deployment packages are copied and installed&#8230; Everything is nice and installation seems to be successful.<br />
Trying access a new web-site&#8230; and&#8230; worse case scenario&#8230; error 404 - page not found&#8230; O-oh&#8230;</p>
<p>From IIS log you may notice something like this at the end of the log record - <strong>404 2 1260</strong>.</p>
<p>Please do the following:</p>
<ul>
<li><a href="http://blog.dragonsoft.us/wp-content/uploads/2008/10/wse.png"><img class="alignright size-thumbnail wp-image-550" style="border: 1px solid black;" title="Enable ASP.Net support" src="http://blog.dragonsoft.us/wp-content/uploads/2008/10/wse-small.png" alt="" /></a>Open IIS Management console</li>
<li>Navigate to <strong>Web Service Extension</strong> node</li>
<li>Make sure that <strong>ASP.Net 2.0.50727</strong> (or similar) is enabled</li>
<li>Keep IIS Manager opened for now.</li>
</ul>
<p>So your page is back, but where you should see your CrystalReportViewer control there is nothing. Most likely there would an JS error detected on the page <strong>&#8220;bobj is undefined&#8221;</strong>.<br />
You would need to check that there is &#8220;<strong>crystalreportviewer12</strong>&#8221; virtual folder is present in your site tree. In most cases it should be there, since it is part of CR redistribution package logic. If you have not included it with your setup and/or installed CR support through different means, then you would need to add this virtual folder yourself.</p>
<p><img style="border: 1px solid black;" title="Create Virtual Folder" src="http://blog.dragonsoft.us/wp-content/uploads/2008/10/vf_step_1.png" alt="" /><br />
<img style="border: 1px solid black;" title="Create Virtual Folder" src="http://blog.dragonsoft.us/wp-content/uploads/2008/10/vf_step_2.png" alt="" /><br />
<img style="border: 1px solid black;" title="Create Virtual Folder" src="http://blog.dragonsoft.us/wp-content/uploads/2008/10/vf_step_3.png" alt="" /><br />
<img style="border: 1px solid black;" title="Create Virtual Folder" src="http://blog.dragonsoft.us/wp-content/uploads/2008/10/vf_step_4.png" alt="" /><br />
<img style="border: 1px solid black;" title="Create Virtual Folder" src="http://blog.dragonsoft.us/wp-content/uploads/2008/10/vf_step_5.png" alt="" /><br />
<img style="border: 1px solid black;" title="Create Virtual Folder" src="http://blog.dragonsoft.us/wp-content/uploads/2008/10/vf_step_6.png" alt="" /></p>
<p>And validate folder created</p>
<p><img style="border: 1px solid black;" title="Create Virtual Folder" src="http://blog.dragonsoft.us/wp-content/uploads/2008/10/vf_step_7.png" alt="" /></p>
<p>Another way if you share CR installation between different sites would be to use Export/Import folder info functionality to copy VF info between sites.</p>
<p>Hopefully by that point your CR based web-site should be up and running.</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/10/29/how-to-deploy-crystal-reports-2008-project-part-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Populate TreeView from table in ASP.Net</title>
		<link>http://blog.dragonsoft.us/2008/10/28/populate-treeview-from-table-in-aspnet/</link>
		<comments>http://blog.dragonsoft.us/2008/10/28/populate-treeview-from-table-in-aspnet/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 21:49:51 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Fun stuff with C#]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[populate treeview from table]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=545</guid>
		<description><![CDATA[I was asked today to help with code which would populate the TreeView control from database table in ASP.Net page. Since it is not a first time around and appear to be very common situation with dynamic pages, I thought &#8230; <a href="http://blog.dragonsoft.us/2008/10/28/populate-treeview-from-table-in-aspnet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was asked today to help with code which would populate the TreeView control from database table in ASP.Net page.</p>
<p>Since it is not a first time around and appear to be very common situation with dynamic pages, I thought it may be useful to write about it once and then just refer to this post later.</p>
<ol>
<li>We have a table with the following structure:<br />
<table border="1">
<tbody>
<tr>
<td>ID</td>
<td>ParentID</td>
<td>Name</td>
</tr>
</tbody>
</table>
</li>
<li>We also have a stored procedure <strong>usp_GetGroupList</strong> which would return data from table above.</li>
<li>And on our ASP page we have a TreeView control called myTreeView</li>
</ol>
<p>Few things we are trying to achieve:</p>
<ol>
<li>Small code</li>
<li>Minimum of database access</li>
</ol>
<p>Well, code would not be too complex after all:</p>
<pre class="brush: csharp; title: ; notranslate">private void PopulateTree()
{
    // Populate dataset with data for later use
    DataSet dsList = new DataSet();
    SqlConnection conn = new SqlConnection(myConnectionString);
    conn.Open();
    try
    {
        SqlCommand cmd = new SqlCommand(&quot;usp_GetGroupList&quot;, conn);
        cmd.CommandType = CommandType.StoredProcedure;
        SqlDataAdapter adapt = new SqlDataAdapter(cmd);
        adapt.Fill(dsList);
    }
    finally
    {
        conn.Close();
    }
    // Clear the tree
    myTreeView.Nodes.Clear();
    PopulateTreeNode(dsList, null, &quot;0&quot;);
}
private void PopulateTreeNode(DataSet dsList, TreeNode parent, string parentID)
{
    TreeNodeCollection baseNodes;
    string rowID;
    TreeNode node;
    if (parent == null)
    {
        baseNodes = myTreeView.Nodes;
    }
    else
    {
        baseNodes = parent.ChildNodes;
    }
    foreach (DataRow dsRow in dsList.Tables[0].Select(&quot;ParentID = &quot; + parentID))
    {
        node = new TreeNode();
        node.Text = dsRow[&quot;Name&quot;].ToString();
        rowID = dsRow[&quot;ID&quot;].ToString();
        node.Value = rowID;
        node.SelectAction = TreeNodeSelectAction.Select;
        // Add link back to itself so selected group could be changed
        node.NavigateUrl = &quot;~/default.aspx?id=&quot; + rowID;
        baseNodes.Add(node);
        // Use recusion to populate child nodes
        PopulateTreeNode(dsList, node, rowID);
        // Preselect the node for current group
        if (node.Value == Request.QueryString[&quot;id&quot;])
        {
            node.Selected = true;
        }
    }
}
</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/28/populate-treeview-from-table-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

