Solved

Turn on Grid lines in Excel with ColdFusion

Posted on 2009-07-01
2
1,139 Views
Last Modified: 2013-12-20
I'm outputting data to a html table  with colfusion and saving that with cfcontent and cfheader..

All works except there are no grid lines.

If I add to the table border=1 - only the data gets a border.

How do i turn on the grid lines?
How do I do it for the entire work sheet?
0
Comment
Question by:PhotoMan2000
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 250 total points
Comment Utility
> If I add to the table border=1

Yes, basic html won't work for those types of properties. You need to mso.  Here is a slight modification of an example from:
http://blogs.lessthandot.com/index.php/WebDev/ServerProgramming/ASPNET/export-table-to-excel-with-grid-lines


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

<html xmlns:x="urn:schemas-microsoft-com:office:excel">

<head>

<meta http-equiv="Content-Type" content="text/html;charset=windows-1252">

<!--[if gte mso 9]>

<xml>

<x:ExcelWorkbook>

<x:ExcelWorksheets>

<x:ExcelWorksheet>

<!--- //this lines names the worksheet --->

<x:Name>gridlineTest</x:Name>

<x:WorksheetOptions>

<!--- //these 2 lines are what works the magic --->

<x:Panes>

</x:Panes>

</x:WorksheetOptions>

</x:ExcelWorksheet>

</x:ExcelWorksheets>

</x:ExcelWorkbook>

</xml>

<![endif]-->

</head>

<body>

<table>

<tr><td>ID</td><td>Name</td><td>Balance</td></tr>

<tr><td>1234</td><td>Al Bundy</td><td>45</td></tr>

<tr><td>9876</td><td>Homer Simpson</td><td>-129</td></tr>

<tr><td>5555</td><td>Peter Griffin</td><td>0</td></tr>

</table>

</body>

</html>

Open in new window

0
 

Author Closing Comment

by:PhotoMan2000
Comment Utility
Worked like a charm!!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now