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.
    <br />
    <br />the source of the subreport is changed based on the ID of the current Record.
    <br />
    <br />I am using this code:
    <br />
    <br /> OrderID= csng(rpt.Fields("CurrentOrderID").Value)
    <br /> If Len(OrderID) > 0 Then
    <br /> rpt.SubProducts.Object.DataControl1.Source = Replace(rpt.SubProducts.Object.DataControl1.Source,"-999999",rpt.Fields("CurrentOrderID").Value)
    <br />
    <br />
    <br />This code is on the OnFetchData Sub.
    <br />
    <br />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 :)
    <br />
    <br />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.
    <br />
    <br />I just need to record that somewhere to know what to lool for on the next loop.
    <br />
    <br />
  • Replied 4 August 2017, 3:13 pm EST

    fcoreyesv,<br>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.<br>
Need extra support?

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

Learn More

Forum Channels