ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 14th, 2005, 02:18 AM
wballz wballz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 11 wballz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 45 m 50 sec
Reputation Power: 0
Formatting Excel Reports

Hi can anyone tell me if they know of any code that allows you to format ( set margins, page breaks etc.) data that is being output to an excel file.

At the moment i have got the excel output file looking exactly how i want it, only problem is that the data in the file is in groups and when printing in excel the page breaks appear right on the middle of a group so i will get half on one page and half on the next.

Oh and if anyone does have any solutions, i might need a little help implementing it because my data is arranged in 2 columns. As shown in the picture, although unlike the picture the number of rows per group changes depending on the data.

Any ideas??

edit: oh and i don't have access to Cold Fusion 7, i think i'm using 6.1
Attached Images
File Type: bmp sample.bmp (854.8 KB, 105 views)

Reply With Quote
  #2  
Old April 14th, 2005, 08:26 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
For that kind of control I think you'd need to use something like Apache POI.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old April 17th, 2005, 08:46 PM
wballz wballz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 11 wballz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 45 m 50 sec
Reputation Power: 0
ahh just had a look at poi and it seems to be overly complicated for what i want. I have to install a variety of different packages and classes on the server which i don't have access to (i would have to request that the server admin do it all). When all i really want is a page break command for excel

Reply With Quote
  #4  
Old April 17th, 2005, 10:27 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
Remember that when you create "Excel formatted output" all you are really doing is creating an HTML table that Excel can read and render. Unfortunately since there is no HTML "page break" command I don't think there is any way to get a page break to register in Excel either. The reason that you can do this in something like Apache POI is because with POI you are not just creating an HTML table, you are creating an actual Excel binary file, which means you can do much more.

That said, you might be able to do this in CFMX 7 with their new report builder and Excel output options (in fact I think it uses Apache POI under the hood).

Reply With Quote
  #5  
Old April 17th, 2005, 11:37 PM
wballz wballz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 11 wballz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 45 m 50 sec
Reputation Power: 0
yeah i think cf7's reporting features would have the features i need, too bad my work wont buy cf7. Oh well i might just have to force my groups to all be 8 rows which will mean there will be 14 groups per page (i.e. an excel page is 56 rows). Only downside is that some groups will only have enough data for 5 rows leaving a lot of white space.

Reply With Quote
  #6  
Old April 25th, 2005, 09:58 AM
Shmoo Shmoo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 38 Shmoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 43 m 17 sec
Reputation Power: 4
If it helps, you can pass over the cf codes for breaks, and Excel will recognize them.

For example, our excel reports have titles before the actual data output in the spreadsheet, and all we have to do is pass over something like:

<CFSET title = "#maintitle##chr(13)##subtitle##chr(13)##date##chr(13)#">

And that shows up in the first cell in Excel as:

Main Title
Sub Title
Date
(and then the data output)

Bah, I just reread your original post and realized this isn't what you asked for...I'm not sure how you would pass over margin or page-break info, sorry

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Formatting Excel Reports


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT