Solved

Turn on Grid lines in Excel with ColdFusion

Posted on 2009-07-01
2
1,175 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 250 total points
ID: 24760468
> 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
ID: 31598994
Worked like a charm!!
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

730 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