Sreenath G

Sreenath G

  • NA
  • 233
  • 311.7k

Exporting Fusion charts in ASP.Net

May 31 2011 1:45 AM
 

Hi,

How can export fusion charts to an image. I have tried the following but it is creating blank image.  But the graph is been plotted well.

……………………………………………………………………………………………..

LiteralClosedDefectsTrend.Text = lGraphXML; // This is graph xml been generated

 

lFnDownloadGraph(lGraphXML);

 

void lFnDownloadGraph(string aStrXMLGraph)

        {

            try

            {

                SWFToImage.SWFToImageObject lObjswfobj = new SWFToImage.SWFToImageObject();

                lObjswfobj.InitLibrary("demo", "demo");

                lObjswfobj.InputSWFFileName = Server.MapPath("FusionCharts/") + "FCF_MSColumn3D.swf";

 

                string lStrNeededEtx = "jpg";

 

                string lStrSelectedExtn = "";

 

 

                if (lStrNeededEtx == "jpg")

                {

                    lObjswfobj.ImageOutputType = TImageOutputType.iotJPG;

                    lStrSelectedExtn = ".jpg";

                }

                else

                {

                    if (lStrNeededEtx == "gif")

                    {

                        lObjswfobj.ImageOutputType = TImageOutputType.iotGIF;

                        lStrSelectedExtn = ".gif";

                    }

                    else

                    {

                        if (lStrNeededEtx == "png")

                        {

                            lObjswfobj.ImageOutputType = TImageOutputType.iotPNG;

                            lStrSelectedExtn = ".png";

                        }

                        else

                        {

                            if (lStrNeededEtx == "bmp")

                            {

                                lObjswfobj.ImageOutputType = TImageOutputType.iotBMP;

                                lStrSelectedExtn = ".bmp";

                            }

                        }

                    }

                }

 

                string lStrFilenm = "FCF_StackedColumn3D" + lStrSelectedExtn;

                lObjswfobj.Execute_Begin();

               

 

                lObjswfobj.Execute_SetVariable("dataXML", aStrXMLGraph);

 

                lObjswfobj.Execute_SetVariable("chartWidth", "750");

                lObjswfobj.Execute_SetVariable("chartHeight", "600");

 

                lObjswfobj.ImageWidth = 600;

                lObjswfobj.ImageHeight = 500;

 

                lObjswfobj.Execute_GetImage();

 

                string lFilePath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

 

                lObjswfobj.SaveToFile(lFilePath + @"\" + lStrFilenm);

                lObjswfobj.Execute_End();

                //DownloadImage(lStrFilenm);

            }

            catch (Exception)

            {

 

                throw;

            }

        }

 

……………………………………………………………………………………………..

Any Help on this please.


Answers (3)