Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Subreport in Report

  1. #11
    Join Date
    Apr 2009
    Posts
    492

    Default Re: Subreport in Report

    ReportWriter 7.0.1, Dataflex 19.1, Windows 10:​

    Report with 5 subreports shows this error when changing something in
    Function AddRDSData String sTableName Integer iSibling Integer iLevel Returns Variant[][]

    see my example behind:
    If I change

    If ((zStaende[iRow][6] >= 16) and (zStaende[iRow][6] <= 40)) Begin
    to
    If (zStaende[iRow][5] = "WW") Begin

    then this error occurs. I think the only difference between these two statements is that with "WW" there are found more data.


    ---------------------------
    Unhandled Exception in Debugged Application
    ---------------------------
    UNKNOWN(0xc0000374) at address 0x7781FBE3 occurred in the program being debugged.

    The debugger will enter limited break mode so that you can inspect the problem.
    Use the callstack and other debugger windows to find out the cause of the problem in your program.
    ---------------------------


    Code:
    Procedure ComReportRefresh String llsId
            Handle hDispatchDriver
            Get phDispatchDriver to hDispatchDriver
            Send PrepareParams to hDispatchDriver 1
            Send DefineParam to hDispatchDriver OLE_VT_BSTR llsId
    the cursor stands on this next line:
            Send InvokeComMethod to hDispatchDriver 5 OLE_VT_VOID
        End_Procedure
    Code:
          Function AddRDSData String sTableName Integer iSibling Integer iLevel Returns Variant[][]
                Variant[][] vData
                Integer iRow iAnzOrder iBishOrder  j iObj k iAnzTage x ii //test
                Number SumPos nMin nMax nZW nSumposWasser2 nAnteilWasser2 nQm
                Boolean bWasser2
                Number[] tMinMax
                Variant[][] vDataHZ
                Variant[][] vDataHZ1
                Variant[][] zStaende
                Variant[][] vWasser
                Variant[][] vHeizung
    
    
                Case Begin
    
    
                  Case (iLevel = 1 and sTableName = "ZaehlerStaende")
                     Get pvZStaende to zStaende
                     Move 0 to j
                     Move (SizeOfArray(zStaende)) to ii
                     For iRow from 0 to (ii-1)
                       If ((zStaende[iRow][5]) ="KW") Begin     //<= 15)
                         Move zStaende[iRow][0] to vData[j][0]
                         Move zStaende[iRow][1] to vData[j][1]
                         Move zStaende[iRow][2] to vData[j][2]
                         Move zStaende[iRow][3] to vData[j][3]
                         Move zStaende[iRow][4] to vData[j][4]
                         Move zStaende[iRow][5] to vData[j][5]
                         Move zStaende[iRow][6] to vData[j][6]
                         //5.Showln
                         If (checked_state(oCheckWerteAusgabe)=True);
                         Showln vData[j][0] Tab vData[j][1] Tab vData[j][2] Tab vData[j][3] Tab vData[j][4] Tab vData[j][5] Tab vData[j][6]
                         //Showln zStaende[iRow][0] Tab zStaende[iRow][1] Tab zStaende[iRow][2] Tab zStaende[iRow][3] Tab zStaende[iRow][4] Tab zStaende[iRow][5] Tab zStaende[iRow][6]
                         Increment j
                       End
                     Loop
                     Set pvZStaende to zStaende
                  Case Break
                  
                  Case (iLevel = 1 and sTableName = "ZaehlerStaende1")
                     //Get pvZStaende to vData
                     //Move zStaende to vData
                     Get pvZStaende to zStaende
                     Move (SizeOfArray(zStaende)) to ii
                     Move 0 to j
                     for iRow from 0 to (ii-1)
                     //If ((zStaende[iRow][6] >= 16) and (zStaende[iRow][6] <= 40)) Begin
                        //Bisher c<= 32)
                     If (zStaende[iRow][5] = "WW") Begin
                        Move zStaende[iRow][0] to vData[j][0]
                        Move zStaende[iRow][1] to vData[j][1]
                        Move zStaende[iRow][2] to vData[j][2]
                        Move zStaende[iRow][3] to vData[j][3]
                        Move zStaende[iRow][4] to vData[j][4]
                        Move zStaende[iRow][5] to vData[j][5]
                        Move zStaende[iRow][6] to vData[j][6]
                        If (checked_state(oCheckWerteAusgabe)=True);
                        Showln vData[j][0] Tab vData[j][1] Tab vData[j][2] Tab vData[j][3] Tab vData[j][4] Tab vData[j][6]
                        Increment j
                     End
                     // //5.Showln
                     Loop
                  Case Break
                Case End
                Function_Return vData
            End_Function
    Last edited by Emil Preter; 26-May-2019 at 08:19 AM.

  2. #12
    Join Date
    Feb 2009
    Location
    Somewhere in Vermont, USA - unless I'm not
    Posts
    11,085

    Default Re: Subreport in Report

    Have you checked the value of zStaende[iRow][6]? Maybe it's not a number?

    And what's the Bisher c<= 32) line? Partial code? If it's in the original that gives the error - the "c" before the <= could be a problem - as well as no comparison (If) or opening paren.
    Garret

    Time for an oldie but goodie:

    "If it ain't broke, you're not trying." - Red Green

  3. #13
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,869

    Default Re: Subreport in Report

    Emil,

    First: In case of a crash the location in the source code may not say much.

    Then what could be the difference between the both IFs that would lead to a GPF? Does it crash on the IF statement or is it data afterwards?

    What happens if you export your test data to JSON and read this into the report and test from the DataFlex Reports Studio?
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  4. #14
    Join Date
    Apr 2009
    Posts
    492

    Default Re: Subreport in Report

    Hi Vincent,
    I have opened a Thread "How to create a Json File .......... " in Windows Applications because I don't know how to create a Json File to import it in ReportWriter! Please see there!

  5. #15
    Join Date
    Apr 2009
    Posts
    492

    Default Re: Subreport in Report

    the error occurs in Procedure RefreshReport with the instruction Send ComReportRefresh sReportId

  6. #16
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,869

    Default Re: Subreport in Report

    Emil,

    Please create a workspace/example that can be used to reproduce and debug the situation, upload to your HDE ticket. Make the example as small as possible to eliminate dependencies.
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •