Alpha Video Training
Page 1 of 2 12 LastLast
Results 1 to 30 of 31

Thread: Show Results of Xbasic SQL Query in UX

  1. #1
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Show Results of Xbasic SQL Query in UX

    Hi all,

    I'm tying to make my own "SQL Genie" to allow select commands only and make it available to certain users of my application. I've got it working in so far as they can pick a database, select a table and select columns from that table. What I'm trying to figure out is the best and fastest way to display the query results to the user in a table format so that they can copy and paste them. Basically just like MSSQL server management studio would or like the built in alpha genie does when building a component.

    A list doesn't seem to work because there is no way I can find to easily and dynamically change the fields and layout.

    If I loop through the result set, it get's really slow so I don't want to build the HTML or something that way.

    There are some handy xbasic functions available:
    Result Set.......
    .ToString()
    .ToCSV()
    .ToJSON
    .ToJSONObjectSyntax()

    etc....

    They look interesting and they seem to work quickly.

    I'm just having trouble getting that data formatted correctly for the users to see and manipulate on my UX

    Any ideas?
    Last edited by -Jinx-; 05-14-2015 at 12:39 PM.

  2. #2
    Member
    Real Name
    Anita Headley
    Join Date
    Jul 2013
    Location
    Olympia, WA
    Posts
    168

    Default Re: Show Results of Xbasic SQL Query in UX

    I have been fighting with a very similar problem for months. The only solution I have found so far is to run the query using Xbasic, put the results in two tables (header for column names and detail for data) with generic column names and then build a report on those tables. The result is not very pretty - made worse by the fact that alpha reports translate nulls in numeric fields into zeros on the report. If you find another solution, I would love to hear about it in detail.

  3. #3
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    Well,
    I have it working good enough to debug it. It's still pretty slow when the query has a lot of results but if you filter it, it works OK.

    I ended up having Xbasic write some javascript to populate the inner html of a div with a table. The table is pretty basic right now but it has dynamic column names in the table head and a column left for the row number. I'm working on getting it to look more like MSSQL management studio with results and stuff.

    I wish I knew the methods Alpha 5 is using to pull results for grids and lists and such and if they were exposed somewhere. That would be much nicer.

    One of the reasons that it's so slow is that I have to not only convert the result set using .ToJSONObjectSyntax() but I have to use crlf_to_comma() to convert that from crlf delimited to comma delimited (or it won't work in JavaScript) and then I have to js_escape() it because there might be stuff in the sql that javascript doesn't like. Shouldn't .ToJSONObjectSyntax() just DO that?
    Last edited by -Jinx-; 05-15-2015 at 02:41 PM.

  4. #4
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    Shouldn't .ToJSONObjectSyntax() just DO that?
    actually in version 11, which is what I have, rs.toJSONObjectSyntax produces single quoted values which are not good as they are not standard. I have to convert not only crlf_to_comma and then single quotes to double quotes. (for example {"name":'gandhi'})
    it is lot easier for me to write directly to json object syntax myself sometimes, without worrying about converting a string to some other string.

    however so far I have not found writing to a table being slow. or may be my dataset is small.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  5. #5
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    Quote Originally Posted by GGandhi View Post
    however so far I have not found writing to a table being slow. or may be my dataset is small.
    Hi Gandhi,
    Yeah, I tried to loop through the result set instead of using one of the functions described above but it got really slow at some point. I'm not sure the exact number of records. Using the functions is faster but it's still slow with a large set.

    I've got another issue. For some reason the table styling is affecting my whole page. I need to figure out how not to do that. Stick this code in a button on a UX and make sure you have a edit combo box on it somewhere. That should reproduce the issue of the edit combo box getting a border when clicking the button. On a tabbed UI it's even worse. Lots of stuff magically gets borders.

    Anyway, here is the snippet of JavaScript code that my Xbasic sends back to my client.
    Code:
    var data = '[{"tnumber" : "06900", "file_location" : "P:\\\\Secured\\\\ReleasedPDF\\\\Tooling\\\\069\\\\06900.pdf"},\n{"tnumber" : "06901", "file_location" : "P:\\\\Secured\\\\ReleasedPDF\\\\Tooling\\\\069\\\\06901.pdf"},\n{"tnumber" : "06902", "file_location" : "P:\\\\Secured\\\\ReleasedPDF\\\\Tooling\\\\069\\\\06902.pdf"},\n{"tnumber" : "06903", "file_location" : "P:\\\\Secured\\\\ReleasedPDF\\\\Tooling\\\\069\\\\06903.pdf"},\n{"tnumber" : "06904", "file_location" : "P:\\\\Secured\\\\ReleasedPDF\\\\Tooling\\\\069\\\\06904.pdf"},\n{"tnumber" : "06905", "file_location" : "P:\\\\Secured\\\\ReleasedPDF\\\\Tooling\\\\069\\\\06905.pdf"},\n{"tnumber" : "06906", "file_location" : "P:\\\\Secured\\\\ReleasedPDF\\\\Tooling\\\\069\\\\06906.pdf"},\n{"tnumber" : "06907", "file_location" : "P:\\\\Secured\\\\ReleasedPDF\\\\Tooling\\\\069\\\\06907.pdf"},\n{"tnumber" : "06908", "file_location" : "P:\\\\Secured\\\\ReleasedPDF\\\\Tooling\\\\069\\\\06908.pdf"},\n{"tnumber" : "06909", "file_location" : "P:\\\\Secured\\\\ReleasedPDF\\\\Tooling\\\\069\\\\06909.pdf"},\n{"tnumber" : "06910", "file_location" : "P:\\\\Secured\\\\ReleasedPDF\\\\Tooling\\\\069\\\\06910.pdf"}]';
    var obj = JSON.parse(data);
    var inhtml = '<style>table, th, td {border: 1px solid black;border-collapse: collapse;}th,td{padding: 5px;}</style><table style=width:100%><tr><th></th><th>tnumber</th><th>file_location</th></tr>'
    for (i = 0; i <11; i++){
    inhtml = inhtml + '<tr><td>' + i +'</td><td>' + obj[i].tnumber+'</td><td>' + obj[i].file_location+'</td></tr>';
    }
    inhtml = inhtml + '</tr></table>';
    $('RESULTS').innerHTML= inhtml;
    $('MESSAGE').innerHTML= 'Success<br>11: Row(s) Affected';
    {dialog.object}.showContainerWindow(this,'WINDOW_1');
    You will need two divs on the page for this info to get into.

    Code:
    <div id = "MESSAGE"></div>
    <div id = "RESULTS"></div>

  6. #6
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    BTW, if I clear the inner HTML of the div that the table is in when I close the window, the page returns to normal. Maybe this is just something about CSS that I don't get. I know next to nothing about it.

  7. #7
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    I tested your code it does not take a lot of time either in a dialog or in an a5w page, I am trying to beautify the table by alternating color somehow not yet possible.
    I will try some more and let you know.
    edit:
    I can alternate the colors but I am not sure what is your end results would be.
    Last edited by GGandhi; 05-15-2015 at 08:53 PM.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  8. #8
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    Quote Originally Posted by GGandhi View Post
    I tested your code it does not take a lot of time either in a dialog or in an a5w page, I am trying to beautify the table by alternating color somehow not yet possible.
    I will try some more and let you know.
    edit:
    I can alternate the colors but I am not sure what is your end results would be.
    That code is fast. It's the XBasic that creates the JavaScript above which is slow with a lot of rows.

  9. #9
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    Would you please show that portion and how you are getting the result?
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  10. #10
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    Quote Originally Posted by GGandhi View Post
    Would you please show that portion and how you are getting the result?
    I'll post the relevant portion when I get back to work.

    The XBasic puts the table information into the 'data' variable in the above code. The more results you get from your query, the bigger the data variable gets. At around 7,000 rows of data, it takes about 8 seconds to run the XBasic, and another 5 to run the JavaScript. It goes up exponentially as you add columns and rows.

  11. #11
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    just the code segment or sample where you get the data from your server after the connection string, for example the sql statement, I think.
    I am wondering why it should take 8 seconds because all sql servers do the query in milliseconds.

    edit: or there may be problem before the code goes to the server?
    Last edited by GGandhi; 05-16-2015 at 12:11 PM.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  12. #12
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    The SQL is fast, it's the XBasic operations that I need to perform on the result set in order to make the JSON string for the 'data' variable that's slow.

  13. #13
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    it's the XBasic operations that I need to perform on the result set
    this is what confusing me.
    it is just one operation to convert to json syntax. then fill in what alpha should have done correct to start with to fit your need.
    anyway you can post whatever you feel right when you get back to work.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  14. #14
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    Quote Originally Posted by GGandhi View Post
    this is what confusing me.
    it is just one operation to convert to json syntax. then fill in what alpha should have done correct to start with to fit your need.
    anyway you can post whatever you feel right when you get back to work.
    You really need to try it with a large amount of returned rows to see the speed difference. Just getting the result set itself (coverting it to Xbasic from SQL or whatever Alpha does behind the scenes) takes a long time.

    In the code below, I have a timer that gets the current time before the Xbasic runs and then the time just before it exits the Xbasic. It finds the difference and gives that to you as "Elapsed Time"

    Here is an exerpt of the code that I think you can work with.

    columns comes in as an array of data for me as the individual columns that are part of the query.

    You should be able to play with this as you like. I haven't had time to optimize or clean up the code yet, so it's still a little messy.

    Code:
    function GetResult as c (e as p)
    
    	
    dim stm as c = time()
    dim t1 as Y = ctot(stm)
    
    dim result as c
    dim results as c
    dim inhtml as c = "'<style>table, th, td {border: 1px solid black;border-collapse: collapse;}th,td{padding: 5px;}</style><table style=width:100%><tr><th></th>"
    dim cmd as c
    dim db as c
    dim table as c
    dim columns as p = e.dataSubmitted.COLUMNS
    dim cnt as n = 0
    dim callres as c
    dim cn as SQL::Connection
    dim args as SQL::Arguments
    	if cn.open("::Name::")	then
    		dim sqlCmd as c = cmd
    		if cn.Execute(sqlCmd) then
    			dim rs as SQL::ResultSet
    			rs = cn.ResultSet
    				if rs.NextRow() then
    					result = rs.ToJSONObjectSyntax()
    					cnt = w_count(result,chr(13))
    					results = "["
    						for i = 1 to cnt
    							results = results + word(result,i,chr(13)) + crlf()
    						next
    					results = crlf_to_comma(results)
    					results = js_escape(results)
    					results = "var data = '" + results
    					results = results + "]';" + crlf()+ "var obj = JSON.parse(data);"
    					if columns[1] <> "" then
    						clmcnt = columns.SIZE()
    							for i = 1 to clmcnt
    								inhtml = inhtml + "<th>" + columns[i] + "</th>"
    							next
    						inhtml = inhtml + "</tr>'"
    						results = results  + crlf() + "var inhtml = " + inhtml + crlf() + "for (i = 0; i <"+cnt+"; i++){" + crlf() + "inhtml = inhtml + '<tr><td>' + i +'</td>"
    							for i = 1 to clmcnt
    								results = results + "<td>' + obj[i]."+columns[i]+"+'</td>"
    							next
    						results = results + "</tr>'" + ";" + crlf() + "}"+ crlf() + "inhtml = inhtml + '</tr></table>';" + crlf() + "$('RESULTS').innerHTML= inhtml;"
    					end if
    				end if
    		end if
    	end if
    
    
    dim ftm as c = time()
    dim t2 as Y = ctot(ftm)
    dim qt as N = (t2 - t1)
    
    callres = js_escape(cn.CallResult.Text)
    results = results + crlf() + "$('MESSAGE').innerHTML= '" + callres + "<br>Elapsed Time: " + qt +" Sec <br>" + cnt + ": Row(s) Affected" + "';"
    results = results + crlf() +"{dialog.object}.showContainerWindow(this,'WINDOW_1');"
    	if cn.CallResult.Text <> "Success" then
    		results = results + crlf() + "{grid.object}.selectTabPane('TAB_1','Messages');"
    	end if
    	
    debug(1)
    
    GetResult= results
    end function

  15. #15
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    yes there are lots of things going on in your code
    result = rs.ToJSONObjectSyntax()
    what doeS that return? it seems that you are working too much on the resultset to me
    I am not sure why you need cnt.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  16. #16
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    rs = cn.ResultSet
    msg = rs.ToJSONObjectSyntax()
    msg = "wineTastingCallback(["+strtran(msg,crlf(),",")+"]);"
    I am send this as JSONP to a ajaxcallback cross domain
    if you think about it and remove the script
    (["+strtran(msg,crlf(),",")+"]
    I am only doing this.
    why you need so much work? please let me know so I understand the complexity.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  17. #17
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    It basically returns a JSON string. BASICALLY. It still needs to be formatted correctly by changing the crlf's to commas. I need cnt but you're right that I didn't need:

    Code:
    for i = 1 to cnt
    results = results + word(result,i,chr(13)) + crlf()
    next
    That was a left over artifact that needed to be cleaned up by changing the previous line to:

    Code:
    results = "[" + results
    So that saves some time. I'm working on adding a timer to the JavaScript portion right now to see the time it takes to execute the server side code vs the time it takes to execute the client side code.

  18. #18
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    a.h
    why you need to parse the object in the xbasic?
    can you show what is returned ( even truncated in the middle)?
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  19. #19
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    So, that portion of the code looks like this now:

    (commented for clarity of why I'm doing stuff)

    Code:
    result = rs.ToJSONObjectSyntax()
    'Get the count to let users know how many rows affected
    cnt = w_count(result,chr(13))
    'add a bracket to the front of the result for proper formatting.
    results = "[" + result
    'change the crlf delimited list to comma delimited.  Otherwise javascript doesn't like the line breaks
    results = crlf_to_comma(results)
    'escape the javascript senistive stuff in the results like single quotes that may be in the sql stuff returned  WHY DOESNT .ToJSONObjectSyntax() DO THIS??!!
    results = js_escape(results)
    'the rest of the stuff below shouldn't take much time as it's just building a string for javascript code
    results = "var data = '" + results
    results = results + "]';" + crlf()+ "var obj = JSON.parse(data);"
    if columns[1] <> "" then
    clmcnt = columns.SIZE()
    	for i = 1 to clmcnt
    		inhtml = inhtml + "<th>" + columns[i] + "</th>"
    	next
    inhtml = inhtml + "</tr>'"
    results = results  + crlf() + "var inhtml = " + inhtml + crlf() + "for (i = 0; i <"+cnt+"; i++){" + crlf() + "inhtml = inhtml + '<tr><td>' + i +'</td>"
    	for i = 1 to clmcnt
    		results = results + "<td>' + obj[i]."+columns[i]+"+'</td>"
    	next
    results = results + "</tr>'" + ";" + crlf() + "}"+ crlf() + "inhtml = inhtml + '</tr></table>';" + crlf() + "$('RESULTS').innerHTML= inhtml;"
    end if
    Quote Originally Posted by GGandhi View Post
    a.h
    why you need to parse the object in the xbasic?
    can you show what is returned ( even truncated in the middle)?
    The very first code I pasted is what the xbasic returns to the browser.

  20. #20
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    counterintuitive!
    you have the resultset and the data is available as data(1) or data("name")
    you are converting to an object and parsing in xbasic?!?
    Last edited by GGandhi; 05-18-2015 at 11:56 AM.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  21. #21
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    Inefficient. I need to return ALL ROWS that the query returns. Looping through the result set (rs.data(1) etc.) is even slower than what I'm doing above. That's why I'm doing this in the first place. For speed.

  22. #22
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    you are still looping thru after the parsing so there is speed break.
    show a partial resultset and I can understand better to see any improvement can be done. or may be you are right to start with anyway.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  23. #23
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    you don't need the count, obj.length will be sufficient.

    result = "["+strtran(result, crlf(),","+"]" will be sufficient for that portion of the code. where you are creating an array.
    rstoJSONOject in version 11 is not right, in my opinion. you need to rework it.
    once the object is built you don't parse it in xbasic do it in javascript.
    again you don't need column count that can be done itself.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  24. #24
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    Quote Originally Posted by GGandhi View Post
    you are still looping thru after the parsing so there is speed break.
    show a partial resultset and I can understand better to see any improvement can be done. or may be you are right to start with anyway.
    I'm only looping through the columns, not the rows so it's not like I'm going through the whole result set. After it get's to the client side, yes, I'm looping through in JavaScript to build the HTML. In Post #5 above, you will find a result of my Xbasic code. I can give you another one if you want. Maybe I'm not understanding what you want.

  25. #25
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    okay when i get home tonight i will show how i did with your sample you gave in the first post.
    if you want me to work a large data send it thru pm. i will download and process that and post back to via pm.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  26. #26
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    Ok, I used obj.length as you suggested. I also commented out the cnt portion of the code. It didn't make too much difference on the server side but it's definitely a better solution. The biggest difference was the first for loop that you reminded me to take out.

    Anyway, now it seems like the html rendering is the slow point. Maybe I'll try rendering the Inner html a row at a time similar to what MSSQL server does to keep the user entertained....LOL

    I think I might have to figure out how to paginate the data.

    Anyone have any ideas on the HTML rendering?

    Sigh, this is why a list control would be so nice if it could be made to render dynamic columns.
    Last edited by -Jinx-; 05-18-2015 at 01:17 PM.

  27. #27
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    okay here I have shown two videos

    ajax callback to grid done entirely thru alpha five
    http://screencast.com/t/jekFBjXqBEy0

    alpha five to emit the json data and the angularjs to pick up and process the data ( done cross site HTTP)
    http://screencast.com/t/zBeB8q9YV9Zr

    hope you like them
    good luck with your project.
    edit:
    here is the screencast for the angular_itemsCallback.a5w that is in the server which emits the json object array for angularjs to pick up.
    http://screencast.com/t/Qt9i0FsZt
    Last edited by GGandhi; 05-19-2015 at 09:28 PM.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  28. #28
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Show Results of Xbasic SQL Query in UX

    Thanks Gandhi,

    I was busy with some other work the last day or so but I got back to it today a little. The HTML rendering is the only slow part now. Everything else seems to be nice and speedy. I also would like to figure out how to make my table columns resizable.

    Anyway, here's a preview of what I've got.

    http://screencast.com/t/M75SBdtnnUdm

    I added an output to excel so that they can send the long queries out that way. It's funny that building a huge Excel file is faster than rendering the HTML

  29. #29
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show Results of Xbasic SQL Query in UX

    very nice.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  30. #30
    Member
    Real Name
    john bowen
    Join Date
    Aug 2002
    Posts
    160

    Default Re: Show Results of Xbasic SQL Query in UX

    Sigh, this is why a list control would be so nice if it could be made to render dynamic columns.
    A couple of years ago I started to build something like this for my work but got side tracked and picked it up yesterday. I ran into the same problem with the List Control rendering dynamic columns. I am working on trying to solve this, I will let you know if I find a solution.

    BTW, this is a great thread between you and GGandhi.

Similar Threads

  1. How do I write a long SQL query in Xbasic on more than one line?
    By -Jinx- in forum Mobile & Browser Applications
    Replies: 3
    Last Post: 03-19-2015, 07:02 PM
  2. Browse Table results show Find by Form results
    By gitpicker in forum Alpha Five Version 10 - Desktop Applications
    Replies: 1
    Last Post: 01-29-2013, 12:07 PM
  3. Execute Crosstab Query in Xbasic - How Do I Display Results?
    By kingcarol in forum Application Server Version 11 - Web/Browser Applications
    Replies: 14
    Last Post: 03-02-2012, 08:25 AM
  4. How to calculate field based on results of an SQL query?
    By WindForce in forum Application Server Version 11 - Web/Browser Applications
    Replies: 5
    Last Post: 11-07-2011, 02:53 PM
  5. How to Populate List box from sql query results?
    By christobal in forum Alpha Five Version 8
    Replies: 0
    Last Post: 09-04-2007, 06:26 AM

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
  •