Alpha DevCon 2018
Results 1 to 14 of 14

Thread: How would I get a table/grid to look like this?

  1. #1
    Member
    Real Name
    Jane
    Join Date
    Mar 2015
    Posts
    149

    Default How would I get a table/grid to look like this?

    Hi There,

    Thank you for taking the time to look. Much appreciated.

    We have a grid that we want to display who has what. See attached image. The prorposed table structure is also in picture.

    gridappearance.png

    Why this is different than a standard is because I want the column names to not be the table fields, but the data in the fields.

    I'm not even sure how to start this. Any suggestions on video tutorials I could watch? I've watched many alpha videos in the past and know all the resources, such as wiki, video tuts, reference guide so I am actively looking but still haven't found clues how to start it.

    Thank you for your suggestions


    Jane

  2. #2
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    1,782

    Default Re: How would I get a table/grid to look like this?

    Without wrapping.my head around it all why not make a table based on what you want and then create a UX that has fields that reference the other tables?
    NWCOPRO Nuisance Wildlife Control Software-My Application: http://www.nwcopro.com OR my Developer Chat
    Disconnected apps are easy to understand. An internet-enabled app is like a long cat, you pull the tail on one device in New York and the cat meows in New Orleans. In the case of a disconnected app, there just isn't a cat and the meow is familiar.

  3. #3
    Member
    Real Name
    Jane
    Join Date
    Mar 2015
    Posts
    149

    Default Re: How would I get a table/grid to look like this?

    The table is based on multi user tenancy which means based on the user, they may have different names and objects. This means I can't develop a table exactly on what is required but the users and objects will be dependent on our customers.

  4. #4
    Moderator
    Real Name
    James A. Talbott, Jr.
    Join Date
    Apr 2000
    Location
    Versailles, KY
    Posts
    1,337

    Default Re: How would I get a table/grid to look like this?

    What you are looking for is basically a cross-tabulation, and your back end database (dbf or sql) will determine how it needs to be done.
    Jay
    Jay Talbott
    Lexington, KY


  5. #5
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    1,782

    Default Re: How would I get a table/grid to look like this?

    I KNOW that this possible, multi-tenancy or not as I run a multi-tenant app and do this same thing all the time on lets say for instance an invoice. Each tenant can have customers with orders and payments. I do not know what the item will be called, or the payment description etc.

    Think of it in terms of a repeating section, session variables will be able to assign ownership to the tenant and or customer as well as the user (if the tenant has more than one type of user: secretary/technician/manager, etc.

    If you want the tenant to create their own objects, create a table for it. Let them create all they want and then use that as a lookup for the form. This is similar to what I do for products. They can all have different products, prices etc. then on an invoice they add what ever products they want based on their very own product library, and I even created a BASE library, so when they are actually creating items they can select from thousands of everyday line items as their own if they want. So if you look at the structure and not the names of the tables or the fields, the structure is really what you appear to be doing.

    Each tenant has an object, maybe several with certain features of the object. This could mean that they can enter stuff into an object table, a features table, and in each table each objects row records the id of the tenant and the user and maybe even a customers order number.

    You can have an objects table, that is a one to many - where each object is not only assigned a pk but also the pk_id of the user and the pk_id of any other table.
    so I am sticking with my original advice - this can easily be accomplished with an additional table without database rules (cascading,etc) since the UX can display a list (which a list would be perfect for this) and then you can easily edit it in a detail view. Lists are an outstanding addition to Alpha and would work really really well for what you are trying to accomplish.

    I hope this helps. If you have a multi-tenant app already in production you may already know everything I am saying so I hope I am not offending you by not understanding what your needs truly are but I really do think that this can work as I said I do this myself in a SAAS app I built over the last coupe years with alpha.
    NWCOPRO Nuisance Wildlife Control Software-My Application: http://www.nwcopro.com OR my Developer Chat
    Disconnected apps are easy to understand. An internet-enabled app is like a long cat, you pull the tail on one device in New York and the cat meows in New Orleans. In the case of a disconnected app, there just isn't a cat and the meow is familiar.

  6. #6
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    1,782

    Default Re: How would I get a table/grid to look like this?

    It might also help ( me anyways) if you labeled the grids field with the actual database field names. I would also avoid using the same field names in tables as that just serves to confuse later.
    For instance, if your creating an objects table call the fields
    object_id
    object_name
    object_desc

    And then if you create a Users_Objects table call the fields
    users_obj_id
    users_obj_name
    users_obj_desc

    and not use the same name such as "description"
    unless it's always going to hold the same value for the tenant, like "user_id"
    but even then I often assign the table prefix anyways.

    that way you can very quickly know whats going on, and for instance in in the image you supplied I cannot know what field belongs to what table. At least from an outsiders viewpoint I am just not sure - which is why I said "without trying to wrap my head around..."

    so anyways, as I said I hope this helps.
    NWCOPRO Nuisance Wildlife Control Software-My Application: http://www.nwcopro.com OR my Developer Chat
    Disconnected apps are easy to understand. An internet-enabled app is like a long cat, you pull the tail on one device in New York and the cat meows in New Orleans. In the case of a disconnected app, there just isn't a cat and the meow is familiar.

  7. #7
    Member
    Real Name
    Doron
    Join Date
    Dec 2011
    Location
    NJ, USA
    Posts
    165

    Post Re: How would I get a table/grid to look like this?

    Hi Jane,

    Do you use SQL database? With a simple sql statement I can get it to work and create a view out of these 3 tables...

    Regards,

    Doron
    The Farber Consulting Group, Inc.

    Main Web Site: http://www.dFarber.com
    MS SQL Blog: http://www.dfarber.com/computer-consulting-blog.aspx
    Convert Ms Access to Web
    Custom Software Development
    Alpha Five Development
    No Interest Loans Application
    MS SQL Remote DBA

  8. #8
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,431

    Default Re: How would I get a table/grid to look like this?

    Quote Originally Posted by Jay Talbott View Post
    What you are looking for is basically a cross-tabulation, and your back end database (dbf or sql) will determine how it needs to be done.
    Jay
    Let me add the link to the wiki for that..

    http://wiki.alphasoftware.com/~alpha...tab+Operations
    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.

  9. #9
    Member
    Real Name
    Jane
    Join Date
    Mar 2015
    Posts
    149

    Default Re: How would I get a table/grid to look like this?

    Hi Charles - thank you for taking the time to look. I appreciate it.

    Yeah, I've looked at the repeating section as a solution but the main trouble I'm having is that I'm not sure what the column titles are until I read them from the database.
    Normally, in a repeating section it would look like this

    Table.Field1Name, Table.Field2Name
    Value, Value

    Or in the instance of a invoice it would be
    Product (Table.Field1Name), Qty (Table.Field2Name)
    Toothpaste (Value), 1000 (Value)

    What I'm wanting to do is slightly different because I want to read the column titles from a database.Table.Value and not a database.Table.Field1Name

    The only way i can see doing this with a repeating section is having two repeating sections together.
    First 1 would read the value sfrom the table and it would have css to make it look like headings
    The second 2 would then read the associated values .

    Thank you again for having a look. I'll look into repeating sections more.

    Cheers

    Jane.

  10. #10
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    1,782

    Default Re: How would I get a table/grid to look like this?

    You can position the fields and values in a report in any position you want and of course the report will be generated after you would know the values - maybe thats what your really after!
    Reports can be put in divs, windows, etc. and can be very flexible.
    NWCOPRO Nuisance Wildlife Control Software-My Application: http://www.nwcopro.com OR my Developer Chat
    Disconnected apps are easy to understand. An internet-enabled app is like a long cat, you pull the tail on one device in New York and the cat meows in New Orleans. In the case of a disconnected app, there just isn't a cat and the meow is familiar.

  11. #11
    Member
    Real Name
    Jane
    Join Date
    Mar 2015
    Posts
    149

    Default Re: How would I get a table/grid to look like this?

    Hi doron. Thank you for looking and sharing ur experience. That sounds like something similar to what I'm after. Any chance you could share the statement? Cheers, jane.

  12. #12
    Member
    Real Name
    Doron
    Join Date
    Dec 2011
    Location
    NJ, USA
    Posts
    165

    Post Cross Tab MS SQL or MySQL Sample Query

    Hi Jane,

    To create an SQL statement we need tables with some data.
    If you are using MS SQL or MySQL:

    See these 2 links:

    http://stackoverflow.com/questions/1...crosstab-query

    http://www.paragoncorporation.com/Ar...x?ArticleID=25

    Regards,

    Doron
    The Farber Consulting Group, Inc.

    Main Web Site: http://www.dFarber.com
    MS SQL Blog: http://www.dfarber.com/computer-consulting-blog.aspx
    Convert Ms Access to Web
    Custom Software Development
    Alpha Five Development
    No Interest Loans Application
    MS SQL Remote DBA
    Last edited by DoronF; 06-11-2015 at 01:52 AM.

  13. #13
    Member
    Real Name
    Jane
    Join Date
    Mar 2015
    Posts
    149

    Default Re: How would I get a table/grid to look like this?

    Thank you Doron. That's great. Much appreciated.

  14. #14
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    1,782

    Default Re: How would I get a table/grid to look like this?

    Yes thanks, this helped me to understand and learn a few things. My approach is based on the fact that I do not know how to do this, in effect I was creating the cross tab view as a table itself manually, but of course this would be much harder to create when you do not know the entries. Thanks!
    NWCOPRO Nuisance Wildlife Control Software-My Application: http://www.nwcopro.com OR my Developer Chat
    Disconnected apps are easy to understand. An internet-enabled app is like a long cat, you pull the tail on one device in New York and the cat meows in New Orleans. In the case of a disconnected app, there just isn't a cat and the meow is familiar.

Similar Threads

  1. Is it possible dynamic table in grid or UX ?
    By purnawarman in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 01-16-2015, 02:41 AM
  2. Replies: 0
    Last Post: 04-27-2014, 11:51 PM
  3. Lookup data from a table and display it in a grid build on a different table
    By Ronald Anusiewicz in forum Application Server Version 11 - Web/Browser Applications
    Replies: 9
    Last Post: 09-04-2012, 12:38 PM
  4. Error opening grid table/view. Error loading table
    By Ronald Anusiewicz in forum Application Server Version 10 - Web/Browser Applications
    Replies: 4
    Last Post: 07-14-2010, 12:16 PM
  5. Grid table
    By Rodney Efird in forum Alpha Five Version 4
    Replies: 1
    Last Post: 04-15-2002, 05:51 PM

Posting Permissions

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