Best practices in handling documents (mainly rtf files) with sql server

Posted on 2012-09-21
Last Modified: 2012-10-22

I am developing a Lab information system and i need to create  text based reports for certain investigations.  I  have standard templates for each investigation.  i need to import these templates and attach it to a particular investigations and while creating report open this template and enter observations for each patient and print it.   I also need to retirive the patient details in the header of the document for each patient instead of typing every time all the details for each  episode.
Question by:venkataramanaiahsr
    LVL 27

    Expert Comment

    I prefer HTML templates for this purpose. Template body is like this:
    Name: #Name#<BR>
    Birth Date: #BirthDate#<BR>
    <TABLE id='details'><TR><TD>#SomeData#... etc.
    Templates are storing in a database table with <TemplateName> and <TemplateHTML> fields so user can choose template. After filling data in a form (DataGridView or Textboxes, for example) and choosing template, I simply replace #xxx# with relevant data and set webbrowser.documenttext=createdhtml. Webbrowser has dialogs for print/preview.
    LVL 44

    Expert Comment

    How well does Word treat these RTF files?  I would recommend a solution path that programmatically opens these RTF files with Word and extracts the data from the parts of the document you need.

    Dim oWdApp As Object
    Dim oRng As Object
    Set oWdApp = Createobject("Word.Application")
    oWdApp.Documents.Open "your RTF path and filename"
    Set oRng = oWdApp.ActiveDocument.Contents   'or something specific like a Title or field

    Open in new window


    Author Comment

    I've requested that this question be deleted for the following reason:

    I have downloaded Textbox control for dotnet which solves &nbsp;my &nbsp;problem

    Accepted Solution

    I have downloaded TX Textcontrol express edition for dot net which solves  my  problem

    Author Closing Comment

    I have downloaded TX Textcontrol express edition for dot net which solves  my  problem

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now