The problem is that you need to install the Crystal Reports runtime. This isn't a problem with regular hosting since you can just install Crystal Reports on each of your servers and off you go.
With Azure, though, if you remote into the machine and install it, it will work fine until your deployment is redistributed to another machine which it will do at some point due to the nature of cloud computing.
How to install Crystal Reports on your Azure web role
Fortunately it is still easy with Azure. Easy when you know how anyway. Here are the steps you will need to take:
First of all you will need to download the SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit). This should extract as a msi file called CRRuntime_64bit_13_0_2.msi.
In your web application in Visual Studio you should paste this msi file at the route of your web project and include it in the project. Right click it in the Solution Explorer and set its 'Build Action' to 'None' and also set its 'Copy to Output Directory' to 'Always Copy'.
Next you will create a command file to execute this msi file. Create a new text file, call it StartUp.cmd and then save it in the root of your web project (next to the msi). In that file write the following:
@ECHO off ECHO "Starting CrystalReports Installation" >> log.txt msiexec.exe /I "CRRuntime_64bit_13_0_2.msi" /qn ECHO "Completed CrystalReports Installation" >> log.txt
Set the properties of StartUp.cmd to 'Build Action' = 'None' and 'Copy to Output Directory' = 'Always Copy'.
Now in your ServiceDefinition.csdef make this cmd file a start up task by adding the following lines:
<WebRole name="Web" vmsize="Small"> ... <Startup> <Task commandLine="StartUp.cmd" executionContext="elevated" taskType="background" /> </Startup> </WebRole>
You are now instructing each instance that starts up with your package to run the Crystal Reports msi file that installs the runtime on the instance ready for its use in Azure.
A few Crystal Reports on Azure tips
I ran into a few bits and bobs which caused me unnecessary pain along the seemingly clean process outlined above. I will share them with you in case you do too in no particular order.
- Make sure your .rpt Crystal Report files are set to Build Action: Content and Copy to Output Directory: Copy always.
- Don't be alarmed with how long it takes to deploy. It will take much longer to upload than usual because you are now uploading an extra 77MB of installation files. It took me an hour to deploy on my home connection!
- Ignore all the warnings about how your web project is dependent on various Crystal Report assemblies since Azure will have them just as soon as your installation file runs.
- Configure a remote desktop connection when you do your deployments since it will be invaluable should anything go wrong and at an hour per deployment you don't want to be messing about.
- Visual Studio may have added a load of random assemblies in your web.config you are not aware of and don't need and may even cause problems like log4net.
That is all. Good luck - it's very satisfying when you get it going.
I followed this along with partial success, but that's probably a version thing [it's now May 2012].
ReplyDeleteMy Azure webrole is on an x64 server, and I'm developing in vs2010, with .Net 4.0. Crystal runtime is up to 13.0.3.
The big issue is the 'undefined bobj' error, which I think is being caused because IIS is installed on D: on the Azure server. Does Crystal look for the viewer on C:?
My work around, if it helps, was found here http://social.msdn.microsoft.com/Forums/en-CA/vscrystalreports/thread/ef56f72b-7ede-47d8-ba9e-9e63b9ac0203.
Bascially copy all the viewer files from the aspnet_client\system_web\4_0_30319 to a sub-directory of your project, fill in the sections in your web.config as shown in the link above, and it works.
Great Article Cloud Computing Projects
DeleteNetworking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Great instruction, all works. But I have one problem: I have a report with dynamic parameter and from local computer I have a list of items from combo box. But when I upload it to Azure and I view report, I have to enter value to textbox (like in static parameter).
ReplyDeleteI connect to Azure database.
Nice article, and I have implemented the same as you posted, but i am unable to publish to Azure.
ReplyDeleteI am getting the below error when I click on Publish
Error 64 Exception of type 'System.OutOfMemoryException' was thrown. C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\1.7\Microsoft.WindowsAzure.targets 2814 5 WindowsAzure1
Can you help on this?
this way is good one to install crystall reports but it akes too much time .
ReplyDeletealternatively we can use .bat file and powershell to run crystal reports on azure
it is very fast ,whole procedure is finished in 20 minutes.
Hi!!
ReplyDeleteCan you show me the way to do it with a .bt and powershell?
May be it's posible to host the engine into a Blob and create an Script to download it and install it, but I don't know how.
Hi, I uploaded to Windows Azure a WebSite that uses Crystal Reports.
ReplyDeleteI'm not using a Virtual Machine, but a "Standard Web Site". Is this tutorial specific for virtual Machine? If it isn't, where "ServiceDefinition.csdef" comes from??
Regads.
Dear Jaime,
DeleteDid you get any solutions to this? I am stuck with the same scenario.
Hi Usman,
DeleteSorry for the delay.
I endup using a cloud service following those steps.
"ServiceDefinition.csdef" comes from the Azure project you have to include to your solution.
Hope this helps.
Cheers.
OK thanks, i will look into it and will try to implement.
Deletehttps://stackoverflow.com/questions/36769894/creating-a-servicedefinition-csdef
DeleteHi Colin, I moved to Cloud Servive and followed your steps, but it crash with log4net.dll: “Could not load file or assembly ‘log4net’ or one of its dependencies.”, and log4net is not included in my web.config.
ReplyDeleteDid you face this problem?
Thanks
Hi Colin,
ReplyDeleteWe have deployed crystal reports on azure web roles. We are facing following issues:
1. We have noticed that whenever the web roles cloud service restarts(for any unknown reason), the crystal reports installation doesn’t work and the cloud service just goes into loop of starting and restarting, and our web application doesn’t work at all. The error we get is: : Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The way we fix this problem is by logging remotely into the instance and manually installing crystal reports. After that our web application works fine.
2. The biggest advantage of web roles is that we can have multiple instances. But we have noticed that the moment we have more than one instance, sometimes crystal reports work and sometimes it doesn’t. What happens is sometimes when it doesn’t work we see cross image indicating image not found. But if we have only one instance then no problems, crystal reports works fine. But then we cannot take full advantage of azure web roles multiple instances capability.
Any help/suggestion much appreciated
I have spent complete 2 days and now almost fedup. Is this solution not valid for asp.net mvc web app which is currently working fine on Azure. I added one view which is returning pdf version of crystal report. I am unable to run. Can run startup.cmd file. As i can only use webjobs. Is there any way i can run .msi file in my web app on Azure? Your help will be highly appriciated. Thanks
ReplyDeleteDid you get a solution? We are trying to run a MVC Project and we have the issue on create a ReportDocument(), the error is "log2net.dll could not be loaded".
DeleteI did not get log2net.dll related error. On Azure, i was having issue with crystal reports. I am still struggling with it. Just got one answer today (see above comments) will try to implement that solutions. If it works, will share with you.
DeleteHi Usman, if your using free trial version in window Azure then your not able to installmsiexec.exe /I "CRRuntime_64bit_13_0_2.msi" /qn but if your paid version then once you install msiexec.exe then you won't get Error, you can able to view report.
ReplyDeleteHi
ReplyDeleteI am getting logon failed, however I can connect to SQL server through SSMS , and the rest of ASP.net site.
Any ideas
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteAfter deployed in azure, we get this error :
ReplyDeleteSystem.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> System.TypeInitializationException: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
at CrystalDecisions.Shared.SharedUtils..cctor()
--- End of inner exception stack trace ---
at CrystalDecisions.Shared.SharedUtils.get_CurrentControl()
at CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture()
at CrystalDecisions.CrystalReports.Engine.CREngineRes.GetString(String name)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.CheckForCrystalReportsRuntime()
at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()
--- End of inner exception stack trace ---
at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
at AzureCrystal.Controllers.HomeController.PrintReport()
Ok the issue was the 64 bit. I had to use the 32 bit to get rid of the log4net error
ReplyDeletehi, ?I am getting the following error after sometime..
ReplyDeleteThe HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer error="invalid_token", error_description="A security token validation error occured for the received JWT token."'.
hii. i want to use crystal report in app services in azure then how to use
ReplyDeleteGreatly composed article, if just all bloggers offered the same substance as you, the web would be a much better place.
ReplyDeleteHyundai Xcent Double Din Player
Tata Nexon Double Din Player
Hyundai Verna
Hypersonic OEM Double Din Player
J3l USB Double Din Player
Double Din DVD Player
car accessories
Hyundai Creta OEM Double Din Player
Hyundai i20 OEM Double Din Player
Hyundai Grand i10 OEM Double Din Player
This comment has been removed by the author.
ReplyDeleteNice post tutuapp
ReplyDeleteI'm browsing the Internet to get information and find your blog. I am impressed with the information you have on this blog.
ReplyDeletekokoqq
koranqq
layarqq
mainqq
makmurqq
masterpokerqq
megaqq
meja365
menangqq
mgmpoker
vidmate
ReplyDeleteqiuqiu99
ReplyDeletezonakiu.info
camarqq
pesiarqq
juraganqq
nikmatqq
memoriqq
wededomino
winnipoker
https://kronospoker.biz
clash royale
ReplyDeleteWholesale printed custom perfume boxes with the highest quality and affordable prices. Free worldwide Delivery and free Custom Perfume Boxes design.
ReplyDeleteBuy online wholesale custom eyeshadow palette packaging and packaging at seashore packaging at the easy price Free shipping worldwide with 24/7 customer support.
ReplyDeleteBuy online wholesale printed candle boxes and packaging at easy prices and shipping worldwide, with 24/7 customer support. Get a free custom quote now!!
ReplyDeleteBlackbird packaging provide you with any size, shape design, cbd boxes sooner than any other packaging competitor in the market
ReplyDeleteBlackbird packaging provide you with any size, shape design, lipstick boxes sooner than any other packaging competitor in the market
ReplyDeletePacakaging town is a one stop solution for the short-run cbd facial oil boxes needs and supplies. At affordable prices. Request a free quote now.
ReplyDeleteBlackbird packaging provide you with any size, shape design, custom cbd tincture boxes sooner than any other packaging competitor in the market
ReplyDeleteBlackbird packaging provide you with any size, shape design, cbd bath bomb boxes sooner than any other packaging competitor in the market
ReplyDeletePackaging town is a one stop solution for the short-run interlock boxes Wholesale Custom Boxes needs and supplies. At affordable prices. Request a free quote now.
ReplyDeleteThanks for sharing this nice piece of information. I really loved reading it. In case you want to read mine kindly click bellow:-
ReplyDeleteEscort services in Jaipur
Escort services in Jaipur
Escort services in Jaipur
Escort services in Delhi
Escort services in Guwahati
Escort services in Guwahati
Escort services in Guwahati
Escort services in Guwahati
Escort services in Lucknow
Escort services in Aerocity
Discover the most popular people ranked on Celebrity birthdays.
ReplyDeleteBlackbird packaging provide you with any size, shape design, cbd bath bomb wholesale sooner than any other packaging competitor in the market
ReplyDeletePackaging town is a one stop solution for the short-run custom pillow boxes needs and supplies. At affordable prices. Request a free quote now.
ReplyDelete