Skip to content

QuickReports – using .sxq with either SBME or PPCS?

Forums Forums SIMPOL Programming QuickReports – using .sxq with either SBME or PPCS?

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

    I can’t seem to be able to use a quickreport initially designed with a sbme datasource in a ppcs setting. The qr was created programatically and then saved with savequickreport(qr,sxqfilename, error=e). It uses more than one table. Being able to pro grammatically create a quickreport in the PPCS app context has proven a bit complicated form me. It is hard to determine whether I am just a dimwit who doesn’t know what he is doing, or if there are bugs or just special issues. JDK

    #2312
    Michael
    Keymaster

    On 16/09/2013 16:38, kromkowski wrote:
    > I can't seem to be able to use a quickreport initially designed with a
    > sbme datasource in a ppcs setting.
    >
    > The qr was created programatically and then saved with
    > savequickreport(qr,sxqfilename, error=e).
    >
    > It uses more than one table.
    >
    > Being able to pro grammatically create a quickreport in the PPCS app
    > context has proven a bit complicated form me. It is hard to determine
    > whether I am just a dimwit who doesn't know what he is doing, or if
    > there are bugs or just special issues.
    >
    > JDK
    >

    From one of my apps that use quick reports:

    string errmsg
    integer e
    array tables

    tables =@ appw.gettablesarray()
    errmsg = ""
    e = 0
    qr =@ loadquickreport("ninv.sxq", datasources=app.datasources, tables=tables, error=e, errortext=errmsg)

    This should hook up all of your tables to the corresponding tables in the report.

    Ciao, Neil

    #2314
    JD Kromkowski
    Participant

    Thanks. I will take a look. But, I am creating the qr programatically
    based on user input to set the various parameters like columns (select),
    filter (where), order, etc. on the fly.

    This is the only way to really do this because I can't do calculated
    columns using personal.

    Attached is a sbme1 example which works just fine. The problem is making
    it work with PPCS.

    I think I know what to change except when I get to here:

    ds1 =@ qr.adddatasource(sbmfile1.type,"wages.sbm", sbmfile1, error=e)
    qr.addtable(table1, ds1, error=e)

    ds2 =@ qr.adddatasource(sbmfile2.type,"employee.sbm", sbmfile2, error=e)
    qr.addtable(table2, ds2, error=e)

    JDK

    PS: it would be really make sense if in future releases, the type

    "ppcs1file" were renamed to "ppcs1table", to create a consistency.

    I know "a hobgoblin of small minds" per Emerson, but 1) I have small
    mind and 2) it is really not a "foolish consistency".

    JDK

    On 09/17/13 7:25 AM, Neil Robinson wrote:
    > On 16/09/2013 16:38, kromkowski wrote:
    >> I can't seem to be able to use a quickreport initially designed with a
    >> sbme datasource in a ppcs setting.
    >>
    >> The qr was created programatically and then saved with
    >> savequickreport(qr,sxqfilename, error=e).
    >>
    >> It uses more than one table.
    >>
    >> Being able to pro grammatically create a quickreport in the PPCS app
    >> context has proven a bit complicated form me. It is hard to determine
    >> whether I am just a dimwit who doesn't know what he is doing, or if
    >> there are bugs or just special issues.
    >>
    >> JDK
    >>
    >
    >
    > From one of my apps that use quick reports:
    >
    > string errmsg
    > integer e
    > array tables
    >
    > tables =@ appw.gettablesarray()
    > errmsg = ""
    > e = 0
    > qr =@ loadquickreport("ninv.sxq", datasources=app.datasources, tables=tables, error=e, errortext=errmsg)
    >
    >
    > This should hook up all of your tables to the corresponding tables in the report.
    >
    > Ciao, Neil
    >

    #2316
    JD Kromkowski
    Participant

    Just as a follow-up, I have now been able to get a qr to work with a
    ppcs. But as you will see below, this is a specific case where I am only
    using one ppcs with one ppcstable1. I am also "directly" put in the
    appropriate values rather than being able to obtain them from the app
    and/or appw. I will investigate further that point.

    But there are still questions that arise.

    1. In the example below – which is a variation on the qr example in
    tutorial dir of projects, you'll see that I saved the qr.

    If later I open Personal with simpolserver running and then go to quick
    reports (F5) and open the saved report, I get error 48. (which
    apparently is "IP address not found".

    BUT if I open Personal, then open the datasource as ppcstype, and open
    the table(s) and then I use quickreports (F5) to open the saved report
    it works.

    I don't think that is correct behavior. I see that in
    loadquickreport(),which I presume is the same as opening the saved
    report in Personal, you have to pass the datasources and the tables.
    But, shouldn't you be able to obtain the ds and tables directly from the
    ..sxq ? Upon review of the .sxq, there are some things that are curious.
    First, in the programatiically created and saved sxq the datasource
    entry is so generic that it is obvious that you get an error 48

    <datasource>
    <sourcetype>ppcstype1</sourcetype>
    <source>WAGES</source>
    <sqr1table>WAGES</sqr1table>
    </datasource>

    But this is worse. If take that same opened .sqx and save it again from
    Personal.
    There is NO DATASOURCE ENTRY AT ALL! It goes straight from order to
    font and title!

    <order></order>
    <font facename="Arial Narrow" pointsize="10" weight="n" style="n"
    decoration="n" />
    <title>Test Report</title>

    So, when you load this second saved report (and have no tables open)
    nothing happens – not even an error. It just hangs. But if you happen
    to open the table (or any table with the name WAGES whether ppcs or
    sbme) it magically runs. Even though there is no datasource identified
    in the .sqx. And if you open a WAGES table – from whereever, even the
    programatically created and saved .sqx will run even though the
    datasource is identified as ppcstype1 type. (presumable the table info
    is really coming from parsing the select clause, right?

    EXAMPLE in tutorial dir modified for ppcs

    //sbme1 sbmfile1
    //sbme1table table1

    ppcstype1 ppcs
    ppcstype1file ppcstable1

    …. yadda,yadda, yadda

    ppcs =@ ppcstype1.new(udpport=.nul, error=e)
    ppcstable1=@ppcs.openudpfile("10.1.10.15:4000","WAGES",error=e)

    …. yadda, yadda, yadda

    //ds1 =@ qr.adddatasource(sbmfile1.type, "wages.sbm", sbmfile1, error=e)
    ds1 =@ qr.adddatasource(ppcs.type, "WAGES", ppcs, error=e)

    //qr.addtable(table1, ds1, error=e)
    qr.addtable(ppcstable1, ds1, error=e)

    …. yadd, yadda, yadda

    savequickreport(qr, "C:SIMPOLmytest.sxq", error=e)
    …..

    #2317
    Michael
    Keymaster

    On 18/09/2013 19:18, kromkowski wrote:
    > //ds1 =@ qr.adddatasource(sbmfile1.type, "wages.sbm", sbmfile1, error=e)
    > ds1 =@ qr.adddatasource(ppcs.type, "WAGES", ppcs, error=e)
    >
    > //qr.addtable(table1, ds1, error=e)
    > qr.addtable(ppcstable1, ds1, error=e)
    >
    > …. yadd, yadda, yadda
    >
    > savequickreport(qr, "C:SIMPOLmytest.sxq", error=e)

    The basic problem is that the source is the IP address and port number, so your code should look something like this:

    ds1 =@ qr.adddatasource(ppcstype1, "localhost:4000", ppcs, error=e)

    The rest looks more or less OK.

    Ciao, Neil

    #2318
    JD Kromkowski
    Participant

    On 09/19/13 2:46 PM, Neil Robinson wrote:
    > ds1 =@ qr.adddatasource(ppcstype1, "localhost:4000", ppcs, error=e)

    But how do I get the "localhost:port number" from the app or appw?

    #2319
    Michael
    Keymaster

    On 20/09/2013 17:58, kromkowski wrote:
    > On 09/19/13 2:46 PM, Neil Robinson wrote:
    >> ds1 =@ qr.adddatasource(ppcstype1, "localhost:4000", ppcs, error=e)
    >
    > But how do I get the "localhost:port number" from the app or appw?
    >
    >

    If you opened a PPCS data source in the app, then it will be in the ring of data sources, in fact, chances are you will only have
    one, and it will be the first one.

    app.datasources.getfirst()

    Ciao, Neil

    #2320
    JD Kromkowski
    Participant

    I stumbled upon this (app.datasources.getfirst()) already. The problem
    (or one of the problems) remains:

    many tables in a SINGLE datasource – OK,
    many datasources each with a single table – problems

    I will bother you about the sbms and forms, I sent you AFTER 1.8 is
    released.

    JDK

    On 09/27/13 7:27 AM, Neil Robinson wrote:
    > On 20/09/2013 17:58, kromkowski wrote:
    >> On 09/19/13 2:46 PM, Neil Robinson wrote:
    >>> ds1 =@ qr.adddatasource(ppcstype1, "localhost:4000", ppcs, error=e)
    >>
    >> But how do I get the "localhost:port number" from the app or appw?
    >>
    >>
    > If you opened a PPCS data source in the app, then it will be in the ring of data sources, in fact, chances are you will only have
    > one, and it will be the first one.
    >
    > app.datasources.getfirst()
    >
    > Ciao, Neil
    >

    #2321
    JD Kromkowski
    Participant

    See attached quickreport JDK002.sqx which I created programmatically
    via a user interface.

    But it will not run properly programmatically:

    Error with select expression
    select clause: identifiers not found or not unique:
    EMPLOYEE (0)
    Rate (0)

    In PERSONAL,

    if I open the datasources and tables as sbme1, I can load and run
    JDK002.sxq no problem.

    if I open datasource and tables as ppcs, the report is obviously not
    loading correctly (there are no columns listed but filter looks correct
    – but no error is thrown) and if I run it I get an error regarding
    problem with select or where clause.

    #2322
    Michael
    Keymaster

    On 27/09/2013 18:27, kromkowski wrote:
    > See attached quickreport JDK002.sqx which I created programmatically
    > via a user interface.
    >
    > But it will not run properly programmatically:
    >
    > Error with select expression
    > select clause: identifiers not found or not unique:
    > EMPLOYEE (0)
    > Rate (0)
    >
    >
    > In PERSONAL,
    >
    > if I open the datasources and tables as sbme1, I can load and run
    > JDK002.sxq no problem.
    >
    > if I open datasource and tables as ppcs, the report is obviously not
    > loading correctly (there are no columns listed but filter looks correct
    > – but no error is thrown) and if I run it I get an error regarding
    > problem with select or where clause.
    >
    >

    This is strange. It should work fine either way. Can you send me the two tables in question (with just enough data to try it out)?
    If there is a problem in Personal, I would liek to resolve it before release.

    Ciao, Neil

    #2323
    JD Kromkowski
    Participant

    Basically the same tables I sent you on 9/17 in other thread

    "Re: PPCS instead of SBME in appframework application – bug!"

    On 09/30/13 10:18 AM, Neil Robinson wrote:
    > On 27/09/2013 18:27, kromkowski wrote:
    >> See attached quickreport JDK002.sqx which I created programmatically
    >> via a user interface.
    >>
    >> But it will not run properly programmatically:
    >>
    >> Error with select expression
    >> select clause: identifiers not found or not unique:
    >> EMPLOYEE (0)
    >> Rate (0)
    >>
    >>
    >> In PERSONAL,
    >>
    >> if I open the datasources and tables as sbme1, I can load and run
    >> JDK002.sxq no problem.
    >>
    >> if I open datasource and tables as ppcs, the report is obviously not
    >> loading correctly (there are no columns listed but filter looks correct
    >> – but no error is thrown) and if I run it I get an error regarding
    >> problem with select or where clause.
    >>
    >>
    >
    > This is strange. It should work fine either way. Can you send me the two tables in question (with just enough data to try it out)?
    > If there is a problem in Personal, I would liek to resolve it before release.
    >
    > Ciao, Neil
    >

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