HTML to excel with cfcontent problem

I want to allow a user to save the contents of a table created with a cfquery in an Excel spreadsheet. Using < cfcontent > I am able to create the worksheet very well, but the formatting isn't fair. Some of it is and some isn't. The "BOLD" on the header row doesn't happen, I can live with, but the landscape orientation does not work and it is a more serious problem. I discovered fine in Excel 2003, but when I have print preview or print it is portrait. I converted this code to ASP. It has the XML inside, so I kept it...

We are still on CF5. Not sure if there is a way to solve this problem.

Thanks for any help on this.

Jeff

< cfsetting enablecfoutputonly = "Yes" >

< cfset filename = ' Facets_Fix_Report_ #fileDate # .xls ">".

< cfcontent type = "application / vnd.ms - excel" >

< name cfheader = "Content-Disposition" value = "attachment; filename = #Trim (fileName) #">"

< cfoutput >
< HTML xmlns: x = "urn: schemas-microsoft-com: excel" >
< HEAD >
< style >
<!--
TD
{
border-width: thin;
border-top-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-right-style: solid;
}
@page
{
MSO-header-data: "& C & \0022Arial\,Bold\0022 & 12 #trim (strHeader) #"; "
MSO-footer-data: "& \00A9 L #DateFormat (now (), 'YYYY')" #\, TriZetto & CPage & P Group on & N & RExported dans\: & D & T ";"
MSO-page-orientation: landscape;
margin: 1 .5in .6in .5in;
}
BR
{
MSO-data-placement: same cells;
MSO-width-source: auto;
}
newClass
{
MSO-width-source: auto;
}
->
< / style >
<!-[if gte mso 9] > < xml >
< x: ExcelWorkbook >
< x: ExcelWorksheets >
< x: ExcelWorksheet >
Change packages < x: Name > < / x: Name >
< x: WorksheetOptions >
< x: print >
< x: ValidPrinterInfo / >
< x: > 600 VerticalResolution < / x: VerticalResolution >
< / x: print >
< x: selected / >
< x: components >
< x: component >
< number: x > 3 < / x: Number >
< x: ActiveCol > 5 < / x: ActiveCol >
< x: RangeSelection > $A$ 1: $F$ 2 < / x: RangeSelection >
< / x: component >
< / x: components >
False < x: ProtectContents > < / x: ProtectContents >
False < x: ProtectObjects > < / x: ProtectObjects >
False < x: ProtectScenarios > < / x: ProtectScenarios >
< / x: WorksheetOptions >
< / x: ExcelWorksheet >
< / x: ExcelWorksheets >
< x: WindowHeight > 10005 < / x: WindowHeight >
< x: WindowWidth > 10005 < / x: WindowWidth >
< x: WindowTopX > 120 < / x: WindowTopX >
< x: WindowTopY > 135 < / x: WindowTopY >
False < x: ProtectStructure > < / x: ProtectStructure >
False < x: ProtectWindows > < / x: ProtectWindows >
< / x: ExcelWorkbook >
< x: ExcelName >
Print_Titles < x: Name > < / x: Name >
< x: SheetIndex > 1 < / x: SheetIndex >
< formula: x > = Recovered_Sheet1! $1: $2 < / formula: x >
< / x: ExcelName >
< / xml > <! [endif]-->
< / HEAD >

Well, I do not know XML, but when I replaced the change packages with #filename #, using the variable instead of the static text string, he worked and worked the "BOLD" orientation and the landscape.

Thank you

Jeff

Tags: ColdFusion

Similar Questions

  • creating excel with cfcontent and MX

    I have a code I have developed on a server running CF version 5.0. I realized that we migrated our production to MX servers and moved my code to the dev of MX box. Once I did, the code I wrote to create an excel file does not in the same way. With SBB 5, I'd like to see the file as a spreadsheet calculation and you could save it as an xls file. After only moved the code in MX, it doesn't let me open the file in the browser. Any ideas what goes wrong

    You must use the following in CFMX:


    #sExcelContent #.

    Notice the

  • problem with cfcontent

    Hello

    I have a problem with cfcontent because I can pass the name of the document. It default value is the name of my program.

    Thanks for your help

    Tank youPresentation.gif

    Try adding a CFHEADER to the mix.

    
      
    

    HTH,

    ^_^

  • I work with a third-party provider that adds agricultural markets that will update every 10 minutes on my site of muse. I'm a designer by trade, and they are the html code. They have problems with my original design elements being pushed around when they

    I work with a third-party provider that adds agricultural markets that will update every 10 minutes on my site of muse. I'm a designer by trade, and they are the html code. They have problems with my original design elements being pushed around when they add the js include. They recommend at this time that I use another program like Wordpress, but I won't do that, because a large part of the site is designed and just add the markets. Here is the link to the site. At this point, the home page is the question. I can also provide a screen shot of how markets are supposed to look like

    This part does not seem too difficult.

    I bet they are now trying to "knit" their share of data right in your Muse- generated page, and they tell you that your code is terrible (and their smells like daisies). The usual clash...

    But it might be easier for you (and many others) if they offer their content as a separate page of small, so you can incorporate it as an iframe tag in an HTML object in Muse. No matter what code for permission to host the iframe, could be inserted as a simple script in Panel of Options of Page of Muse.

  • Help with a problem of Wireless Desktop 800, thank you.

    I have a desktop wireless 800, recently, the keyboard is showing strange behavior as follows;
    1. the left arrow button weighs almost all the time, especially when you try to select text (for example, in word) using Ctrl + Shift + arrow to the left.
    2. the green control led lights when the keyboard is touched against the work surface or slightly harder than usual key and the keyboard stops responding for a few seconds until the light turns off.

    Seriously, I would not have taken the trouble you with this kind of a questions unless it is very annoying because all my work is related to Microsoft word and excel, and I really wanted the entire web for a sufficient answer, but in vain. Hope you can help me. Your time and efforts are deeply appreciated, thank you in advance for your help.

    Dr. Ahmed

    Hello

    To help you better, please answer these questions.

    1. have you tried to use the keyboard on the other computer?

    2 did you do changes on the computer before the show?

    Based on the description of your problem, it seems that the problem is related to hardware. Since you mentioned that you have recently purchased Microsoft Wireless Desktop 800, I suggest you to contact the Microsoft Hardware support for assistance.

    http://www.Microsoft.com/hardware/en-in/support

    However, you can read these articles Microsoft and check if it helps.

    Troubleshoot the incidents of the response to the mouse or wireless keyboard

    http://support.Microsoft.com/kb/838398

    Mouse, touchpad and keyboard with Windows problems

    http://Windows.Microsoft.com/en-us/Windows/help/Mouse-touchpad-and-keyboard-problems-in-Windows

    If you need help with the Windows operating system, just tell me and we will be happy to help you.

  • I have a student subscription (English), cc2015 Photoshop starts in trial mode and in Dutch. Anyone who is familiar with this problem?

    I have a student subscription (English), cc2015 Photoshop starts in trial mode and in Dutch. Anyone who is familiar with this problem?

    Hi Walter,

    Please check the help below document:

    https://helpx.Adobe.com/manage-account-membership/CC-reverts-to-trial.html

    Kind regards

    Sheena

  • Verizon said I can be faced with one problem with my browser and don't charge but ATT, gmail and other

    Tried loading Verizon homepage, but it says I can be faced with a problem with my browser. ATT, gmail between other fine load and Verizon was very well for some time now, what should I do? I'm not tech savvy so please keep it simple for me, thank you.

    Try to clear your browser's cache.

    Firefox button or tools > clear recent history... - details and of course Cache hit only is selected, and then select all and click the clear now button.

  • Presario SR1463CL with drivers problems

    Please be tolerant of beginners.

    I purchased a SR1463CL to add to a DELL Dimension - old but never fails. -the HARD drive was crushed. I replaced the HDD Samsung with Western Digital. I have replace the dial-up modem. All this without problems. I installed Windows XP Pro and SP2 update. My system detects "New hardware" drivers VGA Compatible and multimedia controller. I have had no success finding the right drivers and their installation. My monitor works find, but I have no sound.

    Poster 'sounds, video controllers' Device Manager with the problems. Initial device showed sound and audio by default to the Modem. I removed which and at this point no device is indicated.

    Device Manager shows no driver found for new hardware and online search has failed. Windows Update detects any is available. I checked on the resource one manufacturing line have failed in my downloadsfrom RealTek and Nvidia.Dial - up has had major periods and material has been identified as there's no way for the system. Previous owner had made the back-ups-DVD-but they went "purple haze" and could not be read. That's why I installed XP Pro.

    My modem does not work on and additional time. It will connect and funtion but after a few minutes I'll get "Page not found" displayed.

    So, I use my Dell Dimension for internet troubleshooting. Any help is greatly appreciated.

    Respectfully.

    "Submariners do it deeper."

    Thanks for the information. Due to serious conflicts resulting from auto-updates from microsoft, which I had to reformat the HARD drive and have located since the necessary drivers to the www.sis.com for VGA and www.realtek.com for audio AC 97 readers to be precise. Manually review and choose downloads in the future.

    "Greens, all councils prepare to dive."

    Thanks again for your help. It is greatly appreciated.

    Bamabubblehead went to the abyss.

  • My macbook air running hot and the battery drains quickly can help you with this problem?

    My macbook air running hot and the battery drains fast is a 13 ", at the beginning of 2014.  Processor 1.4 GHz intel core 15Can you help with this problem?

    Apps can affect the performance of Mac, battery, temperature and fan activity - Apple Support

  • just installed new update for itunes. When I go to the page stoe it flashes really hurt. anyone with this problem. is there a solution?

    just installed new update of itune. When I go to store the page, it's really bad flicker.  anyone with this problem. is there a solution?

    Widely not reported, no known resolution until Apple release a new version of iTunes that affects it.

  • How can I send façade to Excel with extension xlsx?

    Hello

    How can I send façade to Excel with extension xlsx (for Excel 2007)?

    This is my file as an attachment"and the extension of excel sheet is" C:\Documents and Settings\tr1388\My Documents\New Folder\Book1.xlsx ".

    Hey King Rio,.

    See below for an example of how you might go about inserting a picture of your façade in an Excel document. You can do a little more of your image formatting, as this example simply updates the image of the façade in the upper left corner of the first workbook in your Excel document.

  • Call and open an external Excel with exec system vi

    Hello!

    I would like to know how I could call and open an external Excel with the exec system vi. I am able to call a txt file, but I can't do it with an excel file...

    Thank you very much in advance.

    It should work like any other file, it opens in the default program for the file extension that if you double click on it.  Here is an example if code that I use.

  • two drivers of PXI chassis with Configuration problem

    Hello

    I have two PXI chassis. One is PXI 1033 and works perfectly with the NI PXI-5404, 5105, 6509, 1409, installed 8336. The other is 1036 PXI with the PXI-5404 NI, 8366 installed. When I was trying wreath connect, as master 1033, 1036 as slave, I found several problems.

    1. in the Measurement & Automation Explorer, does not have my good guys in 1033. Instead, there is a sign of the Red Cross in bottom right with 6509, 5105, 5404.

    2. I can't find an another 5404 of the 1036. In fact, I can't find 1036 in MAX.

    Update BIOS. My PXI system is already identified under the name 'NOR PXI - 1033 Embedded MXI Express' and Chassis1 is identified as 'NOR PXI 1033'.

    So I made several tests as below:

    1. unscrew the 5404 1036 slave. MAX can configure 2 1036 chassis. Ok. But when I reconnect 5404 in 1036, same result happened as stated above.

    2 uninstall the driver of 5404, so the 5404 in 1033 does not either now. And then reboot again, same result happens again. Cannot detect the 1033 chassis. Other vouchers in 1036 don't work either.

    Please, any suggestion is highly appreciated.

    Sincerely,

    Bin

    Hi Ben,

    This happens sometimes with MXI-Express:

    Error code 12 with MXI-Express

    http://forums.NI.com/T5/PXI/two-PXI-chassis-connection-with-configuration-problem/m-p/1475876#M9033

    In general, you can read this error 12 means on Device Manager:

    Explanation of error codes generated by Device Manager in Windows XP Professional

    http://support.Microsoft.com/kb/310123

    If it was a problem of bandwidth, PCI or PXI side, you could pull a few cards to see if that alleviates the problem, or that the link from Microsoft over the States, you can disable the driver for other cards.

  • When you install the 2007 Microsoft Office Suite Service Pack 2 (SP2), I still received the error code 646... I tried to download the RegCure as advised, but the problem still exists... Please help me with this problem... Thank you

    Ideas:

    • When you install the 2007 Microsoft Office Suite Service Pack 2 (SP2), I still received the error code 646... I tried to download the RegCure as advised, but the problem still exists... Please help me with this problem... Thank you

    I tried to download the RegCure as advised, but the problem still exists...

    Who advised you to 'download... '. RegCure? Doing so could only worse issues! If you ever think that your registry database must be cleaned, repaired, boosted or optimized (it isn't), read http://aumha.net/viewtopic.php?t=28099 and draw your own conclusions.

    See http://social.answers.microsoft.com/Forums/en-US/vistawu/thread/6e716883-7af4-4a9f-8665-2f4dd57eee8d ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • I have a frozen screen of Active recovery of white desk with a mouse. I think that the computer is frozen upward with a problem of recovery? Right?

    I have a frozen screen of Active recovery of white desk with a mouse.  I think that the computer is frozen upward with a problem of recovery? Right?

    How can I fix?

    Hello
    • What were the changes made before the problem occurred?

    You can try to restart the computer and check if it helps.

    If above does not help, you can read the following steps to disable the active desktop on the computer and check:

    a. to disable Active Desktop.
    b. right click on an area empty office, point to Active Desktop, and then click view as Web Page to clear the check box.

Maybe you are looking for

  • iPad news sites always loading in the Middle

    Why always charge my Web sites of newspapers in the middle of the page of the site? I always have to scroll up to the mast-head to read from the top. Is there a display setting that I don't know? Thank you.

  • Stop an application of loop within an event from the front panel

    Hi all I was asked to add a stop button feature to a vi wrote to someone who is no longer with us. They wrote a "loop" feature is to crunch some data and adds it to a file during each iteration of the loop for. They put that inside a structure of the

  • VC_RED

    Because I'm tweak trigger-happy, I became aware of what is in my C: drive at some point. Now, everything that the sudden there is this previously unknown of VC_RED with the category "CAB file. What is c? How it is there? Do I need? Should I keep or d

  • Windows 7 Ultimate 64 k product key not valid after more than a year of use

    Initially, I bought a Windows 7 Ultimate 64 upgrade as a student version. My computer originally had Windows 98. ten years later my hard drive died, and I learned that you cannot reinstall a version upgrade. (beware of the free windows 10 UPGRADE). I

  • Adding host snmp-server error

    I install new software to version 8.03 running ASA5510 and using ASDM-603. The ASDM to add host computers using snmp-server, most of the ip addresses in the subnet works very well. However, I have two addresses that always display an error "conflict