Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 10th, 2008, 2:54 AM   #1
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 289
Rep Power: 3 Ghost is on a distinguished road
RTF Codes

So I'm developing an app that will take some data out of an sql database and format it into a nice RTF Document. Anyone know of any good tools or resources for RTF? This will be my first project with it and any tips or advice would be great, thank you.

Links I have found and used:
http://search.cpan.org/~sburke/RTF-W...F/Cookbook.pod
http://www.biblioscape.com/rtf15_spec.htm

I'd be interested if there are any Wizards or Generators that will help me speed up the RTF Template process. Thank you.
Ghost is offline   Reply With Quote
Old Jan 10th, 2008, 7:48 AM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,791
Rep Power: 5 Sane will become famous soon enough
Re: RTF Codes

What language are you using? PHP? In the past I've found user-written libraries in PHP for creating RTF documents from HTML, and vice-versa.
Sane is offline   Reply With Quote
Old Jan 10th, 2008, 7:09 PM   #3
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 289
Rep Power: 3 Ghost is on a distinguished road
Re: RTF Codes

VB.Net it is a WinForm based on the 3.5 Framework
Ghost is offline   Reply With Quote
Old Jan 10th, 2008, 8:22 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,791
Rep Power: 5 Sane will become famous soon enough
Re: RTF Codes

Hmm... well if your presentation is limited to only one specific template, it would be very (very) simple (and worth your time), to do the following:
  • In a word processor, create a file identical to your program's desired output
  • Any values that are subject to change, replace with a unique identifier. For example, "January 10, 2008" might become "<Date>" and "Financial Report" might become "<Title>"
  • Save as .rtf
  • Open in a hex editor and see how these identifiers appear in the raw file
  • Chances are, they are still in tact, and at most the "<" and ">" were replaced with something else.

In VB.net, simply:
  • Read in the file
  • Search and replace the identifiers with their matching values
  • Save as .rtf

Then, if you ever need to change the template... just open up the .rtf file in a word processor again, and change around the template.

That's my solution. Hope it at least stimulates some ideas.
Sane is offline   Reply With Quote
Old Jan 11th, 2008, 8:21 AM   #5
SydneyMcConnell
18 Year Old Programmer
 
Join Date: Jan 2008
Posts: 26
Rep Power: 0 SydneyMcConnell is on a distinguished road
Re: RTF Codes

Is there any reason you're using rtf, in particular?
__________________
Tier 2 Hardware Technician
Net Effects, LLC
Brunswick, Ohio
SydneyMcConnell is offline   Reply With Quote
Old Jan 11th, 2008, 10:04 AM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,791
Rep Power: 5 Sane will become famous soon enough
Re: RTF Codes

I presume because he needs to deliver something in a hard-copy format. HTML could do the job, but it's not always the same feel for a user/client as a familiar word document.
Sane is offline   Reply With Quote
Old Jan 11th, 2008, 10:55 AM   #7
SydneyMcConnell
18 Year Old Programmer
 
Join Date: Jan 2008
Posts: 26
Rep Power: 0 SydneyMcConnell is on a distinguished road
Re: RTF Codes

I was going to suggest that he uses XML, especially if it's in hard-copy format.
Even so, I'm pretty sure word can open and convert and XML document that's been formatted with an XSLT Stylesheet.
__________________
Tier 2 Hardware Technician
Net Effects, LLC
Brunswick, Ohio
SydneyMcConnell is offline   Reply With Quote
Old Jan 11th, 2008, 11:05 AM   #8
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,791
Rep Power: 5 Sane will become famous soon enough
Re: RTF Codes

Would someone who's not so computer savvy know what to do with an XML file? I certainly know my mother wouldn't.
Sane is offline   Reply With Quote
Old Jan 11th, 2008, 5:08 PM   #9
SydneyMcConnell
18 Year Old Programmer
 
Join Date: Jan 2008
Posts: 26
Rep Power: 0 SydneyMcConnell is on a distinguished road
Re: RTF Codes

Touche.

However, wouldn't he be able to use the ActiveX controls that come with Office to write the output to a formatted Word Document?

Also, to me it almost seems like he's talking about doing reporting.

What exactly is this application for? Is it a single business app, or is it for a part of a system or something?
__________________
Tier 2 Hardware Technician
Net Effects, LLC
Brunswick, Ohio
SydneyMcConnell is offline   Reply With Quote
Old Jan 12th, 2008, 4:37 AM   #10
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 289
Rep Power: 3 Ghost is on a distinguished road
Re: RTF Codes

RTF is a nice format for printed documents.

I'm using XML to Save the Data, XSLT to Format the RTF Document File. And the application is for taking data from an SQL DB and Creating basically a book version of a website with a single click. It isnt going to do everything for the printed book, but it will have the bulk of it.

@Sane, thank you for the advice, I'll look into that tomorrow.
Ghost is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Function for Converting ASCII Codes? Sane Python 2 Mar 29th, 2006 10:00 PM
Need a bit of help understanding some codes. emdiesse Visual Basic 4 Apr 21st, 2005 12:05 PM
Checking source codes of image, audio and video files on_auc C++ 3 Feb 21st, 2005 8:36 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:56 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC