I have a specific report that currently runs on client-side thru FX and server-side thru FX+PHP but sometimes the process is locked (besides it's slow).
This is report is complex with several functions, formats, etc, etc so it's a case that push from the report engine.
I needed now another service to also run on server-side with the same report but with 100% of report export to pdf success so my current solution is not an option.
After an evaluation of JS, I saw that there is missing this functions (because it's an young product) but I know already that you are working on that.
Because I need this feature now, I evaluated .NET solution (to run as a webservice side to side with my solution).
First, I want to congratulate the Stimulsoft team. After export to PDF from FX and then from .NET, they are almost identical !
I only found a limitation on .NET side comparing to FX however I found an easy workaround that I share with for the case that you also want to support this on .NET side and get a 100% compatibility between FX and .NET (at least for the features that I evaluated).
About this issue:
On FX I use variables and some of them are to fill images. I use base64string (is a option much more generic than Image that is not support on AS3).
With FX I only need to simple pass the base64string from AS3 to report without any limitation or conversion.
The image component on the report use string as datatype (not Image).
On .NET we get an exception if we configure an Image component as string.
Workaround:
1. Change the report image instances from string datatype to Image;
2. Convert the image datatype from sql (it's a byte array representation of the generic base 64 string):
Code: Select all
report["CompanyLogo"] = Base64ToImage(logo);
Code: Select all
public System.Drawing.Image fromBase64ToImage(byte[] imageBytes)
{
imageBytes = Convert.FromBase64String(System.Text.Encoding.ASCII.GetString(imageBytes));
System.IO.MemoryStream ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length);
ms.Write(imageBytes, 0, imageBytes.Length);
System.Drawing.Image image = System.Drawing.Image.FromStream(ms, false);
return image;
}
Case the Image component is configured as string, you will try to convert the data !