Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Excel issue

New Here ,
Feb 18, 2010 Feb 18, 2010

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.

369
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Feb 18, 2010 Feb 18, 2010

you can save an existing excel file to a .xml file and wrap it with

<cfsavecontent variable="strXmlData">

  <cfsavecontent variable="strXmlData">

      <cfoutput>

      <!--- Excel that was converted into an xml here --->

      </cfoutput>

      </cfsavecontent>
      <cfheader   name="content-disposition"  value="attachment; filename=franchisee.xml"      />
      <cfcontent      type="application/msexcel"      variable="#ToBinary( ToBase64( strXmlData.Trim().ReplaceAll( '> \s+', '>' ).ReplaceAll( '\s+<

...
Translate
Guest
Feb 18, 2010 Feb 18, 2010

you can save an existing excel file to a .xml file and wrap it with

<cfsavecontent variable="strXmlData">

  <cfsavecontent variable="strXmlData">

      <cfoutput>

      <!--- Excel that was converted into an xml here --->

      </cfoutput>

      </cfsavecontent>
      <cfheader   name="content-disposition"  value="attachment; filename=franchisee.xml"      />
      <cfcontent      type="application/msexcel"      variable="#ToBinary( ToBase64( strXmlData.Trim().ReplaceAll( '> \s+', '>' ).ReplaceAll( '\s+<', '<' ) ) )#"      />

Or you can check out POI Utility by Ben Nadel.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 18, 2010 Feb 18, 2010
LATEST

Thanks for quick reply

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources