<?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>blog.aaziz.org &#187; work</title>
	<atom:link href="http://blog.aaziz.org/tag/work/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.aaziz.org</link>
	<description>ramblings and opinions of a geek</description>
	<lastBuildDate>Fri, 08 Oct 2010 00:26:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Configure Crystal Reports 2008 for ASP.NET on IIS</title>
		<link>http://blog.aaziz.org/configure-crystal-reports-2008-for-aspnet-on-iis</link>
		<comments>http://blog.aaziz.org/configure-crystal-reports-2008-for-aspnet-on-iis#comments</comments>
		<pubDate>Mon, 25 May 2009 14:34:26 +0000</pubDate>
		<dc:creator>Anthony Aziz</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[crystal reports]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.aaziz.org/?p=103</guid>
		<description><![CDATA[Earlier I posted a &#8220;solution&#8221; to a problem where I couldn&#8217;t export. I searched high and low, running through DLLs and assembly references. I thought I had it working by changing the DLL of one assembly reference the to version 10 reference (CR 2008 is version 12). I stopped the post there. Later, I realized [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier <a title="Export Error with Crystal Reports 2008, in ASP.NET" href="http://blog.aaziz.org/export-error-with-crystal-reports-2008-in-aspnet">I posted a &#8220;solution&#8221;</a> to a problem where I couldn&#8217;t export. I searched high and low, running through DLLs and assembly references. I <em>thought</em> I had it working by changing the DLL of <em>one</em> assembly reference the to version 10 reference (<abbr title="Crystal Reports">CR</abbr> 2008 is version 12). I stopped the post there. Later, I realized the different assemblies were pretty integrated with each other, and you couldn&#8217;t just have different versions floating around (<em>DUH</em>). So I changed them all back to version 10.</p>
<p>Of course I still had issues with that. I forget what, but it wasn&#8217;t good. I think it wouldn&#8217;t run on the production server. That server doesn&#8217;t have Visual Studio installed, only the <abbr title="Crystal Reports">CR</abbr> engine. The version 10 assemblies I were using were the Crystal Report packages that came with <abbr title="Visual Studio .NET 2008">VS.NET 2008</abbr>.</p>
<p>In order to successfully be able to use all the correct assemblies, I had to do more research. What I ended up doing was completely uninstalling Crystal Reports and reinstalling it, and configuring some Virtual Diretories. The steps and and explanation after the jump.</p>
<p><span id="more-103"></span></p>
<p>When version 12 was installed, I had a javascript error on the Report Viewer page. It complained that object &#8220;bobj&#8221; was not found. It was a javascript object. I found the page was referencing a js file in the directory <code>http://host/aspnet_client/system_web/2_0_50727/crystalreportviewers12/</code>. There was no <code>crystalreportviewers12</code> directory there, however there was one at the root&#8230; and one in the <abbr title="Crystal Reports">CR</abbr> install directory, <code>C:\Program Files\Business Objects\Common\4.0\</code>. Then it was clear that the browser needed to find that folder somehow. I copied it there to test, and it worked. Later, as per direction, we created a Virtual Directory to the install folder. I also had to add <code>C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\</code> to the PATH environment variable, otherwise I would get a DLL error when trying to export to Excel format.</p>
<p>That pretty much sums it up. But I&#8217;m going to outline the steps anyways:</p>
<ol>
<li>Completely uninstall Crystal Reports (all version, make sure DLLs do not exist in Common Files folder, or Bin folder of web application)</li>
<li>Reboot</li>
<li>Install Crystal Reports 2008, doing a custome install and making sure to install packages for Visual Studio and the .NET framework (I don&#8217;t believe they were selected by default, this may have had something to do with it). I opted to install all features on my development machine, just in case.</li>
<li>Add <code>C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\</code> to the PATH variable (adjust path if needed)</li>
<li>The directory <code>crystalreportviewers12</code> must be accessible by client browsers from the <code>aspnet_client\system_web\2_0_50727</code> folder. Copying the folder or creating a Virtual Directory to <code>C:\Program Files\Business Objects\Common\4.0\crystalreportviewers12</code> are options</li>
<li>Reboot</li>
</ol>
<p>I hope this helps anyone having Crystal Report 2008 problems with a ASP.NET site (or helps in any other way). The reason I revisted this was because I am configuring a new developement workstation I was upgraded to at work, and have to go through this process again. It&#8217;s good to refresh myself. If I run into any more problems I&#8217;ll post them. Please add your comments or ask any questions if you&#8217;re having problems!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aaziz.org/configure-crystal-reports-2008-for-aspnet-on-iis/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Export Error with Crystal Reports 2008, in ASP.NET</title>
		<link>http://blog.aaziz.org/export-error-with-crystal-reports-2008-in-aspnet</link>
		<comments>http://blog.aaziz.org/export-error-with-crystal-reports-2008-in-aspnet#comments</comments>
		<pubDate>Fri, 20 Mar 2009 15:13:06 +0000</pubDate>
		<dc:creator>Anthony Aziz</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.aaziz.org/?p=97</guid>
		<description><![CDATA[NOTE: THIS IS WRONG. I later came across troubles with this approach. As I had a suspicion, all DLL versions have to be the same. This &#8220;solution&#8221; posted here is no longer relevant. I do, however, have a solution, which I will post shortly.
UPDATE: I&#8217;ve posted an updated solution.
(There is a solution here, skip down [...]]]></description>
			<content:encoded><![CDATA[<p><em>NOTE: THIS IS WRONG. </em>I later came across troubles with this approach. As I had a suspicion, all DLL versions have to be the same. This &#8220;solution&#8221; posted here is no longer relevant. I do, however, have a solution, which I will post shortly.</p>
<p><em>UPDATE:</em> I&#8217;ve posted <a title="Configure Crystal Reports 2008 for ASP.NET on IIS" href="http://blog.aaziz.org/configure-crystal-reports-2008-for-aspnet-on-iis">an updated solution</a>.</p>
<p><span style="text-decoration: line-through;"><em>(There is a solution here, skip down a ways if that’s all you care about, but the introduction might help some)</em></span></p>
<p><span style="text-decoration: line-through;">Frustrating situation at work today. Here’s the situation. I’m currently building a new report system in .NET (currently implement in classic ASP, like the rest of the site). We’re going to be using the latest version of Crystal Reports (2008, or, version 12) as it supposedly solves some issues with scheduling and other server-side issues.</span></p>
<p><span style="text-decoration: line-through;">I’m at a point where I’m actually starting to implement the Crystal Report components and objects into the system to produce report previews, exports, etc. The first thing I do is write the code for exporting (it’s fairly simple). First, Excel exporting, because it’s the most common format our customers/users will use.</span></p>
<p><span style="text-decoration: line-through;"><span id="more-97"></span></span></p>
<p><span style="text-decoration: line-through;"><code>Protected Sub excelLink_Click(ByVal sender As Object, ByVal e As System.EventArgs)</code></span></p>
<p><span style="text-decoration: line-through;">Dim reportFile = GetReport(reportId)<br />
Dim reportDoc = CreateReportDocument(reportFile)</span></p>
<p><span style="text-decoration: line-through;">reportDoc.ExportToHttpResponse(ExportFormatType.Excel, Response, True, ReportFile.DisplayId &amp; &#8220;_&#8221; &amp; Today.ToString(&#8220;yyyy-dd-MM&#8221;))</span></p>
<p><span style="text-decoration: line-through;">End Sub</span></p>
<p><span style="text-decoration: line-through;">Yes, I hate VB too, but what’s important here is the line <code>ExportToHttpResponse</code>. First argument is the format type, an Enumeration, there’s about 10 or 12. Second is the HTTP Response object to send the output to, easy enough.</span></p>
<p><span style="text-decoration: line-through;">Third is a flag “<code>AsAttachment</code>”. From what I gander, if true, it outputs as a download (no output is sent to browser except a “download” box). If it’s false, then it sends the output to the browser, so if it’s a PDF it could possibly show in the browser window, the some for Office documents in IE.</span></p>
<p><span style="text-decoration: line-through;">Last is the filename of the exported file, without the extension (this is added automatically)</span></p>
<p><span style="text-decoration: line-through;">That’s vey simple. So I load up the page, choose a report, and click “Export to Excel”. Here’s my wonderful output:</span></p>
<p><span style="text-decoration: line-through;"><span style="color: #ff0000;"><code>System.Runtime.InteropServices.COMException: Invalid export DLL or export format.</code></span></span></p>
<p><span style="text-decoration: line-through;">FFFF.</span></p>
<p><span style="text-decoration: line-through;">First thing I did was change it to another format – this time “ExcelRecord”, which is an .xls file with no formatting. Still I get the same error message. Ok, this isn’t too surprising. Next, I try PDF export. Badda-bing, it works. Okay, somethings wrong with the excel exporting. A couple of other tests confirm that other formats work.</span></p>
<p><span style="text-decoration: line-through;">Then I remember in my early testing, I had issues using the newest assembly references. I had been using version <code>12.0.2000.0</code> with some issues, but there was also a slightly older version that had been automatically added to Visual Studio, <code>10.2.3600.0</code>. In developing the new page, I wanted to stick to the most recent version, so I had commented out the version 10.* lines in web.config file, and added the version 12.* ones.</span></p>
<p><span style="text-decoration: line-through;">I had this lead, so now I comment out the version 12 lines, and replace the version 10 lines, and it works. Hmmmm.</span></p>
<p><span style="text-decoration: line-through;">Some research proved that people had some issues with this problem as well, and I didn’t really see any solutions. The first thing was reinstall Crystal Reports, multiple versions could be a problem. So I did that. Wiped clean everything CR on my machine until my application wouldn’t run. Then I rebooted and did a clean install of just CR 2008.</span></p>
<p><span style="text-decoration: line-through;">Then I removed everything about CR from my web.config file re-added the references through the project property page. I only chose references that were version 12.0.2000.0 (it still reported 10.* ones). I ran the page again, and the export still didn’t work. FFFFFFFF again.</span></p>
<p><span style="text-decoration: line-through;">Now what do I do? More research. Back to the pages I had from before, and even some other ones. Most prominent comment was a blaming finger towards crxf_xls.dll in the Program Files/Common Files/Business Objects/2.7/Bin directory, which apparently deals with the actual exporting. Some suggestions were to delete the dll, try registering it, replace it with another, etc. None of them worked.</span></p>
<p><span style="text-decoration: line-through;">I looked up the version info on the DLL itself, which was 10.*. I thought this was perhaps the issue, but then again, the other export DLLs were the same version, that is, crxf_pdf, etc.</span></p>
<p><span style="text-decoration: line-through;">After some more researching and still no answers, I thought perhaps I’ll just stick with the version 10 assembly, but the geek in me wanted to do it right, which was use the actually version we’re supposed to be using. I don’t really even know if it made a difference – perhaps the version isn’t correspondent to old DLL versions, or what not, but I wasn’t going to give up yet.</span></p>
<p><span style="text-decoration: line-through;">My next attempt was to try to replace just one of those assemblies with the other vesion, see if that truly was the issue, and if so, which one. Here’s the assembly web.config entries:</span></p>
<p><span style="text-decoration: line-through;"><code style="text-align: left; font-size: 0.8em;">&lt;add assembly="CrystalDecisions.CrystalReports.Engine, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/&gt;<br />
&lt;add assembly="CrystalDecisions.ReportSource, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/&gt;<br />
&lt;add assembly="CrystalDecisions.Shared, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/&gt;<br />
&lt;add assembly="CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/&gt;<br />
&lt;add assembly="CrystalDecisions.Windows.Forms, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/&gt;</code></span></p>
<p><span style="text-decoration: line-through;">The most obvious assembly was the Engine, so I changed that version to 10.2.3600.0 and tested. I didn’t think it would work, but then again, usually you don’t. But it did.</span></p>
<p><span style="text-decoration: line-through;">So that was my solution, though I’m not sure if it’s the best way. However, I got what I wanted, or as much as I can. I don’t want to spend more time on this. I only have CR 2008 installed now, and if this version 10 assembly works, then it should work in production – which is, really, all I care about.</span></p>
<p><span style="text-decoration: line-through;">I offer this here as help to anyone having a similar issue, and I am also open to others’ comments. Perhaps I’m missing something here. Any help would surely be appreciated, I simply have no where else to go by myself.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aaziz.org/export-error-with-crystal-reports-2008-in-aspnet/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

