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

Can you export from a Grid to excel ?

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

    #31
    Re: Can you export from a Grid to excel ?

    Steve;

    I tried your Demo, I keep getting error on page when I click the export button. I have more than one search field.
    Can you please take a quick look at the zipped test example and tell me what I'm doing wrong .

    Thanks

    Comment


      #32
      Re: Can you export from a Grid to excel ?

      Originally posted by Anis View Post
      Steve;

      I tried your Demo, I keep getting error on page when I click the export button. I have more than one search field.
      Can you please take a quick look at the zipped test example and tell me what I'm doing wrong .

      Thanks
      You would be better off contacting Steve Workings, who made that demo... (not the same Steve :D)

      Comment


        #33
        Re: Can you export from a Grid to excel ?

        How do you know we aren't the same person...

        The solution is to start simple, then work your way out towards what you want. Steve's demo is a simple search on a single table. You have a complex search on a View. Start with something as simple as Steve's example using your own table. Your demo does not produce a value for the session.searchstr, I don't know why. But you should include Steve's method to show the string on the screen so you can verify. Also you can render the filter blank in the export routine to eliminate filter problems. Finally, you have 10 export values, but you named them all Field1.
        Steve Wood
        See my profile on IADN

        Comment


          #34
          Re: Can you export from a Grid to excel ?

          Originally posted by Steve Wood View Post
          How do you know we aren't the same person...
          *Strokes non-existent beard....* ;)

          The solution is to start simple, then work your way out towards what you want. Steve's demo is a simple search on a single table. You have a complex search on a View. Start with something as simple as Steve's example using your own table. Your demo does not produce a value for the session.searchstr, I don't know why. But you should include Steve's method to show the string on the screen so you can verify. Also you can render the filter blank in the export routine to eliminate filter problems. Finally, you have 10 export values, but you named them all Field1.
          Steve's demo references a session variable in the A5W page that isn't initiated until later down the page in a component, maybe that is it? Also, there seem to be bugs in the import/export functions in the latest build of A5 which may be causing problems here too... not sure if it affects this though.

          Comment


            #35
            Re: Can you export from a Grid to excel ?

            I agree that simple is a good start, I thought if I search on one field only, it should be OK, where do you see the string on the page? I didn't pay attention to that.
            I realize the field names are wrong, but also I should qualify them with the table name probably.

            I'll take sometime to test it out and will post the results.

            Thanks

            Comment


              #36
              Re: Can you export from a Grid to excel ?

              Originally posted by Anis View Post
              where do you see the string on the page? I didn't pay attention to that.
              Around line 84 in the a5w page:
              Code:
              <%A5 ?"session.SearchStr = " + session.SearchStr %>
              This throws up this error:

              Code:
              500 Internal Server Error
              "Script Error
              Error:Script: /bcdecker/Demo_FilteredGrid2Excel.a5w line:80
              ? ; ?"session.SearchStr = " + session.SearchStr ;?Property not found 
              session.SearchStr subelement not found."
              I amended it by putting this at the top of the page:

              Code:
              <%a5
              If eval_valid("session.SearchStr") = .f. then
              	dim session.SearchStr as C
              	session.SearchStr = ""
              end if
              %>
              This fixes the problem and shows up like this (if you upload the customer.dbf table from the AlphaSports sample): http://www.charlesworth.biz/bcdecker...Grid2Excel.a5w

              It doesn't work however, but since there have been threads discussing problems with import and export in the latest build of A5V9 I suspect this may be due to that... It is certainly picking up the sort string correctly if you search for a name.

              Comment


                #37
                Re: Can you export from a Grid to excel ?

                I got it to work to the same point on my data also, but it still doesn't export.
                again we don't know if this is from the code or from the bug in A5.

                I got the search string to show and the data is filtering correctly on the set.

                Comment


                  #38
                  Re: Can you export from a Grid to excel ?

                  Has anyone been successful with the Excel export?

                  Here's what I'm using on Advanced Button:

                  Code:
                  report.saveas("rpt_PersonAddressGroup@[PathAlias.ADB_Path]\set_person_address_group.set","xls","","",session.session_folder +"PersonAddressGroup.xls",.f.)
                  response.redirect(session.session_url + "PersonAddressGroup.xls?" + time("hms03"))
                  I get the message:
                  "Exporting Reports to Excel is not supported in your version of Alpha Five. Please contact Alpha Software to purchase an upgrade."

                  To what version would I need to upgrade?

                  Thanks.

                  Alex

                  Comment


                    #39
                    Re: Can you export from a Grid to excel ?

                    Originally posted by steinmanal View Post
                    Has anyone been successful with the Excel export?

                    Here's what I'm using on Advanced Button:

                    Code:
                    report.saveas("rpt_PersonAddressGroup@[PathAlias.ADB_Path]\set_person_address_group.set","xls","","",session.session_folder +"PersonAddressGroup.xls",.f.)
                    response.redirect(session.session_url + "PersonAddressGroup.xls?" + time("hms03"))
                    I get the message:
                    "Exporting Reports to Excel is not supported in your version of Alpha Five. Please contact Alpha Software to purchase an upgrade."

                    To what version would I need to upgrade?

                    Thanks.

                    Alex
                    I don't think you can use sets on web apps, perhaps the error message just got mixed up? (I may very well be wrong there!)

                    What version have you got, then?
                    Last edited by NoeticCC; 05-12-2008, 04:47 PM.

                    Comment


                      #40
                      Re: Can you export from a Grid to excel ?

                      Thanks, Andrea.

                      The sets definitely work on web apps. I've used the same format with pdf format, rather than xls.

                      Note that I'm using version 8 - not version 9.

                      Comment


                        #41
                        Re: Can you export from a Grid to excel ?

                        Originally posted by steinmanal View Post
                        Thanks, Andrea.

                        The sets definitely work on web apps. I've used the same format with pdf format, rather than xls.

                        Note that I'm using version 8 - not version 9.
                        Ah, well that is why then - you can only export to Excel (in the same way you can export to PDF etc.) from V9 onwards...

                        Great to know about sets though, I was under the impression *nothing* to do with sets worked on WAS, so this is a bonus :)

                        Comment


                          #42
                          Re: Can you export from a Grid to excel ?

                          At last, I made some contribution to the forum - instead of always being a taker!

                          How does the export method you suggested (that only works in v9) differ from the one that Steve Workings posted in the v8 forum?

                          Thanks for everything.

                          Alex

                          Comment


                            #43
                            Re: Can you export from a Grid to excel ?

                            I never tried your method, but Steve's method didn't really work.
                            I got to the point the script will run fine but it never created the excel file.

                            Comment


                              #44
                              Re: Can you export from a Grid to excel ?

                              Originally posted by steinmanal View Post
                              At last, I made some contribution to the forum - instead of always being a taker!

                              How does the export method you suggested (that only works in v9) differ from the one that Steve Workings posted in the v8 forum?

                              Thanks for everything.

                              Alex
                              Steve's method exports data from a grid, the one I described above produces a formatted Excel spreadsheet based on an Alpha 5 report. The formatted export looks better, but it means you have to design a report and set up a dialog to let users select filters/parameters, rather than exporting grid data using the current grid search/filter criteria.

                              Comment


                                #45
                                Re: Can you export from a Grid to excel ?

                                I created a web page (see screen shot) That allow the user to select records by Salesman, year or both, or if they wish to print the whole report.
                                Then created the report list to pick from, but that is all PDF report, you can change that to make it XLS.
                                The reports are created on the desktop just like normal report, and the dialog box that you see has this code in the afterValidate event in properties:
                                -----------------------------------------------------------------------
                                salesman=alltrim(CurrentForm.Controls.Salesman)
                                year = CurrentForm.Controls.year
                                report= alltrim(CurrentForm.Controls.ReportList)
                                IF CurrentForm.Controls.Type = "1" then
                                dim filter as c
                                dim order as c
                                Filter = ".T."
                                Order = ""
                                Dim filename as c
                                filename = session.session_folder + "tempreport.pdf"
                                filename = report.saveas("Summary_by_month@[PathAlias.ADB_Path]\feed.ddd","pdf",filter,order,filename,.f.)
                                if file.exists(filename)
                                currentform.RedirectTarget = session.session_url + "tempreport.pdf?" + time("hms3")
                                end if
                                '-------------------------------------
                                else
                                IF CurrentForm.Controls.Type = "2" then
                                IF eval_valid("Salesman") = .f. Then
                                goto skipreport
                                end if
                                dim filter as c
                                dim order as c
                                Filter = "Wrr = \""+Salesman+"\""
                                Order = ""
                                Dim filename as c
                                filename = session.session_folder + "tempreport.pdf"
                                filename = report.saveas("Summary_by_month@[PathAlias.ADB_Path]\feed.ddd","pdf",filter,order,filename,.f.)
                                if file.exists(filename)
                                currentform.RedirectTarget = session.session_url + "tempreport.pdf?" + time("hms3")
                                end if
                                else
                                IF CurrentForm.Controls.Type = "3" then
                                IF eval_valid("year") = .f. Then
                                goto skipreport
                                end if
                                dim filter as c
                                dim order as c
                                Filter = "(Wstyear_ = "+year+" )"
                                Order = ""
                                Dim filename as c
                                filename = session.session_folder + "tempreport.pdf"
                                filename = report.saveas("Summary_by_month@[PathAlias.ADB_Path]\feed.ddd","pdf",filter,order,filename,.f.)
                                if file.exists(filename)
                                currentform.RedirectTarget = session.session_url + "tempreport.pdf?" + time("hms3")
                                end if
                                else
                                IF eval_valid("salesman") = .f. .or. eval_valid("year") = .f. Then
                                goto skipreport
                                end if
                                dim filter as c
                                dim order as c
                                Filter = "(Wrr = \""+salesman+"\" ) .or. (Wstyear_ = "+year+" )"
                                Order = ""
                                Dim filename as c
                                filename = session.session_folder + "tempreport.pdf"
                                filename = report.saveas("Summary_by_month@[PathAlias.ADB_Path]\feed.ddd","pdf",filter,order,filename,.f.)
                                if file.exists(filename)
                                currentform.RedirectTarget = session.session_url + "tempreport.pdf?" + time("hms3")
                                end if

                                skipreport:
                                end if
                                end if
                                end if
                                -----------------
                                and on the Type choices you define the 4 choices:
                                All|1
                                selectedsalesman|2
                                selected year|3
                                selected salesman & year|4
                                -------------------

                                Comment

                                Working...
                                X