Jump to content
Software FX Community

Getting Invalid License message when exporting charts ...


Recommended Posts

Hi,

We are using Chartfx 7.0 for java here at
the census bureau. As long as we use the renderControl() method, the chart
renders fine and we are able to access the charts via the AJAX
toolbar.

However, there are use cases where we need to generate the chart
as an image and embed them in PDF reports. We are trying to use the
exportChart() method for this and trying to create a PNG image as shown in the code example below ....

However, the image produced by this method shows
"Invalid ChartFX licenese" message.

Below is the source sample for
this.

private File getChartFile(ChartData chartData, FileFormat
fileFormat, Gallery gallery, AxisFormat axisFormat, int width, int height)
{
    ChartServer chart1 = new ChartServer();    

  //
Feeds in the chart data to chart server
    initChart(chart1,
chartData);
   
    File tempFile = null;
   
   
chart1.setGallery(gallery);    
   
    try {
     
tempFile = File.createTempFile("euschartfx", ".cfx");
     
   
  FileOutputStream ostream = new FileOutputStream(tempFile);
     
     
     
chart1.setFileContents(EnumSet.of(FileContents.ALL));
     
chart1.exportChart(fileFormat, ostream);
                 

      ostream.close();      
    } catch (IOException e)
{      
     
ExceptionController.getGenericException().handleAjaxWithRedirect(e);
   
}
   
    return tempFile;  
  }

What are we
missing here?

Thanks,

-- Vishal
IBM / Census Bureau
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...