Merging Cuteditor text with sql server db

Last post 12-18-2006, 11:57 PM by JFRanger. 3 replies.
Sort Posts: Previous Next
  •  11-20-2006, 6:05 AM 24414

    Merging Cuteditor text with sql server db

    Hello,

    I'd like to know if it is possible to do something similar to a mail merge between the text in Cuteditor and my data saved in sql server.

    Basically let's say that I wanted to create a Customer's address label with Cuteditor and then print it off many times merging it with data coming from a database, how do I do insert the data coming from a database into the Cuteditor text ?

    thank you much

    Edward

  •  11-20-2006, 12:15 PM 24426 in reply to 24414

    Re: Merging Cuteditor text with sql server db

    Edward,
     
    >>how do I do insert the data coming from a database into the Cuteditor text ?
     
    Just get the data from your database first and pass it to editor.
     
    For example:
     
    <%
           dim content
           'Get the data from your database here.
           content = ............ 
           Dim editor
           Set editor = New CuteEditor
           
           editor.ID = "Editor1"
           editor.Text = content
           editor.Draw()
     %>
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  11-20-2006, 3:56 PM 24451 in reply to 24426

    Re: Merging Cuteditor text with sql server db

    that is good!
     
    Next question on the same topic, what if I want to let the person designing the label, (hence the person who is using cuteditor) decide where graphically to place the name, address, etc. etc. fields on the editor. Would it be possible to have new icons called ADDRESS, NAME, ZIP etc. showing on the editor toolbar, so that I can get the data from the db and place it where these labels are places by the user?
     
    Much appreciated.
     
    Edward
    Australia
  •  12-18-2006, 11:57 PM 25216 in reply to 24451

    Re: Merging Cuteditor text with sql server db

    Well I did something that's working fine...
     
    I've added a LEGEND with CUSTOM FIELDS variables to my users i.e: [name] [email] [phone]
     
    My users create there templates like this...

    Hello [name], you are subscribe to this newsletter with the email [email] and your phone number is [phone]!

    And after you do a "replace function" like this...

     
    myHtmlStr =rs("htmlContent")
    myHtmlStr = replace(myStr,"[name]",rs("name"))
    myHtmlStr = replace(myStr,"[email]",rs("email"))
    myHtmlStr = replace(myStr,"[phone]",rs("phone"))

    ... ' and now send the html file via email in html format

    CALL SendMail("My Business",[email protected],"Dec. newsletter",rs("email"), rs("name"), myHtmlStr )

    Et voilà!
View as RSS news feed in XML