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

Excel 2003, 2007 Office Class issues, errors

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

    Excel 2003, 2007 Office Class issues, errors

    My export via AlphaDAO and my Modification code works on my system using Microsoft Excel Starter 2010 (I like using the least robust program

    to try and make sure that what I create will be compatible with whatever my clients have). The computer I am trying to get the code to work on has Excel 2007.

    I believe (correct me if wrong) that seeing the entire code is unnecessary as the errors/omissions occur prior to any code running other than the

    connections to Excel. The error in exporting is strange (only one of two sheets) as I have created code both ways using AlphaDAO export to 2003

    and 2007 Excel and the only code difference is within the connectionString.


    I tried with .xls and .xlsx
    I tried dim Doc as Office::ExcelDocument and dim Doc as Office::Excel2003Document
    above with ALL permutations...only listing the ones that are not obviously incorrect (I think!)
    '=======================================================================================
    Alpha DAO export connection:

    Excel_tbl is the variable with the full path of the file and the strings were created by Alpha and work on my system.

    connectionString = "{A5API='Excel',A5Syntax='Excel',FileName="+Excel_tbl+", A5ExcelVersion=2007}"
    OR
    connectionString = "{A5API='Excel',A5Syntax='Excel',FileName="+Excel_tbl+", A5ExcelVersion=2003}"
    '=========================================
    Excel Modification code:

    'only one of the Doc as Office::..... used of course at any given test

    dim Doc as Office::ExcelDocument 'used for 2007
    'dim Doc as Office::Excel2003Document
    dim Sheet as Office::Spreadsheet

    dim SheetName as c = ""
    SheetName=alltrim(var->sh_name) 'sh_name is the variable that has the sheet name...verified to be what is produced by the export

    'Excel_pth is a variable for the full path obtained via a function argument that has the Modification code...and is exactly the same as the AlphaDAO connection string path.

    if Doc.Load(Excel_pth)

    if Doc.FindSheet(Sheet,SheetName)

    '==================================================
    ERRORS:

    When creating .xlsx and A5ExcelVersion=2007 and using Office::Excel2003Document --well, obviously didn't (and shouldn't) work! and did not

    include the other permutations that should not work

    '--------------------------------------------------------------------------------------------------------------
    When creating .xls and A5ExcelVersion=2003 and using Office::Excel2003Document -- Only creates one sheet(instead of two) and the

    modification code brings up an error when getting to: dim Doc as Office::Excel2003Document. The error is "Type is not defined"

    '--------------------------------------------------------------------------------------------------------------

    When creating .xls and A5ExcelVersion=2007 and using Office::ExcelDocument -- Only creates one sheet(instead of two) and the modification code cannot find the SheetName....and have tried using both versions of Doc...Excel2003Document and ExcelDocument.
    But without having both sheets the Modification code is not the first concern here...just the creation of only one sheet...if this is the way to approach this issue then there are two issues most likely.

    '--------------------------------------------------------------------------------------------------------------
    When creating .xlsx and A5ExcelVersion=2007, and using Office::ExcelDocument -- goes to Doc.FindSheet(Sheet,SheetName) and does not

    find it. I have verified that the Sheet name is correct (and have used and not used alltrim() on the Sheet name. I noticed that the 2007 version has

    [Compatibility mode] as part of the spreadsheet title....and added that as well which did not help.

    This makes sense in that eliminating the Excel Modification code and opening up the Excel file an error comes up that either the file is corrupt or

    that the file extension does not match the format of the file. This appears to be the main issue and think if this is fixed that my modification code

    will work.

    '===========================================================

    One out of the last three should work....just don't know which one I should concentrate on and what to try next in any of them.


    Let me know of any additional information wanted...entire code is no problem but think it would confuse what I believe to be the main issues.
    Last edited by MikeC; 02-28-2019, 02:55 PM.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




    #2
    Re: Excel 2003, 2007 Office Class issues, errors

    darn it. Mistake on issue of the second to last one:
    When creating .xls and A5ExcelVersion=2007 and using Office::ExcelDocument -- Only creates one sheet(instead of two) and the modification code cannot find the SheetName....and have tried using both versions of Doc...Excel2003Document and ExcelDocument.
    But without having both sheets the Modification code is not the first concern here...just the creation of only one sheet...if this is the way to approach this issue then there are two issues most likely.
    Should have been ....and the modification code cannot find the Doc.Load(Excel_pth) INSTEAD of "and the modification code cannot find the SheetName ". Path name definitely the same according to the debugger...and was trimmed.

    sorry about the mixup---and thought I was being careful and thorough!
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


      #3
      Re: Excel 2003, 2007 Office Class issues, errors

      Well,

      Narrowed down one of the issues a bit.

      The issue of not creating the two sheets (tabs) is due to some syntax that Excel 2007 does not accept or that Alpha is not doing as it is supposed to do---yet works fine on my computer.

      The sheet for the first table is created but not the second...this even happens when I reverse the order of the sheet creation so it is like the code for the second sheet is simply being ignored by either Alpha or Excel.

      The code is as follows.

      Code:
      FUNCTION Exp_SalesbyRep AS C (suffix as C="")
      ''Description:shared variable Excel_tbl is Full Path name
      
      if suffix=""
      	suffix="_"+time("yyyyMMdd__h_0m_0sam")
      end if
      
      dim shared Excel_tbl as C=""
      Excel_tbl=rtrim(var->vPath,chr(92))+chr(92)+"SalesByRep"+suffix+".xls"
      
      dim connectionString as c 
      
      connectionString = "{A5API='Excel',A5Syntax='Excel',FileName="+Excel_tbl+", A5ExcelVersion=2003}" 
      delete options 
      dim options as p 
      options.ConsolidateArguments= .t.
      options.ShowProgress= .t.
      options.AllowCancel= .f.
      options.TableNamePrefix = ""
      
      delete a_export
      dim a_export[0] as p 
      
      a_export[].LocalTableName = "sales_rep_excel.dbf"
      a_export[..].TargetTableName = "Sales_by_Rep_Summary"
      a_export[..].TargetTableOwner = ""
      a_export[..].ExportFields = "" '<<%txt%
      'Manager
      'Amount
      '%txt%
      a_export[..].Filter = ""
      a_export[..].Order = "invert(Amount)"
      a_export[..].QueryFlags = ""
      a_export[..].Arguments = ""
      a_export[..].ExportType = "Create new table"
      'CREATE TABLE sales_rep_excel
      a_export[..].CreateTableSQL = <<%txt%
      CREATE TABLE Sales_by_Rep_Summary
      (
      Manager	 text,
      Amount	 Number)%txt%
      a_export[..].DropExistingTable = "Yes"
      a_export[..].AppendFieldMap = ""
      
      a_export[].LocalTableName = "sales_cust_collection.dbf"
      a_export[..].TargetTableName = "Sales_by_Rep_Detail"
      a_export[..].TargetTableOwner = ""
      'Name
      a_export[..].ExportFields = <<%txt%
      Customer
      Job
      Txntype
      Date
      Creation_Dt
      Refnumber
      Memo
      Location
      Manager
      Item
      Amount
      %txt%
      a_export[..].Filter = "Date>=Var->vdgStart_Date.AND.Date<=Var->vdgEnd_Date"
      a_export[..].Order = "alltrim(left(Manager,100))"
      a_export[..].QueryFlags = ""
      a_export[..].Arguments = ""
      a_export[..].ExportType = "Create new table"
      
      a_export[..].CreateTableSQL = <<%txt%
      
      CREATE TABLE Sales_by_Rep_Detail
      (
      Customer	 text,
      Job	 text,
      Txntype	 text,
      [Date]	 date,
      Creation_Dt	 date,
      Refnumber	 text,
      [Memo]	 memo,
      Location	 text,
      Manager	 text,
      Item	 text,
      Amount	 Number)%txt%
      a_export[..].DropExistingTable = "Yes"
      a_export[..].AppendFieldMap = ""
      
      dim flagSilent as l
      flagSilent = .t.
      delete p 
      dim p as p 
      dim args as sql::arguments
      p = a5_AlphaDAO_Export(connectionString,a_export,options,flagSilent,args)
      
      END FUNCTION
      I have also removed the suffix variable and it made no difference. Have changed the DropExistingTable to all variations of "Yes" and "No" with no difference. I also noticed that the second sheet CreateTable fields have a tab in some of them...have removed these and makes no difference--and the debugger shows the correct syntax with just a single space between the name and the type.

      I also created a separate script that only ran the second table with a single sheet and it does not create the file....and also brings up an error that says the CreateTable is the incorrect syntax. This is the key I think but cannot see anything incorrect in the code above and the debugger shows the syntax to be the same as the first table.

      Is there anything I am missing?


      EDIT: The client is using Runtime and is the same build as what I am developing in...suppose there still could be a discrepancy between the two???
      Last edited by MikeC; 03-02-2019, 07:34 PM. Reason: Additional possible cause
      Mike
      __________________________________________
      It is only when we forget all our learning that we begin to know.
      It's not what you look at that matters, it's what you see.
      Henry David Thoreau
      __________________________________________



      Comment


        #4
        Re: Excel 2003, 2007 Office Class issues, errors

        Question.
        You say it works on your machine. Is that in Dev AND RT versions?
        See our Hybrid Option here;
        https://hybridapps.example-software.com/


        Apologies to anyone I haven't managed to upset yet.
        You are held in a queue and I will get to you soon.

        Comment


          #5
          Re: Excel 2003, 2007 Office Class issues, errors

          Hi Ted,
          It was good that you made me double check myself. For many years I always ran the Runtime patch on client's computers as part of the install...somewhere down the line I stopped and so the Runtime builds do not match. Assumptions are a programmer's nightmare. On my computer I had the same issue of only creating one sheet. Ran the Runtime patch and it fixed it on MY computer...however the patch did not cure the issue on the client's computer.

          BUT my Modification does work on the sheet that it did produce which means that I now only have the single issue of not being able to produce the second sheet.

          Thanks for your help.
          Mike
          __________________________________________
          It is only when we forget all our learning that we begin to know.
          It's not what you look at that matters, it's what you see.
          Henry David Thoreau
          __________________________________________



          Comment


            #6
            Re: Excel 2003, 2007 Office Class issues, errors

            I recreated the AlphaDAO export for just the table that would not export on my development Alpha and made it into a script. When I ran it on my client's Runtime, an error was produced that showed me the issue...why no error when ran for two tables is hard to reason why. It showed that I had a missing field in the Runtime table that was being exported. Added the field and no issues.

            So apparently there were two issues...and really hard to figure out when errors are not produced!!

            I must thank you again Ted for making me double-check my Runtime version as I would not have otherwise and that is what fixed my Modification code.
            Mike
            __________________________________________
            It is only when we forget all our learning that we begin to know.
            It's not what you look at that matters, it's what you see.
            Henry David Thoreau
            __________________________________________



            Comment


              #7
              Re: Excel 2003, 2007 Office Class issues, errors

              I just wanted to add one more bit of information.

              Not everyone has the issue of corruption when using ExcelDocument for .xlsx instead of using Excel2003Document for .xls but I have. It very well could have been a bug that was fixed later than the A5v11 build I have (I cannot get a higher build). The link below mentions the same thing. But due to clients still using even 2003 Excel I am glad that this issue is not the reverse...well at least until 2003 cannot be used with later Excel versions, but will cross that bridge when I come to it.

              https://forum.alphasoftware.com/show...Doc.SaveToBlob
              Mike
              __________________________________________
              It is only when we forget all our learning that we begin to know.
              It's not what you look at that matters, it's what you see.
              Henry David Thoreau
              __________________________________________



              Comment


                #8
                Re: Excel 2003, 2007 Office Class issues, errors

                Did you put the final Patch on Mike?
                See our Hybrid Option here;
                https://hybridapps.example-software.com/


                Apologies to anyone I haven't managed to upset yet.
                You are held in a queue and I will get to you soon.

                Comment


                  #9
                  Re: Excel 2003, 2007 Office Class issues, errors

                  I can only go up to v11 3381 Build 4096 so is not the latest version of v11 as that is when my ability to update ends.
                  Mike
                  __________________________________________
                  It is only when we forget all our learning that we begin to know.
                  It's not what you look at that matters, it's what you see.
                  Henry David Thoreau
                  __________________________________________



                  Comment


                    #10
                    Re: Excel 2003, 2007 Office Class issues, errors

                    Yes, that was the last patch.

                    From the Alpha site;
                    "The current Alpha Five Version 11 build is 3381_4096 (released on 22 MAR 2013 09:00 AM)."

                    After that, you are into V12 if you want any upgrades to the DT. Unfortunately you get the Web "bloat" as well, so I haven't bothered.
                    See our Hybrid Option here;
                    https://hybridapps.example-software.com/


                    Apologies to anyone I haven't managed to upset yet.
                    You are held in a queue and I will get to you soon.

                    Comment


                      #11
                      Re: Excel 2003, 2007 Office Class issues, errors

                      From the Alpha site;
                      "The current Alpha Five Version 11 build is 3381_4096 (released on 22 MAR 2013 09:00 AM)."
                      I'm using Build 3788, Addins Build 4187 which was a pre-release. I believe there was a newer pre-release after that.
                      I have been using 3788 for years and it has proven to be very stable.
                      Alpha 5 Version 11
                      AA Build 2999, Build 4269, Current Build
                      DBF's and MySql
                      Desktop, Web on the Desktop and WEB

                      Ron Anusiewicz

                      Comment


                        #12
                        Re: Excel 2003, 2007 Office Class issues, errors

                        Good info Ron.
                        I will explore.
                        See our Hybrid Option here;
                        https://hybridapps.example-software.com/


                        Apologies to anyone I haven't managed to upset yet.
                        You are held in a queue and I will get to you soon.

                        Comment


                          #13
                          Re: Excel 2003, 2007 Office Class issues, errors

                          But then again....
                          The link to V11 patches has disappeared. Anyone have a clue where to get them now?

                          Edit.
                          Found the patch as I had downloaded but not applied it.
                          Also have the RT patch, but that doesn't update the version.
                          Now on 3788 as a production version, so testing an RT version using the different Dev version will be fun.

                          The instructions do clearly say - in red - not to use in production. I remember asking if this was ever going to be approved, but got no reply from Alpha.
                          Still if Ron is using it successfully, I will give it a go.
                          Last edited by Ted Giles; 03-07-2019, 05:03 AM.
                          See our Hybrid Option here;
                          https://hybridapps.example-software.com/


                          Apologies to anyone I haven't managed to upset yet.
                          You are held in a queue and I will get to you soon.

                          Comment

                          Working...
                          X