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

Newbie here looking for Help with Reports

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

  • Newbie here looking for Help with Reports

    I need a simple A5 page to build an .xml report, and drop it on a local share. I have the report written, but it is accessing a 16 million record database. I want to have 3 pull down combo boxes that have Store, Chain, and product category listed and a simple button to run the report. When the button is pressed it would call the save report function via xbasic, and only pull the 7,000 records from the DB I am looking for, and build the report on that. I have tried using filter expressions in the xbasic call, but it still seems to want to pull the entire 16 million records down before it will build the report, causing my system to time out, and take to long to process. Thanks for the help ahead of time.

  • #2
    Re: Newbie here looking for Help with Reports

    What type of database is it? (SQL or Alpha)

    Comment


    • #3
      Re: Newbie here looking for Help with Reports

      Sql 2008

      Comment


      • #4
        Re: Newbie here looking for Help with Reports

        Here is what I would do:

        Create a grid and setup your search parameters as you would for any grid. If you want to keep the traffic down, then disallow showing the grid until search criteria is presented.

        Then create an action button on the grid to run the report. In the SQL filter put: currentgridfilter()

        That will run your report with the sql filter in place, exactly as you search for it in the grid and it will run on the back-end.

        The key here is that there is a local filter and sql filter for each report based on sql. You need to make sure you are filling in the SQL filter, not the local filter.

        Comment


        • #5
          Re: Newbie here looking for Help with Reports

          Just for testing I am using my working preview, and trying to save the report to my local desktop. This is the XBasic I put in on the button trigger. If I put it in a button on every line, it doesn't work. If I put the button in the record detail, also doesn't work. If I put it on a button on the UX that holds the drop downs to limit the grid, the report runs, but is not filtered.

          Report.saveas("Product","TXT",currentgridfilter(),currentgridorder(),"C:\Users\User\Desktop\Product.xml",.t.)

          Comment


          • #6
            Re: Newbie here looking for Help with Reports

            I don't think the currentgridfilter will work in that instance. It is for running a report from a button, not from within xbasic.

            However, what you want is to use the "options" section to specify your filter, not the filter section. Filter will filter locally, options.filter will append to the where clause.

            Look in the documentation under object.saveas. They have a good example of a sql filter in there using options.filter.

            Comment


            • #7
              Re: Newbie here looking for Help with Reports

              hello

              i do not know if you have solved this issue.
              if not here are the steps
              1> create a report based on the sqldatasource with where clause
              2> create a button on the tabbed_ui if you are using or some place to call that report
              3> on the panel to define the report being called fill in info and then define the arguments binding
              that should work.
              here is a video to show it works
              http://screencast.com/t/LTeebud7uY
              please post back if this is what you are looking or if you need more help.
              Last edited by GGandhi; 07-04-2013, 11:32 AM.
              thanks for reading

              gandhi

              version 11 3381 - 4096
              mysql backend
              http://www.alphawebprogramming.blogspot.com
              [email protected]
              Skype:[email protected]
              1 914 924 5171

              Comment


              • #8
                Re: Newbie here looking for Help with Reports

                I am still not getting exactly what I want, maybe I am going about this completely wrong. I have a SQL data source, and I am building a web app. I need to set 4 criteria on the UX. Then display the results on a read only grid on the UX. I have that much. Then I would like a button on the UX to take that subset of data, to build a XML report, and save it on the server, or a share local to the server. I have a report that takes the data from the SQL source, and builds a .xml file from that data. I just need a button trigger it, and pass the limiting criteria. The report.saveas in the xbasic code does 90% of what I am looking for, but takes forever to run. I think the options.filter that lgrupido mentioned is what I need, but how do I get the information from the UX dropdowns into that filter? Thanks for working with me, I am still learning A5.

                Comment


                • #9
                  Re: Newbie here looking for Help with Reports

                  What version of Alpha 5 are you using?

                  Comment


                  • #10
                    Re: Newbie here looking for Help with Reports

                    Version 12

                    Comment


                    • #11
                      Re: Newbie here looking for Help with Reports

                      Originally posted by s.hackleman View Post
                      Version 12
                      sorry to have answered before, i do not have version 12. so do not know anything about it.
                      besides, this should have been posted in the version 12 forum. then you will get ton of help.
                      thanks for reading

                      gandhi

                      version 11 3381 - 4096
                      mysql backend
                      http://www.alphawebprogramming.blogspot.com
                      [email protected]
                      Skype:[email protected]
                      1 914 924 5171

                      Comment


                      • #12
                        Re: Newbie here looking for Help with Reports

                        That is my bad, just updated and didn't even think about that before I posted the question.

                        Comment


                        • #13
                          Re: Newbie here looking for Help with Reports

                          Whether version 12 or 11, the concept is similar.

                          I did a test and here is a function that worked for me. IN the function, below, I have a table called AAC with two fields. AAC and AACDescription.

                          AAC is a value from A to Z. I am filtering for AAC = "v" only.

                          This is an example of how to use it, the trick is to get the current filter values. Currentgridfilter did not work for me either.

                          However, look at e._gridcurrentfilter, e._gridcurrentarguments and e._gridcurrentargumentsxml

                          and you'll get a little farther along. (or look at their UX equivalents in V12)

                          FUNCTION printaac as c (e as p)

                          dim options as p

                          options.filter = "aac = 'v'"

                          options.order = "aac"


                          Report.saveas("tblaac","TXT","","","C:\a5webroot\tblaac.txt",.t.,"","",Options)

                          printaac = ""

                          END FUNCTION

                          Comment


                          • #14
                            Re: Newbie here looking for Help with Reports

                            Here is my code in Alpha 5.

                            Code:
                            dim options as p
                            options.filter = "COMPANY = 'T-VIN' .and. STOREID = 'T-VIN-0001' .and. INV_CATEG = 'DVD' .and. INV_U_QTY >= 3"
                            options.order = "INV_U_QTY"
                            
                            report.saveas("Product","TXT", "", "","C:\Users\s.hackleman\Desktop\Product.txt",.f.,null_value(),"",options)
                            When running the statement

                            Code:
                            SELECT COMPANY, STOREID, INV_SKU, INV_CATEG, INV_DESC1, INV_U_QTY FROM dbo.INV 
                            where COMPANY = 'T-VIN' and STOREID = 'T-VIN-0001' and INV_CATEG = 'DVD'and INV_U_QTY >=3;
                            on the SQL server, I return 2,000 rows in less than 2 seconds.

                            When I run it in A5, the Window grey's out and I let it sit for an hour. I ended up having to force-ably close Alpha 5. I had a 1.2 GB corrupted PDF on my desktop. It seems as if it is trying to build the report for all 16 million records. Is there something that looks wrong in my code?

                            Comment


                            • #15
                              Re: Newbie here looking for Help with Reports

                              You only use .and. when doing xbasic.

                              Since this query is going straight to SQL, you just use AND like in the original query. so ...

                              options.filter = "COMPANY = 'T-VIN' and STOREID = 'T-VIN-0001' and INV_CATEG = 'DVD' and INV_U_QTY >= 3"

                              Your SQL won't understand the .and. and probably just rejects the where clause completely.

                              Only other difference I see is that I had "" where you have null_value().

                              Comment

                              Working...
                              X