943,993 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Unsolved
  • Views: 3634
  • ColdFusion RSS
Nov 3rd, 2009
0

ColdFusion creating Excel file

Expand Post »
Does anyone know if it is possible to format the Excel spreadsheet (dynamically created using ColdFusion and pulling from a MySQL database) to have the Excel file automatically set to landscape, rather than portrait for printing. My client wants that Excel spreadsheet formatted for him. I have the borders and colors and headers set, but I'm told they've seen this done before, so I was hoping someone could tell me how, or point me in the right direction. I've done a google search, but can't find anything about this. The only way that I can imagine it could be done, is if the data is being put into an Excel file that is acting as a template, with all the features set in advance, but I don't know if that's possible using ColdFusion, nor have I ever seen it done. Any help is greatly appreciated.

Thank you in advance.
elizabeth
Last edited by elizabeth1; Nov 3rd, 2009 at 4:59 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
elizabeth1 is offline Offline
2 posts
since Nov 2009
Nov 4th, 2009
-1
Re: ColdFusion creating Excel file
use this css property..

mso-page-orientation:landscape;

apply this to the body.

check this page comment # 3. You can get a idea if u need a code level help.

else reply to the thread again
Reputation Points: 10
Solved Threads: 0
Newbie Poster
elixir is offline Offline
2 posts
since Dec 2008
Feb 11th, 2010
0
Re: ColdFusion creating Excel file
you can save an existing excel file to a .xml file and wrap it with
ColdFusion Syntax (Toggle Plain Text)
  1. <cfsavecontent variable="strXmlData">
  2. <cfoutput>
  3. <!--- Excel that was converted into an xml here --->
  4. </cfoutput>
  5. </cfsavecontent>
  6.  
  7. <cfheader
  8. name="content-disposition"
  9. value="attachment; filename=franchisee.xml"
  10. />
  11.  
  12.  
  13. <cfcontent
  14. type="application/msexcel"
  15. variable="#ToBinary( ToBase64( strXmlData.Trim().ReplaceAll( '> \s+', '>' ).ReplaceAll( '\s+<', '<' ) ) )#"
  16. />
Or you can check out POI Utility by Ben Nadel. Its a great utility for reading and writing excel file.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
grungy coder is offline Offline
7 posts
since Feb 2010
Feb 19th, 2010
0

This can be done.

Click to Expand / Collapse  Quote originally posted by elizabeth1 ...
Does anyone know if it is possible to format the Excel spreadsheet (dynamically created using ColdFusion and pulling from a MySQL database) to have the Excel file automatically set to landscape, rather than portrait for printing. My client wants that Excel spreadsheet formatted for him. I have the borders and colors and headers set, but I'm told they've seen this done before, so I was hoping someone could tell me how, or point me in the right direction. I've done a google search, but can't find anything about this. The only way that I can imagine it could be done, is if the data is being put into an Excel file that is acting as a template, with all the features set in advance, but I don't know if that's possible using ColdFusion, nor have I ever seen it done. Any help is greatly appreciated.

Thank you in advance.
elizabeth
I am currently doing this, but I don't use landscape. I am changing font colors, cell shading. The following links should work.
ColdFusion Syntax (Toggle Plain Text)
  1. http://www.bennadel.com/blog/484-Adding-Basic-CSS-Support-To-My-POI-Utility-ColdFusion-Component-For-Excel-Creation.htm
  2.  
  3. http://www.bennadel.com/blog/474-ColdFusion-Component-Wrapper-For-POI-To-Read-And-Write-Excel-Files.htm
  4.  
  5. http://www.d-ross.org/index.cfm?objectid=9C65ECEC-508B-E116-6F8A9F878188D7CA
  6.  
  7. http://www.bennadel.com/blog/865-POIUtility-cfc-Examples-For-Reading-And-Writing-Excel-Files-In-ColdFusion.htm
Reputation Points: 27
Solved Threads: 0
Light Poster
danarashad is offline Offline
43 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ColdFusion Forum Timeline: coldfusion merge to word
Next Thread in ColdFusion Forum Timeline: COLdfusion code migration from V5 to V(





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC