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

Report Question

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

  • Report Question

    Iím building a web application which will be used primarily for users to log on and print certain financial reports. Because of the complexity of some of the reports, data is taken from several tables and appended to 2 temporary tables and the report is made from a set derived from linking the 2 temp tables. Since, each time a report is run, the 2 temp tables are zapped and new data appended, I am concerned about the wait time to generate the report if several people try running the same report at the same time.

    So, what I am trying to accomplish is, instead of directly using the temp tables and set, to create 2 new randomly named tables, then link them to form a new set, then duplicate the existing temp set to the newly created set so that the newly created set will have the report layout from the temp set, run the report in pdf or html format, then delete the newly created set and tables. This way there is never a conflict except when the duplication happens which shouldnít be a problem.

    I first created the code and tested in in a desktop application and it works fine. I wonít go into detail of the many ways Iíve tried to get this done. However, at one point I got it to work successfully in the interactive window of the page I want it to run on but it would hang up when it ran live. Below is the code Iím using at this point in time.
    When the page runs, the 2 new tables are created, the first table is added to the controlpanel then the page hangs up.

    <%a5
    ''SESSION VARIABLE TO BE USED FOR UDF PAGES
    session.headertbl=""
    session.datatbl=""
    session.set_name=""
    session.Ptbl_Name=""
    session.Ctbl_Name=""
    session.PSet_Name=""

    ''CREATE PARENT TABLE NAME AND LOCATION
    dim shared Pname as c
    Pname = "A"+rand_string(6)+".dbf"
    session.headertbl="[PathAlias.ADB_Path]"+"\\"+Pname
    session.Ptbl_Name=A5.GET_PATH()+"\\"+Pname

    ''CREATE CHILD TABLE NAME AND LOCATION
    dim shared Cname as c
    Cname = "B"+rand_string(6)+".dbf"
    session.datatbl="[PathAlias.ADB_Path]"+"\\"+Cname
    session.Ctbl_Name=A5.GET_PATH()+"\\"+Cname

    ''CREATE SET NAME AND LOCATION
    dim shared Sname as c
    Sname = left(Pname,7)+"_"+left(Cname,7)+".set"
    session.set_name = "[PathAlias.ADB_Path]"+"\\"+Sname
    session.PSet_Name = A5.GET_PATH()+"\\"+Sname


    ''CODE TO CREATE NEW PARENT TABLE
    fields = <<%a%
    Clientno,c,10
    Code,c,10
    Company,c,50
    My1,c,8
    My2,c,8
    My3,c,8
    My4,c,8
    My5,c,8
    My6,c,8
    My7,c,8
    My8,c,8
    My9,c,8
    My10,c,8
    My11,c,8
    My12,c,8
    %a%
    create_table(session.Ptbl_Name, fields)

    ''CODE TO CREATE NEW CHILD TABLE
    fields = <<%a%
    Clientno,c,10
    Indicator,c,35
    M1,c,18
    M2,c,18
    M3,c,18
    M4,c,18
    M5,c,18
    M6,c,18
    M7,c,18
    M8,c,18
    M9,c,18
    M10,c,18
    M11,c,18
    M12,c,18
    %a%
    create_table(session.Ctbl_Name, fields)

    ''CREATE PARENT TABLE INDEX
    Dim t as p
    t=table.open(session.Ptbl_Name)
    t.index_create_begin("ZClientno","Clientno")
    t.index_create_end()
    t.close()

    ''CREATE CHILD TABLE INDEX
    Dim t as p
    t=table.open(session.Ctbl_Name)
    t.index_create_begin("ZClientno","Clientno")
    t.index_create_end()
    t.close()

    ''ADD PARENT TABLE TO CONTROLPANEL
    dim ptr_Ptbl as p
    dim Ptbl as c
    ptr_Ptbl = table.open(session.Ptbl_Name)
    Ptbl = ptr_Ptbl.filename_get()
    file_add_to_db(Ptbl)
    ptr_Ptbl.close()

    ''ADD CHILD TABLE TO CONTROLPANEL
    dim ptr_Ctbl as p
    dim Ctbl as c
    ptr_Ctbl = table.open(session.Ctbl_Name)
    Ctbl = ptr_Ctbl.filename_get()
    file_add_to_db(Ctbl)
    ptr_Ctbl.close()

    ''LINK TABLES TO CREATE SET
    dim parent_tbl as P
    dim child_tbl as P
    dim child_index as P
    parent_tbl = table.open(session.Ptbl_Name)
    child_tbl = table.open(session.Ctbl_Name)
    relation.link_type = LINK_MANY
    child_index = child_tbl.index_get("ZClientno")
    relation.index_child = child_index
    relation.order_parent = "Clientno"
    relation.ref_integrity = 0
    parent_tbl.relation_add(session.Ctbl_Name)
    parent_tbl.set_create(A5.GET_PATH()+"\\"+session.PSet_Name)
    child_tbl.close()
    parent_tbl.close()

    ''DUPLICATE TEMP SET TO NEWLY CREATED SET
    A5_DUPLICATE_SET_FILES(A5.GET_PATH()+"\\"+"ind_mavg_set", A5.GET_PATH()+"\\"+session.PSet_Name)

    ''ADD NEW SET TO TO CONTROLPANEL
    dim PSet as c
    dim ptr_PSet as P
    ptr_PSet = set.open(session.PSet_Name)
    PSet = ptr_PSet.filename_get()
    file_add_to_db(PSet)
    ptr_PSet.close()
    %>

    First of all, does what Iím trying to do make sense, and if so is it doable?? Is there a better way to handle the problem?? Am I paranoid about the possible wait time if I go ahead and design it using the original Temp Table setup??

    Iím using A5V9 Plat.
    By the way, the reports that Iím concerned about have 2 UDF pages that are included on the reports select page and each has over 2000 lines of code that are used to empty and repopulate the tables in the report set. Yet the reports run in about 3 seconds (locally). Again, my concern is what is going to happen when 2 or more users attempt to run the same report at the same time.

    Iíve spent so much time on this that I canít even think straight about it any more!!

    Any and all help will be greatly appreciated.

    JAS

  • #2
    Re: Report Question

    You don't need to work quite that hard. Instead, you can take a working copy of your tables and sets, and put them in the current user's session folder. Then, work with them. Here are some pertinent snippets from one of my apps:

    Code:
    ' Create copy of table in session folder
    new_table = session.session_folder + "pm_projection.dbf"
    dim table_name as c 
    table_name = "[pathalias.adb_path]\pm_projection.dbf"
    dim tbl as p 
    tbl = table.open(table_name)
    tbl.duplicate(new_table,3)
    tbl.close()
    t = table.open(session.session_folder + "pm_projection.dbf", file_rw_shared)
    ' now go ahead and fill table "t" with the necessary data.
    With this method, no one's waiting -- everybody gets their own data processed in their own session folder.
    -Steve
    sigpic

    Comment


    • #3
      Re: Report Question

      Steve:
      I'm a little dense sometimes, so please bear with me.
      If I copy the 2 temp tables and the temp set, the report layout will be derived from the session folder as well??

      Jim

      Comment


      • #4
        Re: Report Question

        The answer to your question is in this line:

        Code:
        tbl.duplicate(new_table,3)
        Check out the help docs on this one. The last parameter - the "3" in this case - dictates what gets duplicated. You can change that parameter to duplicate whatever parts of the table you want.

        A set, whenever copied somewhere else, will contain the reports that are part of the set.
        -Steve
        sigpic

        Comment


        • #5
          Re: Report Question

          Thanks Steve
          It looks so simple. I should have asked yesterday. Ah well, you live and learn(painfully sometimes).

          Thanks again for the speedy help.
          Jim

          Comment


          • #6
            Re: Report Question

            How do you "force" <TBL>.DUPLICATE() to duplicate the table on the "shadow copy" (client) as opposed to creating it on the "server?" (LAN Network applications)

            Someone on one of the forums here indicated there was a way to "force this" to happen. I know you can specify the directory & file name within the parameters of the method itself, but is this directory/file specification relative to the pc from which you are running the app on? ~ Or is it relative to the location of the application on the "server."

            I'm thinking that for routines like cash receipts etc.... You sometimes need to create a temporary empty table on the client (which includes "cloning" the data structure of a "template table") to grab totals / summaries of outstanding invoices, along with summary payment info etc....... (I hope I'm on track here!)


            ANSWER: http://msgboard.alphasoftware.com/al...uot-(local-PC)
            Last edited by SNusa; 02-14-2012, 10:21 AM.
            Robert T. ~ "I enjoy manipulating data... just not my data."
            It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
            RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

            Comment

            Working...
            X