Skip to main content
Participant
October 9, 2009
Question

How to use cfcontent to export cfchart image to Word?

  • October 9, 2009
  • 1 reply
  • 973 views

I tried to use cfcontent to send cfchart image to Word 2003. It did not work.

Does any one have idea how to do that please?

The code I used is:

<cfquery name="DataTable" datasource="#Request.DSN#" >
  select *
  from   testchart 
</cfquery>

<cfchart format="jpg"
    xaxistitle="Department"
    yaxistitle="Number">

<cfchartseries type="line"
    query="DataTable"
    itemcolumn="Dept"
    valuecolumn="Number">

</cfchartseries>
</cfchart>

    This topic has been closed for replies.

    1 reply

    Inspiring
    October 9, 2009

    Possible solutions:

    1. You might try creating a rich text format (.rtf) file in ColdFusion.  The .rtf format is understood by Word and other applications like OpenOffice.org.
    http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/


    2. You could use a Java component to create a Word document.

    Aspose.Words for Java (commercial Java component)
    http://www.aspose.com/categories/java-components/aspose.words-for-java/default.aspx

    Apache POI (open source Java component)
    http://poi.apache.org/hwpf/index.html


    3. You could create an XML document which is compatible with Word.
    http://msdn.microsoft.com/en-us/library/aa223584%28office.11%29.aspx
    http://msdn.microsoft.com/en-us/library/aa212812%28office.11%29.aspx


    You will probably need to look into using the name attribute of CHART to get your chart image into a binary format what can be used programmatically.