Subreport and XLS Data

edited September 2013 in End User
Delphi 2010
We upgraded Report Builder from 12.02 to 14.08

After the upgrade our subreport detail band data/components are no
longer being exported when printing to XLS Data file.

I can go into the subreport File/PrintToFileSetup and add the components
but this presents several issues:
1. Once I explicitly add the subreport detail band controls to the
Selected Controls List I then also have to add the detail band
components on the main report.
2. The components are exported in the order they appear in the
Selected Controls List, which is in creation order by default. Need a
way to sort in order of left position as was the previous default.
3. We have hundreds of reports (over 600) containing multiple
subreports. To do this manually (including sorting the controls
properly) would take weeks.

Is there any way to revert to the previous default behavior of printing
the subreport detail controls (in left position order) without manually
modifying every report template?


  • edited September 2013

    Export to XLSData works the same as in prior versions.

    1. The default behavior is that text elements in the main report's detail
    band are exported in left to right position order. Subreport elements are
    not exported.

    2. The File | Print To File Setup dialog can optionally be used to specify
    the elements to export and the order in which they will appear. (Once you
    specify the which elements to export, then those are the only ones that will
    be exported whether that is for the main report, subreport, etc. So if you
    want some main report elements and some subreport elements, then you need to
    use Print to File Setup dialog for each report/childreport).

    I just compared the code for TppFileDevice.GetDrawTextCommandsForDataExport
    (ppFileDev.pas) for RB 12, RB 14, RB15. You can do the same for your
    installation. The code has changed only slightly - bug fixes and to support
    a minor enhancement in RB 15 we added a IncludeSingleHeader,
    IncludeSingleFooter feature.

    Nard Moseley
    Digital Metaphors

    Best regards,

    Nard Moseley
    Digital Metaphors
  • edited September 2013
    Nard, compare the code to your heart's content and then tell the
    hundreds of users on our system that nothing has changed...

    I can run an executable compiled before we upgraded and the subreport
    data is exported to XLS data file just fine. We have been users of
    Report Builder for 12 years now...THIS IS A SERIOUS INQUIRY!!!! DO NOT
  • edited September 2013

    I re-read my post and no malicious intended. I was expecting the
    conversation to continue, thought maybe you would do some more checking on
    your end, thought maybe you had been using a third party XLS export in the

    I installed RB 12.05 and created a simple example - a customer/orders report
    using the DBDemos data. I exported to XLSData and only the main report's
    detail elements are exported. I next installed RB 12.02 and performed the
    same test. It works as you describe, the subreport detail elements are
    included. I checked the bug fix history and on Sept 15, 2010 a bug fix was
    made so that only the main report detail elements are exported. In the
    Annoucements newsgroups the RB 12.03 release notes contain the line item

    - TXT/XLSData. By default only export detail elements for the main

    Unfortunately here we are 3 years later with your users expecting the
    XLSData export to work in a manner that was never intended. For now I
    recommend modifying the source code. In a future version I'll try to add an
    option to XLSSettings.

    To modify the source code, open ppFilDev.pas and find the method
    GetDrawTextCommandsForDataExport. In that method change the following

    // RB 12.03 and beyond
    if (lDrawText.BandType in lDefaultBands) and ((lDrawText.ReportSaveNo mod
    1000) = 0) then
    lDefaultList.AddObject(lDrawText.Order, lDrawText);

    // RB 12.02
    if (lDrawText.BandType in lDefaultBands) then
    lDefaultList.AddObject(lDrawText.Order, lDrawText);

    Nard Moseley
    Digital Metaphors

    Best regards,

    Nard Moseley
    Digital Metaphors
  • edited September 2013
    Nard, thank you for the reply! That "fix" (bug fix reversion) worked
    great. I figured it would probably be a one-liner but was a bit freaked
    out by your brief response. I apologize for my aggressive response. I
    had upper management breathing down my neck to get their financials back
    online and the concept of having to manually adjust every report was not
    going to sit well with them. Thank you for taking a closer look and
    getting to the root of the issue.

    It is humorous that the functionality we have come to depend on the past
    few years was realistically a bug in the code...
This discussion has been closed.