Wednesday, February 26, 2014

MSChart cheat sheet

Microsoft bought Dundas charts.  Sometimes it helps to google that tool as well.  Better documented.
Dundas Documentation



Line graphs are not fond of nulls, seems to mess up results

Formatting
chart.Series[name].Label = "#VALY{C0}";  //will give you the value of Y formatting with currency

chart.ChartAreas[0].AxisY.LabelStyle.Format = "{C0}";  //format the labels of the Y axis with currency

Tuesday, February 11, 2014

abcPDF

Here is an interesting problem when using abcPDF Gecko engine.

Error creating initial PDF: WebSupergoo.ABCpdf9.Internal.PDFException: Failed to add HTML: Page load timed out.; Gecko engine hit an error it was unable to recover from. Possible causes: XULRunner folder is corrupt or is from another version of ABCpdf. ---> WebSupergoo.ABCpdf9.Internal.PDFException: Gecko engine hit an error it was unable to recover from. Possible causes: XULRunner folder is corrupt or is from another version of ABCpdf. at WebSupergoo.ABCpdf9.Internal.Gecko.GeckoWorker.AddImageUrl(String url, Double pageWidthMm, Double pageHeightMm, AddImageUrlOptions options, UInt32& numCommands, Byte[]& data) --- End of inner exception stack trace ---


This took a while to track down. It is a combo of two things. One, if the page that you are rendering has something like this one it:

$(document).ready(function () { window.print(); });

And, your abcPDF Gecko MediaType is Screen. Regardless of your UseScript setting.

Now the document also refer to an error in another condition as well. Wouldn't it be awesome if they would give you the exception that will be thrown?

"For the Gecko engine, the Screen media must be used with UseScript true. An invalid combination (i.e. Screen with UseScript false) yields an exception when you call AddImageUrl or AddImageHtml."

I must also say, I have been a huge fan of WebSupergoo for a long time. I have programmed a lot of heavy duty PDF magic with their product. Also, I have been a fan of their support. But, I have to say their support is getting slow to respond and unhelpful.

Quick way to access the GAC

"Just hit Windows+R and type Assembly"