Skip to content

Drilldown

Forums Forums SIMPOL Programming Drilldown

Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #3536
    JD Kromkowski
    Participant

    I used drilldown quite a bit, but a minor aesthetic issue and a question.

    1. WHAT is the relationship between the SUM of the colwidths[] values and the width?

    For example, in the code below colwidths[] sum is 350 (275+75). What value for “width” will display the both columns entirely but will not cause there to be a horizontal scroll.

    2. How would I use setfilterhandler? Say in this partial example, I’d only like to display records where FeeAmount > 100.00. How would I do that?

    **********************partial code example********************************
    dispflds[1] =@ app.tables.issueb!BillingIssue
    dispflds[2] =@ app.tables.issueb!FeeAmount

    colwidths =@ array.new()
    colwidths[1] = 275
    colwidths[2] = 75

    e = 0
    r =@ drilldown(appw.w, 475, 400, idx, 10, 1, “Select a Billing Issue”, “Issue list”, \
    dispflds=dispflds, colwidths=colwidths, defboolean=dispfmt.defboolean, \
    definteger=dispfmt.definteger, defnumber=dispfmt.defnumber, \
    defdate=dispfmt.defdate, deftime=dispfmt.deftime, \
    defdatetime=dispfmt.defdatetime, datelocale=app.SBLlocale.datelocale, \
    numlocale=app.SBLlocale.numlocale, caseinsensitive = .true, \
    startvalue = “%”, error=e)

    #3539
    Michael
    Keymaster

    Hi John,

    Question 1 is a bit complicated. It seems like you are looking for the maximum width of the grid content before it displays a horizontal scrollbar. This not always easy to sort out, and may depend on the font and font size in use. I tend to experiment myself until I find something I am happy with. The tablesearch actually contains a feature to let you display the column widths so you can figure it out interactively during the development phase, then you turn it off for production.

    As for question 2, you pass a setfilterhandler=myfilterhandler with an optional reference. The function receives either just the string of chars that have been entered or that plus the optional reference. The return value of the function is expected to be a valid whereclause entry for a report.

    function myfilter(string s)
      string where
    
      where = "BillingIssue LIKE '" + s + "' AND FeeAmount > 100"
    end function where

    Ciao, Neil

    #3541
    JD Kromkowski
    Participant

    “The tablesearch actually contains a feature to let you display the column widths so you can figure it out interactively during the development phase, then you turn it off for production.”

    So I see boolean showcolwidths. What’s the best way to go about this. Do I go into the dd project, change to .true and then rebuild the the whole drilldown.sml library as something new like drilldowntest.sml, include drilldowntest.sml and remove drilldown.sml. Then get proper values, fix code, then go back and remove drilldowntest and include original drilldown.sml.

    Or is there a simpler way to do this? like getting tsinfo and setting showcolwidths?

    #3544
    Michael
    Keymaster

    You just pass .true for the showcolwidths parameter and .true for the allowcolwidthsdrag parameter.

    Ciao, Neil

    #3547
    JD Kromkowski
    Participant

    I get passing those parameters but drilldown() doesn’t have those parameters to pass. They resident in tablesearch(), which is called within the drilldown.sml.

    I thought as a general rule we shouldn’t alter the .sml libraries. So while I can see how I would change parameters in tablesearch within the drilldown project, I obviously then would need to rebuild and thus change the sml.

    So what I was asking not clearly enough: Is there a way to set these parameters WITHOUT changing the drilldown.sml?

    #3548
    Michael
    Keymaster

    No, what I was suggesting was that you temporarily use a tablesearch() during development, just to establish the required colwidths, then pass those colwidths to drilldown().

    #3551
    JD Kromkowski
    Participant

    I have finally understood what you were telling me.

    Use tablesearch() temporarily INSTEAD of drilldown(). I didn’t understand until a recent email with Ian, that you could call tablesearch directly!

    I get it now. And wishing you speedy recovery.

    JDK

    #3552
    Michael
    Keymaster

    Hi John,

    I’m glad you got it and thank you to Ian for pointing you in the right direction.

    As for me, there have been a few bumps along the way, but we are still on course :).

    Ciao, Neil

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.