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

Posted on 2012-09-21
Medium Priority
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
  • 3
LVL 28

Expert Comment

ID: 38424070
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 46

Expert Comment

ID: 38424828
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

ID: 38501389
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

venkataramanaiahsr earned 0 total points
ID: 38500588
I have downloaded TX Textcontrol express edition for dot net which solves  my  problem

Author Closing Comment

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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

839 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