Andromo - Start Making Apps - Free Signup

Announcement

Collapse
No announcement yet.

A simple database and printing??

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • A simple database and printing??

    I was wandering if there is a way to save a simple letter and have someone enter their info on one screen then print that info on the letter. I.E - %FirstName%, %Address%, etc.
    Then is it possible to save this info into some sort of simple database?

    I tried downloading the simple print example zip file but it will not compile for me in 5.0

    I would even be glad to pay someone if they could do this, or get me going on doing this, fairly quickly.

    Patrick
    I don't mind showing up for work. It's them expecting me to stay for 8 hours that's causing the problem...

  • #2
    Why don't you save it into the Registry?

    You can always read it...

    Comment


    • #3
      well..

      I think that would be the best way but I am not sure how to go about this....
      Can someone show me how to do this?
      I would be glad to pay someone if they could show me in detail...

      I called IndigoRose and they said someone there could tell me if this could be done. I was told to post it on this board and they would answer.

      Patrick
      I don't mind showing up for work. It's them expecting me to stay for 8 hours that's causing the problem...

      Comment


      • #4
        Hi, I'm not sure about saving letters but these are great actions for saving and retrieving small amounts of data too:

        http://www.indigorose.com/webhelp/am....SaveValue.htm

        http://www.indigorose.com/webhelp/am....LoadValue.htm

        Perhaps if you could explain what you are trying to do in detail, I could offer something more.

        Corey Milner
        Creative Director, Indigo Rose Software

        Comment


        • #5
          Letters

          What I am trying to accomplish iis the ability to input a small amount of data on the main screen. i.e -name, address, etc.
          Then print that data on a saved letter so it looks like you wrote the letter to somneone perosnally.

          I would also like to be able to save that custom fields (name, address etc) to retrieve it later.
          A simple database connecton would work fine for that I think.

          From what I have seen, it should be able to be done in autoplay but I am just not sure how to go about it.

          The sample print program zip file you have posted on the forum is pretty close to what I am looking to do (or at least a step in that direction) but I could not get it to comple in 5.0 for me...

          I guess all in all it would take:
          a simple database or way to save info
          The ability to print a 1 page simple letter with 4 or so custom fields.
          I don't mind showing up for work. It's them expecting me to stay for 8 hours that's causing the problem...

          Comment


          • #6
            Hi. Your best bet is to create an HTML page on the fly and print that. As for storing your data there are a variety of choices, a good place to start would be to check out the actions listed above.

            Corey Milner
            Creative Director, Indigo Rose Software

            Comment


            • #7
              Here's a small sample that replaces elements in an HTML file, and shows the letter. I didn't do anything with the database side of this that you're wanting, but it should give you a good start.
              Attached Files

              Comment


              • #8
                I'd store the data in a lua file...

                Basically create a .txt file that has the actions to create an AMS table.
                Load that file at program start
                Then modify the AMS table as you add/change the data
                At program close, save the data back out to the lua table

                The letter itself I'd build dynamically in HTML. Simply build the HTML file with variables for the objects that you want to change.

                When you go to print you write that out to a temp location replacing the variables with the current values and excecute a wweb object print action.

                Comment


                • #9
                  Couldn't resist...

                  Here's worms app modified to load in a table from a text file at start and to save new names/address back to the text file and table every time you Show the letter.

                  Click the up arrow and select a name to populate the name and address from the database (table)
                  Attached Files

                  Comment


                  • #10
                    Neat Concept KP.

                    Deep Thinker, you are!

                    Comment


                    • #11
                      This will format your Address with the carriage return and line feeds.

                      Replace the last bit of code in the button with this:
                      Code:
                      strHTML = TextFile.ReadToString("Autoplay\\docs\\template.html")
                      strHTML = String.Replace(strHTML, "~NAME~", strName, false);
                      strAddress  = String.Replace(strAddress,"\r\n","<BR>",false);
                      strHTML = String.Replace(strHTML, "~ADDRESS~", strAddress, false);
                      strHTML = String.Replace(strHTML, "~AK_EDIT~", String.Replace(_SourceFolder .."\\autoplay\\docs\\","\\","/",false), false);
                      TextFile.WriteFromString(_TempFolder .. "\\letter.html", strHTML, false);
                      Page.Jump("page2");

                      Comment


                      • #12
                        Worm,

                        I figured you'd catch that ... I was being lazy.

                        Of course just that code doesn't fix the database actions...

                        Here's the whole project again with both Worms carriage return fix and a database substitution to handle the carriage returns.

                        I also commented all the code as it is getting a bit messy to follow
                        Attached Files

                        Comment


                        • #13
                          Geez, I didn't even see that the database wasn't grabbing the line breaks. I never put more than one line of text in the multi line text box when I built the example, so I never thought about the address not showing properly until I looked at it with your DB add-on. Sorry, had I seen it, I'd have added it to your code too.

                          And how dare you say that our code is messy.

                          Comment


                          • #14
                            BTW Patrick6, if you do end up using the little RTF Text Editor, please be sure to read the license.txt or visit AKwebtools and read throught their licence agreement.

                            Comment


                            • #15
                              Just my part is messsy...

                              In fact on line 16 of the button code I goofed... it should be:

                              CurrentCount = ListBox.GetCount("Name ListBox");

                              Comment

                              Working...
                              X