trichview.support
Re: Creating documents by code |
Author |
Message |
Sergey Tkachenko |
Posted: 04/22/2004 22:12:43 > I'm using RichView to create reports by code. The user can print, save, > save as html, load, edit, send by mail and so on the report. > > The second step is to allow the user create report templates, then I > will have to use some kind of scripting that generates contents from > the application. > > I asked about the best approach to create documents by code because I > was affraid to be in the wrong path. Two main approaches are possible. 1) If you know which text and paragraph styles will be used in your report, just add them in RVStyle and use their indices. For example, you can say - this text style will be used for normal text, this one - for head lines, this one - for keywords, this one - for citations, etc. Separated code for defining font/paragraph properties and for document generation will allow to your the code simpler and clearer (comparing with traditional approach) and make it more easy to modify. 2) You may not know all the text/paragraph styles that need to be used (for example, you generate document basing on some script). You can add new styles on the fly (reusing existing styles when possible) See the example: http://www.trichview.com/support/files/chatcodes.zip |
Powered by ABC Amber Outlook Express Converter