Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 13 of 13
  1. #1
    Join Date
    Mar 2004
    Location
    Michigan
    Posts
    169

    Need Help with Multiple RTF files and the Rich Text Object

    I really would appreciate your help to solve my dilemma --

    1. What I have is a table named questions in a SQLlite database. The table has three columns - QuestionID, QuestionText and QuestionStatus.


    2. I have a page in my project that has a listbox populated with the questiontext from the database. The user doubleclicks on the questiontext in listbox and is then presented with a page where they can type in their answer to the question.

    3. The user types their answer into an input box - clicks on a save button - the answer is then saved as the Question's QuestionID DOT txt (12.txt for example) and the database is updated with a status of A for the answered question.

    4. What I Need: An additional page where a RichText object is populated with the text of each question (pulled from the database where status = A) followed by the related text from the text file .

    For Example - my end result should be a CompleteDocument.rtf file that is something like:

    WHAT IS YOUR NAME? <-- pulled from Database with questionID 1
    My name is john doe <-- pulled from text file (1.txt for example)

    WHO IS YOUR FAVORITE AUTHOR? <-- pulled from database with questionid 2
    My favorite author is Stephen King <--pulled from text file (2.txt)

    WHAT IS YOUR FAVORITE COLOR?
    My favorite color is Red

    ...

    MY DILEMMA:

    How do I merge the text from the questions (held in the database) and the text for each answer for the question to a RTF file that has all the questions and answers in one object like the example above?

    Is there a way to merge RTF files and then open them in the richtext object in my page described in item 4 above?

    If I saved the answer to an RTF file by having the user type their answer into an RTF object and saving as an RTF file (a change to item 3) would that simplify merging the files - how would I merge multiple RTF files?

    I would consider using the database for the answer also but the text for the answer could be 1000's of characters and may not fit into the database field.

    Can anyone help me, please? I'm at a stand still on this project until I figure out a solution to this step. If there's a better way to accomplish the same thing I'd also like to hear it.

    Thanks for your assistance!!!

    Sue

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    I would consider using the database for the answer also but the text for the answer could be 1000's of characters and may not fit into the database field.
    that dosent matter, sqlite can handle that

    i would keep everything in the database (just for tidiness and ease of use)

    database table: QuestionID, QuestionText and QuestionAnswer

    that way your "QuestionStatus" becomes your "QuestionAnswer" if the text in column "QuestionAnswer" == "" then the question has not been answered

    as for merging the rtf output should not be to hard (do you mean like a report at the end of the questionnaire)

    but, you will need to save the the text to the database as rtf text "RichText.GetText" in order to keep any formatting so it might pay you to make a 2nd helper app to build the database,


    i,ll see if i can get a example to you (time permitting)
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Mar 2004
    Location
    Michigan
    Posts
    169
    I definitely like the idea of keeping it all in the database but didn't think I could keep formatting - plus I thought it would be an issue with the amount of text that could possibly be used for an answer.

    As far as the merging of the RTF output - that is simply for the ability to create the document with questions and answers and since I was holding the answers in separate files I needed to know how to combine all the individual files into one document. However, if the database will store formatted text as the answer (especially carriage returns between paragraphs) then I just need to know how to populate the rich text object with the items in the database and won't need to merge the individual files. Does that make sense?

    I would truly appreciate an example - if your time permits.

    So I guess my real needs are:

    How to populate a database field with formatted text and then how to populate a RTF object with the data in the database.

    Thanks for your help!! You already taught me that my doubt about the answers being able to be stored in the database is unwarranted - and I'm feeling a little more optimistic that this can work! ;D

    Sue

  4. #4
    Join Date
    May 2006
    Posts
    5,380
    well i dont know what the character limit is in a sqlite database but i have some stuff on sqlite (recipes, walkthroughs, etc) some must have 10.000+ characters, and the formatting should not be a problem as RTF formatting is just more text chars decoded by the rtf object (or word pad) just like a web browser dose with html,

    anyway, i'll get on to that example
    Open your eyes to Narcissism, Don't let her destroy your life!!

  5. #5
    Join Date
    Mar 2004
    Location
    Michigan
    Posts
    169
    Thanks RizlaUK!

    I'm looking forward to learning more about the RichText Object and how to work with it and SQLlite and AMS.

    Sue

  6. #6
    Join Date
    Mar 2004
    Location
    Michigan
    Posts
    169
    I've got the rich text box displaying the items from the database working - attached is an example - if anyone needs something similar.

    I haven't looked at the RTF formatting when data is added and retrieved from the database yet.

    Sue
    Attached Files

  7. #7
    Join Date
    May 2006
    Posts
    5,380
    sorry sue, i still havent had time to make that example, but it looks like you are half way there anyway
    Open your eyes to Narcissism, Don't let her destroy your life!!

  8. #8
    Join Date
    Dec 2007
    Location
    Netherlands
    Posts
    81
    Quote Originally Posted by sue View Post
    I've got the rich text box displaying the items from the database working - attached is an example - if anyone needs something similar.

    I haven't looked at the RTF formatting when data is added and retrieved from the database yet.

    Sue
    Hi Sue,

    One of the members of this forum TJ_Tigger has a lot of video tutorials about databases and AMS on his website: see http://www.tj-tigger.com/pub/TiggTV/TiggTV.html

    Hope this helps,
    Loes

  9. #9
    Join Date
    Mar 2004
    Location
    Michigan
    Posts
    169
    Thanks, RizlaUK, I understand. I'm making progress, albeit a little slow, it's still progress! ;D

    Dermot was very kind to share a rich text object example with bold, italic, etc. in a post the other day (Thanks, Dermot).

    But, if anyone has an example that includes font face and font size formatting I would love to see it !! Then I want to test posting and retrieving from database with font sizes and faces changes.



    Sue

  10. #10
    Join Date
    Mar 2004
    Location
    Michigan
    Posts
    169
    Thanks, Loes,

    I have acceptable database skills - my issues are more with the Rich Text object that's new in version 7.0 and interacting with it for formatting and databases.

    You're right, though, I've watched all of Tigger's video tutorials and I would recommend them to everyone!!

    Sue

  11. #11
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Hi Sue

    That example I sent you does let you choose the font face and size.
    Dermot

    I am so out of here

  12. #12
    Join Date
    Mar 2004
    Location
    Michigan
    Posts
    169
    Hmmmm, Dermot ....I'm not seeing it....

  13. #13
    Join Date
    Mar 2004
    Location
    Michigan
    Posts
    169
    I found it ..... I copied your stuff into a project I am doing and somehow missed that icon in the copy..... duh!!!

    Thanks for making me loook again!

    Sue


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts