Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Show Results of Xbasic SQL Query in UX

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DoronF
    replied
    Re: Show Results of Xbasic SQL Query in UX

    Hi Jinx,

    I actually developed a Query and Report Engine that generates a whole SQL statement and much more in Visual FoxPro Engine. I started that actually 15 years ago and your process reminded me how I started. Good luck with your work...

    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

    Leave a comment:


  • bowenjohn
    replied
    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.

    Leave a comment:


  • GGandhi
    replied
    Re: Show Results of Xbasic SQL Query in UX

    very nice.

    Leave a comment:


  • -Jinx-
    replied
    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

    Leave a comment:


  • GGandhi
    replied
    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, 09:28 PM.

    Leave a comment:


  • -Jinx-
    replied
    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, 01:17 PM.

    Leave a comment:


  • GGandhi
    replied
    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.

    Leave a comment:


  • -Jinx-
    replied
    Re: Show Results of Xbasic SQL Query in UX

    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.

    Leave a comment:


  • GGandhi
    replied
    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.

    Leave a comment:


  • GGandhi
    replied
    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.

    Leave a comment:


  • -Jinx-
    replied
    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.

    Leave a comment:


  • GGandhi
    replied
    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, 11:56 AM.

    Leave a comment:


  • -Jinx-
    replied
    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
    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.

    Leave a comment:


  • GGandhi
    replied
    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)?

    Leave a comment:


  • -Jinx-
    replied
    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.

    Leave a comment:

Working...
X