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

Is it possible to add a calculated field in a exported excel file

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

    Is it possible to add a calculated field in a exported excel file

    I have a collection of grids that has a login. After a user is logged in they will only see their information that also has reports linked on the local filter. What i would like to do now is allow them to download the report
    in excel make a change and have the other fields auto-calculate and re-upload the excel file with the information populating to the grid. However, feel free to advise any better way to accomplish what i would like to do.
    Also is there any way to add information from an excel file having it clear the information that is already in grid first instead off duplicating. I am new to alpha five without any knowledge of coding but any help would be greatly appreciated.

    #2
    Re: Is it possible to add a calculated field in a exported excel file

    Hello Alex,
    This video shows how you can export a report to excel including live formulas.
    http://www.youtube.com/watch?v=jo5fjO8jaEc
    I hope this helps,
    Javier

    Comment


      #3
      Re: Is it possible to add a calculated field in a exported excel file

      Thank you very much that is just what i needed. However, how about my second question. How do you have a grid erase its content and update with the new content that would be updated by uploading the excel spread sheet.

      Comment


        #4
        Re: Is it possible to add a calculated field in a exported excel file

        Are you using dbf or SQL? If the latter, I would accomplish this by creating/running a delete query:

        To create the code:
        >From the main control panel, select 'code'
        >then 'new'
        >Script (Using Action Scripting)
        >Add New
        >SQL (using Alpha ADO)
        >Execute DELETE query on an SQL database

        Then insert the code created above in the appropriate client-side event in the grid.

        Comment


          #5
          Re: Is it possible to add a calculated field in a exported excel file

          I am using SQL and thank you for your response. With this code would it take place automatically once i upload the new excel spread sheet or would i have to delete before uploading the excel document.

          Comment


            #6
            Re: Is it possible to add a calculated field in a exported excel file

            I think you will have to use Alpha's import methods to get the updated Excel data into your SQL table.
            Peter
            AlphaBase Solutions, LLC

            [email protected]
            https://www.alphabasesolutions.com


            Comment


              #7
              Re: Is it possible to add a calculated field in a exported excel file

              Originally posted by Scott B View Post
              Are you using dbf or SQL? If the latter, I would accomplish this by creating/running a delete query:

              To create the code:
              >From the main control panel, select 'code'
              >then 'new'
              >Script (Using Action Scripting)
              >Add New
              >SQL (using Alpha ADO)
              >Execute DELETE query on an SQL database

              Then insert the code created above in the appropriate client-side event in the grid.
              Or a truncate - depending on if it's single user or not - and other circumstances.
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              http://www.iadn.com/images/media/iadn_member.png

              Comment


                #8
                Re: Is it possible to add a calculated field in a exported excel file

                Alex,

                You can use Scott's suggestion only if you are going to run this manually using Alpha Five Developer. Those 'code SQL' features, and the underlying xbasic they produce, are only usable on Desktop. Importing into an SQL table can be tricky because you often have to convert 'Excel' format in to SQL table format. For instance, your Excel might produce a 'Y' to mean Yes, but you want that to be a 1 in your table, meaning True. Or, Excel might produce an empty string to mean 'empty' whereas you specifically need your SQL table value to state NULL.

                Yes you have to upload the file first. If you use the method I show below, you will upload the CSV output of your Excel file, not the XLS(x) file.

                The fastest import method is to use LOAD DATA (mysql) or BULK INSERT (mssql). If you use multiple INSERT statements, it can take forever on a big file.

                Example Import CSV using LOAD DATA (minus some error checking)
                '==assumes CSV file has been uploaded
                dim cn as sql::Connection
                dim rs as sql::ResultSet
                dim args as sql::Arguments
                cn.open("::name::conn")

                '==get defaults
                fldr = "c:\mydata" + chr(92)
                fldr = stritran(fldr,"\\","\\\") '== required for server path

                '==purge table, ignore "not found" errors
                vsql = "DELETE FROM mytable"
                if cn.execute(vsql) = .f.
                if contains(cn.callresult.text,"could not find the data you requested")=.f.
                '==use code to write an error message to a log. Include cn.callresult.text in the output
                end if
                end if

                '==perform import
                vSQL = <<%longstring%
                LOAD DATA INFILE '{fldr}myfile.csv' INTO TABLE mytable
                FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
                LINES TERMINATED BY '\r\n'
                IGNORE 1 LINES
                (ID,@Variable1,@within1,@NULL1)
                set
                within1 = IF(@within1='',0,@within1),
                null1 = IF(@null1='Y',1,0),
                variable1 = UPPER(@variable1)
                ;
                %longstring%
                vSQL = evaluate_string(vSQL)
                if cn.execute(vSQL) = .f.
                '==use code to write an error message to a log. Include cn.callresult.text in the output
                end if

                cn.close()
                Steve Wood
                See my profile on IADN

                Comment

                Working...
                X