Sub Report issue

Posted by: fcoreyesv on 4 August 2017, 3:13 pm EST

  • Posted 4 August 2017, 3:13 pm EST

    I have a sub report that is showing the correct data of the first record on the main report, but it is not updating the (record)source to get the next data.

    the source of the subreport is changed based on the ID of the current Record.

    I am using this code:

    OrderID= csng(rpt.Fields("CurrentOrderID").Value)

    If Len(OrderID) > 0 Then

    rpt.SubProducts.Object.DataControl1.Source = Replace(rpt.SubProducts.Object.DataControl1.Source,"-999999",rpt.Fields("CurrentOrderID").Value)

    This code is on the OnFetchData Sub.

    One way it works is loading and uploading the Subreport on the OnFetchData, but it takes a lot of time to process the report. I know it is not the ideal way to do it and I hope I am missing something :)

    Thanks in advance for any help.
  • Replied 4 August 2017, 3:13 pm EST

    I just realized my error. It works the first time because it finds the string -999999. but on the second loop, the source had a real ID value.

    I just need to record that somewhere to know what to lool for on the next loop.

  • Replied 4 August 2017, 3:13 pm EST

    I'm glad to hear you were able to find the solution to your problem.  If you have any other questions please feel free to let me know.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels