Results 1 to 10 of 10

Thread: Grid Creation without Data Source

  1. #1
    Junior Member
    Join Date
    Feb 2017
    Posts
    7

    Grid Creation without Data Source

    I have been researching the best ways to integrate a grid on a form.

    I have a CURSOR from a SQLCONNECT() and SQLEXEC() that I have successfully implemented in the Init() of the page, however I do not know the best way to go about creating the grid based on the cursor it creates. (I assume it is a cursor? I do not see a data session window anywhere )

    In VFP forms, I used a temp cursor to create a grid (using grid builder), and specified each column controlsource from that temp cursor.

    In VFP forms, I created (via CREATE CURSOR) or queried the data into a CURSOR needed for the grid in the "BeforeOpenTables" procedure to make the data available when the form loaded.

    It seems like this needs to be accomplished via Virtual Tables in Lianja, but I have to do some backend manipulation of the data in the cursor after the cursor is created and as data is updated in MSSQL.

    Also, I need to access an .ini for the connection string information for SQLCONNECT() across seperate MSSQL databases, so I am unsure if a VT will work for these situations.

    Any help is greatly appreciated.
    Last edited by barrymavin; 2022-09-22 at 04:22.

  2. #2
    Junior Member
    Join Date
    Feb 2017
    Posts
    7
    Also, I noticed that if you add a Grid as a gadget, the "After Row/Col Change" delegate does not seem to be available in the Attributes.

    Can you add that to the .prg script as a seperate proc?

    Thanks!

  3. #3
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,359
    Blog Entries
    22
    Welcome to Lianja.

    Let's start at the beginning.

    - Virtual Tables combine a connection string, a data source and a cursor adaptor.
    - The connection string can contain {macros} so you can look them up in your .ini file as {macros} can be an expression. Additionally Lianja has ini file functions.
    - are you trying to dynamically create a grid that has the same or different columns?

    "In VFP forms, I used a temp cursor to create a grid (using grid builder), and specified each column controlsource from that temp cursor."

    Not needed Virtual Tables do that for you. Columns can also have business rules and meta data attached to them automatically.

    "In VFP forms, I created (via CREATE CURSOR) or queried the data into a CURSOR needed for the grid in the "BeforeOpenTables" procedure to make the data available when the form loaded."

    Not needed. Virtual Tables will do that for you.

    "It seems like this needs to be accomplished via Virtual Tables in Lianja, but I have to do some backend manipulation of the data in the cursor after the cursor is created and as data is updated in MSSQL."

    Lianja has section delegates that handle this scenario.

    "
    Also, I need to access an .ini for the connection string information for SQLCONNECT() across seperate MSSQL databases, so I am unsure if a VT will work for these situations."

    Use {macros} in your connection string or your SQL query.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,359
    Blog Entries
    22
    Quote Originally Posted by quiglyd View Post
    Also, I noticed that if you add a Grid as a gadget, the "After Row/Col Change" delegate does not seem to be available in the Attributes.

    Can you add that to the .prg script as a seperate proc?

    Thanks!
    The before and after grid gadget delegates are exposed in the delegates in Lianja 8.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Junior Member
    Join Date
    Feb 2017
    Posts
    7
    I imported a SQL table to use for a VT for a grid, and once I got the table imported, Lianja began crashing every few minutes.

    I noticed an error folder and there a single error recorded. Not sure if there is a log I can view to post errors.

    I have attached the error.mem file if that is of assistance (I had to change the extension to .txt to allow it to upload)


    Are there sources/examples you can provide that can demonstrate all of the comments you replied with such as:

    "Not needed Virtual Tables do that for you. Columns can also have business rules and meta data attached to them automatically."

    "Lianja has section delegates that handle this scenario."

    "Use {macros} in your connection string or your SQL query."
    Thank you.
    Attached Files Attached Files
    Last edited by quiglyd; 2022-09-26 at 15:47.

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,359
    Blog Entries
    22
    Can you explain how you “imported” a SQL table to use as a VT?

    The error being reported is.
    drop view vt_dvor_ss_live_data

    Where is that being executed as it has nothing to do with a VT and I don’t see any VT information in your error file.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  7. #7
    Junior Member
    Join Date
    Feb 2017
    Posts
    7
    I created an empty database.

    After selecting the database, I use the option that says "Create Virtual Tables from ODBC..." from the gear icon.

    I imported two different MSSQL tables from the tables that were discovered.

    Once in the app, I did a Shift+Drag to create a new Grid.

    The grid had the relevant SQL data, however Lianja started crashing every few minutes after this was performed.

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,359
    Blog Entries
    22
    In the console open your database and issue Dir so I can see the VT definitions.

    if you are getting a. Crash the SET DEBUG ON and attach the debug files in the debug directory to a ticket rather than the forums.

    Regarding your request for examples you can search both the documentation wiki and the forums.

    You stated

    The grid had the relevant SQL data, however Lianja started crashing every few minutes after this was performed.”

    What are you doing when this happens?
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  9. #9
    Junior Member
    Join Date
    Feb 2017
    Posts
    7
    Lianja is now stuck on "Loading App myTestApp", which is the app I was using to try to add the VT to a grid when Lianja crashed.

    I have tried restarting our server this is hosted on several times.

    If the Lianja starts again, I will get a log of the debug files and post them as a ticket.

    If there are workarounds other than uninstalling and re-installing Lianja, please let me know!

    Thank you.

  10. #10
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,359
    Blog Entries
    22
    You can add —reset as a command line switch on the app builder desktop icon to prevent opening the app on load.

    You do not need to reinstall Lianja.

    You can post a new ticket which includes your app and we can look at your delegates which must be causing this.

    What delegates have you added code in?
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Tags for this Thread

Bookmarks

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
  •  
Journey into the Cloud
Join us