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
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?
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?