Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

ActiveX = OLE object?

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

    ActiveX = OLE object?

    I'm looking at the help to try and embed an Excel spreadsheet on a form. I tried to insert several of the Excel OLE objects and no matter which I choose I get:

    Can't insert OLE object: comm

    Is something missing in my v11 app? Or is something amiss in my 2003 Excel?
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

    #2
    Re: ActiveX = OLE object?

    Open Excel first. Go back to Alpha and insert the ole object.
    There can be only one.

    Comment


      #3
      Re: ActiveX = OLE object?

      Thanks Stan, I'll try that.
      Robin

      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

      Comment


        #4
        Re: ActiveX = OLE object?

        OK tried that and got a spreadsheet to appear, but I was hoping to link to an existing spreadsheet and it seems like too much for me to be able to do.

        So - Stan, if you are here; how would you go about creating a spreadsheet that lists the fields in one column and the data in another instead of in the normal row format like you get with an export? Cause that's what I need to create with my Alpha data - one record at a time.
        Robin

        Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

        Comment


          #5
          Re: ActiveX = OLE object?

          I was hoping to link to an existing spreadsheet
          When the ole opens you see an empty spreadsheet? You can open an existing spreadsheet and copy/paste into the ole'd object. Close the existing and the ole'd .

          Is that sufficient?
          There can be only one.

          Comment


            #6
            Re: ActiveX = OLE object?

            I'll try that - tomorrow, thanks
            Robin

            Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

            Comment


              #7
              Re: ActiveX = OLE object?

              You might also try opening Excel to the document you want to link. I haven't used the functionality in a while and that seems like what worked best.
              There can be only one.

              Comment


                #8
                Re: ActiveX = OLE object?

                Originally posted by MoGrace View Post
                how would you go about creating a spreadsheet that lists the fields in one column and the data in another instead of in the normal row format like you get with an export? Cause that's what I need to create with my Alpha data - one record at a time.
                Are you meaning that you want to produce a two column spreadsheet - one column containing the table field names and the second column the field value - for one record. And you want to generate one spreadsheet with that two column configuration for every record in the table? If that's what you want... no problem, a temporary table and a little coding and it's as good as done. If that's not what you are looking for, then maybe an example of the table data and the resulting spreadsheet you wish to make would help.
                Last edited by Mike Wilson; 04-22-2015, 07:04 PM.
                Mike W
                __________________________
                "I rebel in at least small things to express to the world that I have not completely surrendered"

                Comment


                  #9
                  Re: ActiveX = OLE object?

                  Yes Mike that was the idea. I have a PDF editor / form filler program that will import from an Excel or .csv file - so i'm trying to get it working on a pdf file that is otherwise not editable. At this rate I will probably just go back to my old way of scanning the file as an image and laying my fields on top.

                  Unless of course you can give me a hint or two...!
                  Robin

                  Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                  Comment


                    #10
                    Re: ActiveX = OLE object?

                    Should do it.

                    Code:
                    tdir = FILE.TEMP_PATH_GET()
                    table.create_begin("fieldname","c",30)
                    table.field_add("fieldvalue","c",30)
                    desttbl = table.create_end(tdir+chr(92)+"sample.dbf")
                    srctbl = table.open("atest")
                    flds = srctbl.field_name_get()
                    srctbl.fetch_first()
                    while .not. srctbl.fetch_eof()
                    	
                    for each foo in flds
                    	desttbl.enter_begin()
                    	desttbl.fieldname = foo.value
                    	desttbl.fieldvalue = convert_type(eval("srctbl."+foo.value),"C")
                    	desttbl.enter_end()
                    next
                    
                    srctbl.fetch_next()
                    end while
                    srctbl.close()
                    desttbl.close()
                    file_add_to_db(tdir+chr(92)+"sample.dbf")
                    This creates the fieldname - fieldvalue table for any srctbl = table............

                    The export is then routine.
                    There can be only one.

                    Comment


                      #11
                      Re: ActiveX = OLE object?

                      Thanks Stan, I'll give it a try!
                      Robin

                      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                      Comment


                        #12
                        Re: ActiveX = OLE object?

                        Did some testing.

                        tdir = FILE.TEMP_PATH_GET()
                        table.create_begin("fieldname","c",30)
                        table.field_add("fieldvalue","c",30)
                        desttbl = table.create_end(tdir+chr(92)+"sample.dbf")

                        This creates a new table each time and wipes out the support files Alpha would create should you define an export. You would need to save the export xbasic and use that. Alternatively create your own destination table and remove that section of the code, zapping the destination table at the beginning of the code.
                        There can be only one.

                        Comment


                          #13
                          Re: ActiveX = OLE object?

                          This is a test form I made to help me visualize what I am trying to do - I filled in the table by copying and pasting the data - which I am sure could be scripted with a push of a button. However that is easier said than done since I have 4 tables in this set. So I thought perhaps an array could capture the data displayed on the left side of the form and then fetch thru the table on the right and change those records. This is the part that is causing me some trouble since I have to fetch thru both the array and the table. Initially I have to produce 30 forms, but after that it will only be one at a time for each new hire.

                          testexcel.jpgdlse_rep.jpg
                          Robin

                          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                          Comment


                            #14
                            Re: ActiveX = OLE object?

                            Here is my first try...

                            Code:
                            dim hdr as p
                            dim tbl as p
                            dim lst as c
                            dim newlst as c
                            dim ix as n = 1
                            dim tName as c
                            dim tData as c
                            hdr = table.current() 
                            tbl = table.get("dlse_tmp")
                            
                            lst = topparent.Child_Enum("t;f=field")
                            cnt = line_count(lst)
                            newlst = *for_each(foo,eval("topparent:"+foo+".value"),lst)
                            DELETE arr
                            dim arr[cnt] as c
                            arr.initialize(newlst)
                            [COLOR="#FF0000"]'This is working Ok now[/COLOR]
                            tbl.fetch_first()
                            while .not. tbl.fetch_eof()	
                            	tbl.change_begin()
                            		tbl.FIELD_DATA = arr[ix]
                            		[COLOR="#0000FF"]tName = tbl.field_name    'this is just to output to the trace window
                            		tData = tbl.field_data
                            		Tln(tName,tdata)[/COLOR]
                            	tbl.change_end(.t.)	
                                    ix = ix+1
                                    tbl.fetch_next()
                            end while	
                            
                            NEXT
                            Being the dumbest person in the room is humbling. The FOR...NEXT seemed like a good idea at the time.
                            Last edited by MoGrace; 04-24-2015, 12:37 PM. Reason: figured out why it didn't work!
                            Robin

                            Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                            Comment


                              #15
                              Re: ActiveX = OLE object?

                              Working Ok is a bit subjective given this is the data from newlst:

                              ?newlst
                              = Gutierrez, Elias
                              {04/01/2015}
                              S. K. Knits, Inc.
                              1745 Chapin Rd., Montebello, CA 90640
                              (323) 890-9080
                              9
                              13.5

                              Friday
                              Insurance Company Of The West
                              P. O. Box 85563, San Diego CA 92186-5563
                              (877) 442-9669
                              WVE-5029819-00
                              Robin Quinn
                              Elias Gutierrez
                              {04/21/2015}
                              {04/21/2015}


                              The source table is passing numeric and date values to a string and the target fields are all character. How can I manipulate the string before I initialize the array so I can display those fields properly as text when they are exported to Excel? Or should I try a CSV file instead?

                              Hmmm...

                              EDIT: Well that was easy to fix - I passed the 'foo.text' instead of the 'foo.value'
                              Last edited by MoGrace; 04-24-2015, 10:58 PM.
                              Robin

                              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                              Comment

                              Working...
                              X