Alpha Video Training
Results 1 to 2 of 2

Thread: How to use variables in Grid SQL arguments

  1. #1
    "Certified" Alphaholic
    Real Name
    Jaime Ben David
    Join Date
    Jan 2011
    Location
    Karkur, Israel
    Posts
    1,040

    Default How to use variables in Grid SQL arguments

    Hi
    Trying to find a workaround for thread https://www.alphasoftware.com/alphaf...-by-)-question , i am trying to embed the grid in a UX and replace the grid's search part with fields in the UX.

    The idea is to use the following sql for the grid:
    Code:
    select Customers.CustomerName, Customers.CustomerID, count(Orders.OrderID) as OrdersCount, sum(Orders.Amount),
    :FromDate as ReportFromDate, :ToDate as ReportToDate as TotAmount from orders join Customers on orders.customerid=customers.CustomerID
     order by Customers.CustomerName group by Customers.CustomerName, Customers.CustomerID, ReportFromDate, ReportToDate
    As you can notice, i added to the query results the two sql arguments, so i can use this in the "Base filter" property when embedding the component in the UX.

    My problem is now with setting the SQL arguments. For some reason, i need to enter those arguments in the query definition itself, then add them to the grid as well. When using the "always prompt for value" option, it always asks for a value which doesn't help in my scenario. I am trying to use variables instead, but i don't know how to set it and how to pass the values flawlessly from the ux, in my scenario

    Thanks
    Jaime

  2. #2
    "Certified" Alphaholic
    Real Name
    Larry Grupido
    Join Date
    May 2010
    Posts
    1,791

    Default Re: How to use variables in Grid SQL arguments

    I guess my question back would be - do you have to use a grid?

    This would be MUCH easier to do with a list control.

    If you don't need to edit the values directly in the grid (and judging by the select statement, you don't) then a list would handle this much more quickly, cleanly and easily.

Similar Threads

  1. Use Drop Down Box and arguments on grid load to filter grid
    By Corne in forum Mobile & Browser Applications
    Replies: 1
    Last Post: 12-04-2013, 12:23 PM
  2. How to turn page variables into session variables in a grid
    By nlights in forum Application Server Version 11 - Web/Browser Applications
    Replies: 5
    Last Post: 02-25-2013, 11:47 AM
  3. Running Select with alpha five variables not arguments
    By jorgecardenas1 in forum Alpha Five Version 11 - Desktop Applications
    Replies: 3
    Last Post: 06-11-2012, 03:50 PM
  4. Grid Arguments problem, how to filter grid?
    By WindForce in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 04-03-2012, 01:35 AM
  5. SQL Arguments as variables
    By hpjchobbes in forum QReportBuilder
    Replies: 4
    Last Post: 04-09-2008, 11:30 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
  •