Alpha Video Training
Results 1 to 9 of 9

Thread: User build reports in Runtime ?

  1. #1
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default User build reports in Runtime ?

    Hi, Has anyone built the controls to allow a user with Runtime to create their own Reports and letters?

    I can see I will need to use the function a5_new_report_dialog().

    All help appreciated.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  2. #2
    "Certified" Alphaholic
    Real Name
    Raymond Lyons
    Join Date
    Apr 2000
    Location
    Carlsbad, CA
    Posts
    2,143

    Default Re: User build reports in Runtime ?

    Yes, I have and Bill Parker has too, I believe. Most of what you need is in the documentation file that comes with the Runtime Plus, though it seems I recall there being a error or two in that documentation. But are you asking about just the regular runtime? I believe you need the Runtime Plus for any of this to work. And be warned that totally protecting your "system" reports, forms and letters from users is very difficult. Using what Alpha suggests, I never could block them from using Save As to overwrite things I did not want them messing with. Bill Parker suggested a way to give them their own "sandbox" to play in (a forum search should find this) by dropping their sets out of the main database. I ended up using Bill's approach but I must say it too has a few problems of its own (including taking a lot of time to set up) and since I just recently implemented it with a client, I am not yet sure how well it is working in practice.

    Raymond Lyons

    Try this thread: http://msgboard.alphasoftware.com/al...t=runtime+Plus
    Last edited by Raymond Lyons; 06-13-2009 at 09:25 PM.

  3. #3
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: User build reports in Runtime ?

    Hi Raymond,

    Thanks for getting back to me on this.

    I understand what you mean about the SQL .F. not working, I think the fix has been lost it the pile of things to fix before V10 comes out.

    In the Toolbar I have used the following code to SaveAs but the list of existing reports does not populate the dialog.
    I have elected to use this method to dynamically produce the Exclude List.
    Code:
    dim tbl_lst as c
    tbl_lst=a5.report_enum()
    tbl_lst=*for_each(x,x+"|report",tbl_lst)
    a5_layout_saveas("save report as ","Report",tbl_lst,"Please choose another name")
    Using the standard SaveAs the dialog gets populated, so what do you think is going wrong here?

    The other question is, how do you create a list of reports dynamically, that the user can edit that were only user created?
    Last edited by Keith Hubert; 06-14-2009 at 07:11 AM.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  4. #4
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: User build reports in Runtime ?

    Keith,
    The saveas dialog that comes up will bring up any report NOT on the exclude list. A bit of experimenting shows that perhaps you should have a static list of excluded reports as when not in the exclude list and you try to save another report by the same name, Alpha presents a dialog box asking whether to overwrite the existing or not.

    Also, What is listed in the saveas box are just the reports associated with whatever table/set was chosen to base the report on....so you can still have multiple reports with identical names when the reports are based upon different tables/sets.
    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
    __________________________________________




  5. #5
    "Certified" Alphaholic
    Real Name
    Raymond Lyons
    Join Date
    Apr 2000
    Location
    Carlsbad, CA
    Posts
    2,143

    Default Re: User build reports in Runtime ?

    Quote Originally Posted by Keith Hubert View Post
    ...
    I understand what you mean about the SQL .F. not working, I think the fix has been lost it the pile of things to fix before V10 comes out.
    Actually, Selwyn has fixed this in V9, he just has not released a patch for it. You might be able to ask for a V9 pre-release patch with the fix. The new parameter structure for a5_new_report_dialog() is a5_new_report_dialog as p (type = "", prompt = "", title = "", table_set_list = "", alias_names = "", exclude_tables = .f., flagShowSQLDataSource = .t.)

    Quote Originally Posted by Keith Hubert View Post
    In the Toolbar I have used the following code to SaveAs but the list of existing reports does not populate the dialog.
    I have elected to use this method to dynamically produce the Exclude List.
    Code:
    dim tbl_lst as c
    tbl_lst=a5.report_enum()
    tbl_lst=*for_each(x,x+"|report",tbl_lst)
    a5_layout_saveas("save report as ","Report",tbl_lst,"Please choose another name")
    Using the standard SaveAs the dialog gets populated, so what do you think is going wrong here?
    I am not going to be of much help with Save As issues. As I said, I gave up on it. Why? I don't remember the details but I think there were two issues: 1) the code I did for Save As worked using the full version but did not work using the runtime, and 2) (and yes this was a separate issue) for the runtime the location of the files for the special toolbars and menus was not the A5 program folder but after some patch or another it ended being in the somewhere in the logged on user's Documents and Setting area. This for me was just too much to deal with in a multi-user networked environment in which more than one user occasionally uses any given machine (different network logons) and which employees come and go all the time. This is one of the main reasons I went with the Mike Reed/Bill Parker separate "sandbox" solution.


    Quote Originally Posted by Keith Hubert View Post
    The other question is, how do you create a list of reports dynamically, that the user can edit that were only user created?
    For this, I started out NOT using the separate sandbox solution but instead decided to, as much as possible, force users to begin their report names with a "Z" so I could identfy them. This did not do anything to deal with the Save As and other issues, so following a suggestion from Bill Parker I switched to the separate sandbox way of doing all this. For me, this means all user designed reports are based on one of two sets that are dropped from the database (this keeps them separate from my "system" reports). These two sets have the same tables and relationships as counterparts in the database but do not have any of the system reports and so on. Becasue these sets are dropped from the database, you have to use "qualified names" when addressing them, i.e., not just "Myreport" but "Myreport@Myset.set".

    Anyway, what I did was take the Mike Reed/Bill Parker function posted (I think) in the Code Archive and modify it for my purposes. For one thing, I chose not to use the undocumented function they use, and I also added a bit of stuff to it, for example, I wanted users to be able to start their layouts with several pre-built templates which had to be duplicated and renamed before the users did whatever to them. For whatever it might be worth, this function is attached below. But I also created 2 other functions, one for users to filter, order and print just their reports (system reports are printed from different menus and buttons) and one to allow user to delete their layouts--but not system layouts.

    All in all, this was a lot of work, much of which there was no way I could bill any client for. If I had it to do again, I probably would not do it!

    Raymond Lyons

  6. #6
    "Certified" Alphaholic
    Real Name
    Raymond Lyons
    Join Date
    Apr 2000
    Location
    Carlsbad, CA
    Posts
    2,143

    Default Re: User build reports in Runtime ?

    Update on my sandbox function: My users have not reported issues but I just did a bit more testing and for unknown reasons it seems to be flaky on one set when trying to edit any existing report layout if there is only one. I get a message "Error Read past end of file while trying to start application." and then "Command: A5_layout_Design(layoutname_long,layoutlbl) Object is not defined." Trouble is this only happens with one set and then only with reports (as opposed to letters). So back to the drawing board!

    Raymond Lyons

  7. #7
    "Certified" Alphaholic
    Real Name
    Raymond Lyons
    Join Date
    Apr 2000
    Location
    Carlsbad, CA
    Posts
    2,143

    Default Re: User build reports in Runtime ?

    Quote Originally Posted by Raymond Lyons View Post
    Update on my sandbox function: My users have not reported issues but I just did a bit more testing and for unknown reasons it seems to be flaky on one set when trying to edit any existing report layout if there is only one. I get a message "Error Read past end of file while trying to start application." and then "Command: A5_layout_Design(layoutname_long,layoutlbl) Object is not defined." Trouble is this only happens with one set and then only with reports (as opposed to letters). So back to the drawing board!

    Raymond Lyons
    Another update: In case anyone is messing with the function I posted above, the error I was getting has been solved by adding Alltrim() in:
    Code:
    a5_layout_design(Alltrim(Layoutname_long),layoutlbl)
    I am not sure why it needed this for one of my 2 sets and not the other and why for reports but not letters.

    Raymond Lyons

  8. #8
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: User build reports in Runtime ?

    Sample posted in Code Archive. Comments welcome.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  9. #9
    "Certified" Alphaholic
    Real Name
    Raymond Lyons
    Join Date
    Apr 2000
    Location
    Carlsbad, CA
    Posts
    2,143

    Default Re: User build reports in Runtime ?

    The attached sample app builds on something I began a while back to allow Runtime Plus users to create, edit and print their own reports without interfering with anything I build as a developer. The simple way Alpha suggests for this was problematic at the time (not sure what the situation is now). As I have stated elsewhere, to the extent I remember it, there were two main issues: 1) the code I did for Save As worked using the full version but did not work using the runtime, and 2) (and yes this was a separate issue) for the runtime the location of the files for the special toolbars and menus was not the A5 program folder but after some V9 patch or another it ended being in the somewhere in the logged on user's Documents and Setting area. This for me was just too much to deal with in a multi-user networked environment in which more than one user occasionally uses any given machine (different network logons) and which employees come and go all the time.

    Midway through building my own function for creation/editing (forcing users to begin the layout names with a "Z") I happened on a post from Bill Parker that refereed to a function in the Code Archive that he and Mike Reed developed. This approach got around the Save As problem I was having by giving user their own "sandbox" to play in, that is, reports are in sets that are not part of the database. So, down that road I went. However, what I wanted was a bit complex. I wanted to give the users some pre-built templates they could start with, and I needed everything to work in a multiuser, networked Shadow database environment. Of course users in a shadow DB can't create/edit anything that will last, so I also had to develop a way for them to easily go to the Master DB and then back to the Shadow.

    For printing I also wanted users to be able to build their own filter and order expressions and to be able to use a filter created by Query By Form on a form. Additionally, I wanted to be able to identify those layouts that had hard coded filters and give users a chance to add to them (which may not always work so well!).

    Unfortunately, for some aspects of all this to work in V9 one needs bug fixes that have been made but so far have not been released in an official patch (I am now using a pre-release “beta” patch). I hope there will be one more official V9 patch before V10 is released. Still, most it should still work, just perhaps not perfectly. Just remember that some A5 bugs you find may have already been fixed (I do not now remember all the details of these fixed bugs). If you run into too many such problems, try again with V10, as it should have all the fixes I am referring to.

    Anyway, attached is the sample app. It certainly still has some bugs that are mine not Alpha’s, and I am sure it could stand a lot of improvement (error handling and more efficient code in some places). If you improve the functions or the overall design in any way, I would appreciate it if you would share those improvements with me and others.

    Raymond Lyons

Similar Threads

  1. End user editable reports in runtime
    By popellis in forum Alpha Five Version 9 - Desktop Applications
    Replies: 8
    Last Post: 04-10-2008, 12:24 AM
  2. Adding a 3-user runtime to a 3-user runtime
    By Jim Stanley in forum Alpha Five Version 8
    Replies: 9
    Last Post: 02-10-2008, 02:00 PM
  3. 3User Runtime -> 5 User Runtime
    By ColinJD in forum Alpha Five Version 8
    Replies: 2
    Last Post: 10-14-2007, 05:50 PM
  4. 1 user A5V5 vs 3 user Runtime
    By dik_coleman in forum Alpha Five Version 5
    Replies: 2
    Last Post: 11-06-2003, 02:30 PM
  5. Runtime build 230
    By Phil Gillenwater in forum Alpha Five Version 4
    Replies: 3
    Last Post: 04-15-2000, 10:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •