Ignite UI 13.2.20132.2157
Dev box runs Visual Studio Express 2013 for Web on Windows 7 (32 bit)
I have an MVC 5 website running just fine in my development environment, which has Infragistics installed in it.
When I run it on my live platform, which is hosted in Microsoft Azure, I get the following exception:
System.OutOfMemoryException: Out of memory. at System.Drawing.Graphics.FromHdcInternal(IntPtr hdc) at System.Drawing.Font.ToLogFont(Object logFont) at System.Drawing.Font.ToHfont() at Infragistics.Documents.Reports.TTF.Font.GetDataUnsafe(Font font) at Infragistics.Documents.Reports.TTF.Font.GetData(Font font) at Infragistics.Documents.Reports.Graphics.Font.ToStream() at Infragistics.Documents.Reports.Graphics.VirtualGraphics.set_Font(Font value) at Infragistics.Documents.Reports.Report.Text.Text.ComposeUnits(Text text, Composition composition, IGraphics graphics) at Infragistics.Documents.Reports.Report.Text.Text.Measure(Composition composition, IGraphics graphics, MeasureMode mode) at Infragistics.Documents.Reports.Report.Grid.GridCell.Measure(Composition composition, IGraphics graphics, MeasureMode mode) at Infragistics.Documents.Reports.Report.Grid.GridRow.Measure(Composition composition, IGraphics graphics, MeasureMode mode, SpanManager spanManager) at Infragistics.Documents.Reports.Report.Grid.Grid.Measure(Composition composition, IGraphics graphics, MeasureMode mode) at Infragistics.Documents.Reports.Report.Section.Section.Measure(Projection projection, IGraphics graphics) at Infragistics.Documents.Reports.Report.Report.Measure() at Infragistics.Documents.Reports.Report.Report.Publish(Stream stream, FileFormat format) at BRASH.Controllers.MyController.GetReport(Int64 JobID, String diagrams)
The exception is being thrown when dealing with fonts.
I have seen similar problem reports:
http://ko.infragistics.com/community/forums/t/69166.aspx
http://ko.infragistics.com/community/forums/t/35036.aspx
They all say that the problem is with using particular fonts or a mixture of fonts in the report. I have ensured that my report only uses one font and that font is not one of those identified as causing a problem. I have tried Ariel, Verdana and Courier without success.
I am wondering whether I need to deploy something that I have not identified yet; here are the dlls that I am deploying:
Infragistics.Web.Mvc.dllInfragistics.Web.Mvc.Documents.Core.dllInfragistics.Web.Mvc.Documents.Core.xmlInfragistics.Web.Mvc.Documents.IO.dllInfragistics.Web.Mvc.Documents.IO.xmlInfragistics.Web.Mvc.Documents.Reports.dllInfragistics.Web.Mvc.Documents.Reports.xmlInfragistics.Web.Mvc.xmlInfragistics45.WebUI.Shared.v13.2.dllInfragistics45.WebUI.Shared.v13.2.xmlInfragistics45.WebUI.WebSchedule.v13.2.dllInfragistics45.WebUI.WebSchedule.v13.2.xmlInfragistics45.WebUI.WebScheduleDataProvider.v13.2.dllInfragistics45.WebUI.WebScheduleDataProvider.v13.2.xml
The reports are less than 200kB and I have tried it on Azure configurations with up to 7GB of memory (much more than my dev system) and it still doesn't work.
It always works on my dev box. It never works on Azure.
This sounds like a deployment issue but what else would I need to deploy?
Regards,
Graeme
Hello Graeme,
Thank you for contacting us regarding this matter.
I am currently researching this scenario and will keep you posted of any available information.
Please do not hesitate to contact me with any updates of this issue.
Hi
How is your investigation going?
I created anew website on my Azure account and published your example to it and got this error:
[OutOfMemoryException: Out of memory.] System.Drawing.Graphics.FromHdcInternal(IntPtr hdc) +1151173 System.Drawing.Font.ToLogFont(Object logFont) +145 System.Drawing.Font.ToHfont() +98 Infragistics.Documents.Reports.TTF.Font.GetDataUnsafe(Font font) +71 Infragistics.Documents.Reports.TTF.Font.GetData(Font font) +79 Infragistics.Documents.Reports.Graphics.Font.ToStream() +56 Infragistics.Documents.Reports.Graphics.VirtualGraphics.set_Font(Font value) +138 Infragistics.Documents.Reports.Report.Text.Text.ComposeUnits(Text text, Composition composition, IGraphics graphics) +2117 Infragistics.Documents.Reports.Report.Text.Text.Measure(Composition composition, IGraphics graphics, MeasureMode mode) +877 Infragistics.Documents.Reports.Report.Section.Section.Measure(Projection projection, IGraphics graphics) +1799 Infragistics.Documents.Reports.Report.Report.Measure() +626 Infragistics.Documents.Reports.Report.Report.Publish(Stream stream, FileFormat format) +1745 AzureReportPublish.Controllers.HomeController.CreateReport() +599 lambda_method(Closure , ControllerBase , Object[] ) +62 System.Web.Mvc.<>c__DisplayClass1.<WrapVoidAction>b__0(ControllerBase controller, Object[] parameters) +14 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +169 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27 System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__36(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22 System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +29 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32 System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3c() +50 System.Web.Mvc.Async.<>c__DisplayClass45.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3e() +225 System.Web.Mvc.Async.<>c__DisplayClass30.<BeginInvokeActionMethodWithFilters>b__2f(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34 System.Web.Mvc.Async.<>c__DisplayClass28.<BeginInvokeAction>b__19() +26 System.Web.Mvc.Async.<>c__DisplayClass1e.<BeginInvokeAction>b__1b(IAsyncResult asyncResult) +100 System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27 System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39 System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +28 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(IAsyncResult asyncResult, ProcessRequestState innerState) +21 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +31 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9515776 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Do I need to set up anything special on the Azure website to get it to work - this should have replicated what you did to get it going for you.
Your example works OK on my dev box, just not in Azure.
Here is the URL of my site, which is your example ( I Will delete the website in a few days):
http://brashigreporttest.azurewebsites.net/
I have tried this in West Europe and West US data centres to eliminate data centre problems.
I just can't see where I am going wrong here if I can't even republish your working example and have it work for me.
Hi (Sorry for the bombardment of posts - it is one of the few remaining issues that I need to resolve in order to enter UAT)
I have examined your project file and I think that you are using a newer version of IgniteUI than me.
You have:
<Reference Include="Infragistics.Web.Mvc.Documents.Core, Version=14.1.20141.2031, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Program Files (x86)\Infragistics\2013.2\IgniteUI\MVC\Common\Bin\Infragistics.Web.Mvc.Documents.Core.dll</HintPath> <Private>True</Private> </Reference>
Which looks odd as it is referencing v14.1 but using a hint path of 2013.2 which makes it look like the project was upgraded to the latest Ignite UI?
Whereas I have (in my main website):
<Reference Include="Infragistics.Web.Mvc.Documents.Core, Version=13.2.20132.2157, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\Program Files\Infragistics\2013.2\IgniteUI\MVC\Common\Bin\Infragistics.Web.Mvc.Documents.Core.dll</HintPath> <Private>True</Private> </Reference>
Which correlates nicely.
Can you get your example to work with Ignite UI 2013.2, maybe that is the issue?
I have set up a new system with IgnitUI v14.1 and I still get the out of memory exception.
I am now desperate, do I start questioning my Azure subscription?
I have set up a new Azure subscription and tried your example again - it still fails.
I downgraded to VS2010 - it still fails.
So, I have tried :
and I can't get it to work under any combination.
How did you get yours to work?
I found a couple more things that caused OutOfMemory exception on Azure website:
1) QuickText() (or maybe its AddQuickText() - can't quite remember ) fails every time
2) Adding an empty string fails every time - it needs to be at least one space long.
I have worked through my report and have found a couple of other things that resulted in the OutOfMemory exception until I had removed them:
1) IGridCell.AddQuickText("MyText") fails every time
2) IText.AddContent("") fails every time .
Both of these conditions work fine on my Dev system so it is probably relying on some other server element that is not available to an Azure website.
I opened a support ticket and have managed to get to the bottom of this.
The Azure cloud services have access to the server and its installed fonts.
Azure websites do not, so there are no fonts available to the report.
You have to package the fonts that you want into your application and manually load them up on demand.
Here is an extract form the ticket, which was enough to point me onto the right lines:
The issue is probably related to the fact that Azure environments do not have access to system fonts, which are needed in order to export to pdf.
Due to that you would need to make sure that the font you’re using is dynamically loaded into the server.
There’re more details on how to dynamically load the font here:
http://dl.infragistics.com/community/Reporting/ReleaseNotes/RS13.2/Reporting_13.2_Release_Notes.pdf
Under the “Font Loader” section.
OK, so I now know where the confusion has been coming from.
Petar's example works on Azure but only if you set it up as a Cloud Service - NOT if you set it up as a website.
This is quite important as, as far as I can tell, it is cheaper to host a website than a cloud service on Azure so that is what I will need to do most of the time.
Please can you fix it to work on Azure websites?