Welcome, Guest
Username: Password: Remember me
This forum is the place to discuss issues related to ReportPro, Xs2Ado, Vo2Ado, bBrowser and other 3rd party products
  • Page:
  • 1
  • 2

TOPIC:

ReportPro 3.9 and sql table swap 10 Aug 2021 02:16 #19305

  • gjbiagiotti
  • gjbiagiotti's Avatar
  • Topic Author


  • Posts: 33
  • Hello everyone.
    I use VO 2.8, Report Pro 3.9 (Active X) and PostgreSQL. The problem I have is when creating a report with auxiliary tables, then in execution I change the name of the report table and when executing the command:
    SELF: oReport: PreviewReport ()
    An error message appears: Subsystem Error: 00000
    The code is the following:
    SELF: oReport: = IRpRuntime {"ReportPro.Runtime.39"}
    SELF: oReport: LoadReport (cReporte)
    SELF: oReport: SetConnection (CONNECTION_ODBC, oGvar: cDriverSQL, 1, 1)
    SELF: oReport: SetTableStringAttribute (1, TableAux, SQLTABLE_ATTR_TABLE, TableNew)
    SELF: oReport: Connect2Source ()
    SELF: oReport: PreviewReport ()
    SELF: oReport: Close ()
    SELF: oReport: Destroy ()
    SELF: oReport: = NULL_OBJECT

    But if I use the same table name with which the report was created, it works fine.
    Does anyone know what the problem may be?
    Thanks a lot.

    Gerard of Argentine

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 11 Aug 2021 02:58 #19313

    • gjbiagiotti
    • gjbiagiotti's Avatar
    • Topic Author


  • Posts: 33
  • Hello
    I also tried changing this line:
    SELF: oReport: SetTableStringAttribute (1, TableAux, SQLTABLE_ATTR_TABLE, TableNew)
    for this:
    SELF: oReport: SetTableStringAttribute (1, "DSN", SQLQUERY_ATTR_SQL_FROM, "TableAux as TableNew") // From.

    and it keeps giving the same error: Subsystem Error: 00000
    What I could see is that the problem is caused by changing the table with which the report was designed.
    Has anyone had this problem with Report Pro 3.9?

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 11 Aug 2021 08:34 #19314

    • TimothyS
    • TimothyS's Avatar


  • Posts: 55
  • Hi.

    I'm assuming you are using the DotNet RP3.
    The function :
    FUNCTION RP3SQLCALLBACK(nMode, uParam)

    Should be able to do the trick. Docs are in the listofchanges.txt file. It may not be so straightforward with the VO version.

    Regards,
    Tim

    Please Log in or Create an account to join the conversation.

    Last edit: by TimothyS.

    ReportPro 3.9 and sql table swap 11 Aug 2021 16:28 #19317

    • gjbiagiotti
    • gjbiagiotti's Avatar
    • Topic Author


  • Posts: 33
  • From what I have been able to see it is a bugs of Report Pro 3.9 in the version for VO 2.8
    It is rare that no one has reported it.
    Gerardo

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 17 Mar 2022 20:45 #21968

    • gjbiagiotti
    • gjbiagiotti's Avatar
    • Topic Author


  • Posts: 33
  • Hello. I use the IRpRuntime{} class that I have generated through the VO Automation Server.
    Would you have an example of VO code of how you send the tables to the report in execution mode?
    Thanks.
    Gerard

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 17 Mar 2022 21:49 #21969

    • Jamal
    • Jamal's Avatar


  • Posts: 309
  • Hello Gerard,

    I don't use ReportPro with SQL, but the following may trigger some thoughts on your end :)

    I think it is a good idea to check if the connection is the connection is successful first before calling other methods,

    i.e.
      If SELF: oReport: SetConnection (CONNECTION_ODBC, oGvar: cDriverSQL, 1, 1)
         // your code
      else
         // display error message
      endif

    Also, what is 1 for handle1 and handle2 in the SetConnection(...) method parameters? Shouldn't you be passing SQLConnection:EnvHandle from an already established connection using the VO SQlConnection class?

    HTH,
    Jamal

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 17 Mar 2022 23:58 #21971

    • gjbiagiotti
    • gjbiagiotti's Avatar
    • Topic Author


  • Posts: 33
  • Hi Jamal.
    The problem is that the SQLConnection:EnvHandle and the SQLConnection:ConnHandle return non-numeric values.
    They return 0x02233270 and 0x022332F0, respectively.
    Gerard

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 18 Mar 2022 00:14 #21972

    • Jamal
    • Jamal's Avatar


  • Posts: 309
  • Hi Gerard,

    Those are PTR values. The VO documentation is wrong to say EnvHandle is of LONG data type.

    Internally the SQL class has a hidden variable:
    HIDDEN hEnv           AS PTR

    and declares:
    ACCESS EnvHandle CLASS SQLConnection
    
       RETURN hEnv

    I suggest you declare:
    LOCAL pSqlRet AS PTR
    
    // connect to to SQL....
    
    // then 
    pSqlRet := oYourSqlConnection:EnvHandle 
    

    then pass it to ReportPro:
    If SELF: oReport: SetConnection (CONNECTION_ODBC, oGvar: cDriverSQL, pSqlRet  , pSqlRet )
         // your code
      else
         // display error message
      endif

    HTH,
    Jamal

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 18 Mar 2022 13:59 #21975

    • gjbiagiotti
    • gjbiagiotti's Avatar
    • Topic Author


  • Posts: 33
  • Hello jamal

    In this code that you suggest, the variable pSqlRet is still of type PTR, and returns a value of the same type, but the SetConnection order of the Report needs a value of type numeric.

    Gerard

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 18 Mar 2022 14:11 #21976

    • Jamal
    • Jamal's Avatar


  • Posts: 309
  • You can convert to a LONG and see how it goes.

    LONG(pSqlRet)

    Jamal

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 18 Mar 2022 14:28 #21977

    • gjbiagiotti
    • gjbiagiotti's Avatar
    • Topic Author


  • Posts: 33
  • Jamal.
    The connection to the Report is fixed:
    SELF:oReport:SetConnection(CONNECTION_ODBC, oGvar:cDriverSQL, LONG(pSqlRet), LONG(pSqlRet))

    But the problem in the report that does not execute the substitution of tables, continues.

    Gerard

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 18 Mar 2022 17:42 #21981

    • robert
    • robert's Avatar


  • Posts: 3600
  • Gerard,
    Can you prepare a small stand alone example that demonstrates this ?

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 18 Mar 2022 21:22 #21982

    • gjbiagiotti
    • gjbiagiotti's Avatar
    • Topic Author


  • Posts: 33
  • Hello, Robert
    I pass a complete code example that works and generates the problem that I have already commented on.
    This report uses 2 SQL tables in design mode and one of those tables has a different name in execution mode.It is a table of tax withholding codes that is linked to a second table of accounts in the company's accounting.In the attached image, the description of each ledger account should appear in the column on the right that is blank.
    Attached image and method.

    Gerard

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 18 Mar 2022 22:07 #21983

    • gjbiagiotti
    • gjbiagiotti's Avatar
    • Topic Author


  • Posts: 33
  • Robert
    Yesterday I downloaded version 2.10c of X#, and in Windows 11 it doesn't run directly.

    Gerard

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 18 Mar 2022 23:41 #21984

    • gjbiagiotti
    • gjbiagiotti's Avatar
    • Topic Author


  • Posts: 33
  • Hello
    Another problem I found with the report is that in the following command:
    oReport:SetTableStringAttribute( 1, "DSN", SQLQUERY_ATTR_SQL_ORDERBY, "table.order")

    If you refer to the table name it throws an error, if you just use the field name it works fine.

    Error:
    oReport:SetTableStringAttribute( 1, "DSN", SQLQUERY_ATTR_SQL_ORDERBY, "customer.code")

    No error:
    oReport:SetTableStringAttribute( 1, "DSN", SQLQUERY_ATTR_SQL_ORDERBY, "code")

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 19 Mar 2022 07:52 #21985

    • robert
    • robert's Avatar


  • Posts: 3600
  • Gerard,

    gjbiagiotti wrote: Robert
    Yesterday I downloaded version 2.10c of X#, and in Windows 11 it doesn't run directly.


    What do you mean with "doesn't run directly"?
    - the installer does not run (did you unblock the file, windows blocks the file when downloaded from the internet)
    - the VS integration does not work
    - the compiler does not work.
    - something else does not work

    Come on, as a programmer you should know that you need to be more specific than "does not run".
    My development machine is Windows 11. That can't be the problem.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 19 Mar 2022 07:57 #21986

    • robert
    • robert's Avatar


  • Posts: 3600
  • Gerard,

    gjbiagiotti wrote: Hello, Robert
    I pass a complete code example that works and generates the problem that I have already commented on.
    This report uses 2 SQL tables in design mode and one of those tables has a different name in execution mode.It is a table of tax withholding codes that is linked to a second table of accounts in the company's accounting.In the attached image, the description of each ledger account should appear in the column on the right that is blank.
    Attached image and method.


    This is not what I call a "complete example"
    - The code is part of a class that you did not include
    -and the sql data is not included.

    Please look at our issues list on Github for many examples of how you should report an issue.
    For example:
    github.com/X-Sharp/XSharpPublic/issues/997
    or
    github.com/X-Sharp/XSharpPublic/issues/995


    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 19 Mar 2022 13:43 #21987

    • gjbiagiotti
    • gjbiagiotti's Avatar
    • Topic Author


  • Posts: 33
  • Robert
    As you have said, the executable was blocked.
    Detail that I did not take into account since with version 2.8 I did not have that problem.
    But it was my mistake anyway.
    Thank you very much.

    Gerard

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 19 Mar 2022 14:37 #21988

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3367
  • Hi Gerard,
    probaby Windows 11 blocks your executable because it was downloaded from an internet page.
    That is a standard Windows behavior.
    You should right click the file in Windows explorer, uncheck this option (in my case German Windows 11), and save:

    HTH
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it
    Attachments:

    Please Log in or Create an account to join the conversation.

    ReportPro 3.9 and sql table swap 19 Mar 2022 14:50 #21989

    • gjbiagiotti
    • gjbiagiotti's Avatar
    • Topic Author


  • Posts: 33
  • Wolfgang
    That's what I did and I already have the latest version running.
    Thanks.

    Gerard

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1
    • 2