Skip to content

access to the quickreport filter window

Forums Forums SIMPOL Programming access to the quickreport filter window

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #3426
    JD Kromkowski
    Participant

    whereclause = guigetsimplefilter(appw.w, “”, labeldef.template.mastertable.table.tablename, \
    defbooleanformat=df.defboolean, defintegerformat=df.definteger, \
    defnumberformat=df.defnumber, defdateformat=df.defdate, \
    deftimeformat=df.deftime, defdatetimeformat=df.defdatetime, \
    defdatelocale=app.SBLlocale.datelocale, \
    defnumericlocale=app.SBLlocale.numlocale, datasources=app.datasources, \
    tables=tables, ppcs=app.ppcs, “Customer Labels Filter”)

    #3427
    JD Kromkowski
    Participant

    Oops. pasted wrong thing. Is guigetsimplefilter() the way to access the filter GUI?

    I see that graphicreport1 has property allowuserdefinedfilter but I don’t see corresponding property for quickreport1 or report1?

    PS Really wish all the help docs were accessible from IDE and that you could search them all at once.

    #3428
    JD Kromkowski
    Participant

    I can’t seem to get guigetsimplefilter() to work.

    But the source code for reportlib.sml is not available so hard for me to see what the problem is.

    #3429
    JD Kromkowski
    Participant

    I tried to see how it work in the Business example, where it is used with labels.

    unfortuantely
    labeldef =@ openlabeldef(

    ends up being nul so that function apparently isn’t even working.

    even when I opened up one of the customer labels slx (after fixing bad reference to datasource as X:\, it is not clear to me that the filter button on the labels works at all.

    So, maybe you could release the source for the gui that handles filter for updates,graphicreports, and quickreports?

    JDK

    #3430
    Michael
    Keymaster

    Hi John,

    Your initial post looked relatively good from here. Yes, you should be able to call that to allow the user to construct a filter for a single table. The return value is the where clause.

    As for the problem in SIMPOL Business, thanks for the heads up. I have removed the paths from the label definitions in the current version so in the next release, they should work fine. You can do the same, just remove the entire path in the andtags from customerlabels.sxf and customerlabels_us.sxf. The first one is for A4 paper and the second one is for US Letter paper.

    If you are having problems with guigetsimplefilter(), can you tell me what is happening and how far you get?

    Ciao, Neil

    #3431
    JD Kromkowski
    Participant

    I cannot get the whereclause = guigetsimplefilter( …) to work. I can’t figure out where the problem actually lies because source for sml is not available.

    There error is object not found. I do not have access right now to my actual code. I will follow up

    Maybe the best way to track it down would be to put some code using guigetsimplefilter() into the
    quickreportsample project.

    So I added the following to debug

    string test
    test = qr.whereclause
    test = guigetsimplefilter(filter = test)

    Error (21): Object not found
    Error: a statement of function “guigetsimplefilter” was executed unsuccessfully
    There is no source code available for the statement

    So we’re clear I added the repguilib.sml to the project, so I can see that the function is available.

    #3432
    JD Kromkowski
    Participant

    I noticed your post included the caveat ” Yes, you should be able to call that to allow the user to construct a filter for a single table.” single table

    The filter gui in Personal obviously is robust enough to allow multiple tables.

    There is a wheel, why can’t we have access to the wheel.

    JDK

    #3439
    Michael
    Keymaster

    Sorry to hear you are having problems with it. I will have a look today.

    We haven’t chosen to release the code that implements the report1, quickreport1, graphicreport1, the quick report GUI, etc. because we still make changes to that (we are currently playing around with adding ODBC-based SQL support to the whole thing). Also some libraries may never be delivered in source.

    #3440
    JD Kromkowski
    Participant

    So as a further test, I added the following to sb_salesreport function in the Business example. I get error 200. So something is wrong.

    whereclause = guigetsimplefilter(appw.w,\
    whereclause,\
    app.tables.ordermst.tablename,\
    app.displayformats.defboolean,\
    app.displayformats.definteger,\
    app.displayformats.defnumber,\
    app.displayformats.defdate,\
    app.displayformats.deftime,\
    app.displayformats.defdatetime,\
    app.SBLlocale.datelocale,\
    app.SBLlocale.numlocale,\
    app.datasources,\
    app.tables,\
    app.ppcs,\
    “Test of GUI SIMPLE FILTER”)

    #3441
    JD Kromkowski
    Participant

    As to what you release or not, that’s up to you; figuring out errors is sometimes hard without. QuickReport is a function in SBNG Personal (which includes a filter gui). So far as I understand, SBNG Personal is written in simpol. I like to be able to call QuickReport programmatically and have it as a menu item. That doesn’t seem so complicated and is in the spirit of a SBNG as a RAD tool.

    #3442
    JD Kromkowski
    Participant

    I’m going to take a closer look at how it works in
    donewuserfilter, where it does definitely work

    which btw took me awhile to figure out its name as I read it

    done w user filter, i.e. “done with user filter” which made no sense to me

    instead of

    donewuserfilter,i.e. “do new user filter”

    #3443
    JD Kromkowski
    Participant

    So I sort of got it working but with addition significant problems.

    In the simpol business example in function sb_salesreport(…), I add the following

    string tablename
    tdisplayformats disp

    appw =@ getappwindowfromwindow(getmenuitemwindow(me))
    disp =@ app.displayformats
    tables =@ gettablesarray(appw)
    tablename = appw.currenttable.table.tablename

    then later in the code where there is whereclause is being assigned, mine as a test now looks like (I’ve add \ here and there to avoid wrap)

    //// this part is original code //////
    if qr =@= .nul
    wxmessagedialog(appw.w, “Error opening quick report ‘” + reportname + “‘”, sAPPMSGTITLE,\
    “ok”, “error”)
    else
    whereclause = “CUSTOMER.CustSerNo = ORDERMST.CustSerNo AND ORDERMST.OrderedOn >= DATE(‘” + \ DATESTR(startdate,”yyyy-mm-0d”,app.SBLlocale.datelocale) +”‘) AND ORDERMST.OrderedOn <= DATE(‘” + \
    DATESTR(enddate, “yyyy-mm-0d”, app.SBLlocale.datelocale) + “‘)”

    /// this part is new using guigetsimple filter /////////////////////

    whereclause = guigetsimplefilter(appw.w,whereclause,\
    tablename, disp.defboolean, disp.definteger, disp.defnumber,\
    disp.defdate, disp.deftime, disp.defdatetime, app.SBLlocale.datelocale, \
    app.SBLlocale.numlocale, app.datasources, tables, app.ppcs)
    ////////////////////////////////////////////////////////////////////

    So, you’ll see that it does now open the gui (not sure why it didn’t before)

    1. If you hit OK and don’t change anything in the whereclause – you get an error. But you really shouldn’t because if you comment everything new out the whereclause is perfectly fine.

    So, this means there is an alleged error being caught in the repguilib.sml (code to which we don’t have access)

    2. If you do try to create your own filter (either by addition or edit mode), well good luck

    #3444
    JD Kromkowski
    Participant

    So I have pinned down the problem to how repguilib evaluates where clauses in this particular situation. The problems lies with the joining statement. If you separate the joining statement out, and then later rebuilding it back up you can have a custom filter. See below, which works. It seems like this guigetsimplefilter is by design or error preventing JOINS. Why?

    string whereclause1, whereclause2
    whereclause1 = “CUSTOMER.CustSerNo = ORDERMST.CustSerNo AND ”
    whereclause = “ORDERMST.OrderedOn >= DATE(‘” + \
    DATESTR(startdate, “yyyy-mm-0d”, app.SBLlocale.datelocale) + \
    “‘) AND ORDERMST.OrderedOn <= DATE(‘” + \
    DATESTR(enddate, “yyyy-mm-0d”, app.SBLlocale.datelocale) + “‘)”

    whereclause2 = guigetsimplefilter(appw.w,whereclause,\
    tablename, disp.defboolean, disp.definteger, disp.defnumber,\
    disp.defdate, disp.deftime, disp.defdatetime, app.SBLlocale.datelocale, \
    app.SBLlocale.numlocale, app.datasources, tables, app.ppcs)

    // try as example 1 doing nothing in the simple filter just leave the dates you picked –
    // things work as expected and intended no “internal error from repguilib.sml”
    // try as example 2 add with gui filter “AND ORDERMST.CustSerNo <= 24”
    // you’ll see that this also works as expected.

    whereclause = whereclause1 + whereclause2

    #3446
    Michael
    Keymaster

    guigetsimplefilter() was designed to be used for the = in the selection panel. As such, it is limited to a single table statement. It intentionally disables/hides the Links button in the filter dialog.

    #3447
    JD Kromkowski
    Participant

    would you consider releasing the quick report filter code (which allows for joins) or the form that the quick report filter dialog contains so that we wouldn’t have to start from scratch?

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