Jump to content

ASP & Word


musicradiolive

Recommended Posts

Urmm, has anyone around here ever attempted this?Although it's not important for the script i am writing, it would be a cool feature to have.I have a page that will display a table according to whats in the database, and want to be able to provide a printer friendly page, to do that i would like to send it over to word (cos it looks more posh lol)Anyone got any ideas how to do that? Be interesting to know how to do.

Link to comment
Share on other sites

If you want to make an actual Word document (.doc), you will need to buy a third-party component to do that. Microsoft keeps it's formats under copyright. You can write out an RTF document, or a PDF for free though. The RTF format is confusing to try and understand, and the specification document isn't much help either (it's very technical), but if you create an RTF template it should be easy enough for you to replace things in the document with whatever you want. But RTF uses a lot of confusing ways to do simple things. For example, if you want to use a table or a list in your document, you need to define the format for it on the top of the RTF document. They could have just used HTML-style syntax to let you put a table or list anywhere easily, but instead you have to first define the structure (and give it a name) on the top, and then use it later. Also, if you only have 1 table or list, you only need one definition on top, but if you have more than one, you need definitions for 9 of them, regardless of how many you use. You also need to define all fonts on the top of the document. RTFs can be a major pain to work with. And if you have any images in the document, the file size starts to get really big.Oh, and if there is a syntax error in the RTF, Word will just crash.I'm not sure about ASP, but with PHP there is also a lot of support for generating PDF documents, which will generally look nicer than an RTF, and are a lot easier to create.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...