Invalid Section Height when I load the nth subreport

I am attempting to load multiple sub-reports into a master report document. The process is:
Use the RAS SDK to obtain a reference to the detail area
Add a section to the detail area
Import the subreport into the detail area
The code is pretty simple as well.
        private ReportDocument AddSubReportToParent(string subReportName, string fileName)
            try
                CrystalDecisions.ReportAppServer.ReportDefModel.ISCRArea detailArea = _crystalDocument.ReportClientDocument.ReportDefController.ReportDefinition.DetailArea;
                CrystalDecisions.ReportAppServer.ReportDefModel.Section section = new CrystalDecisions.ReportAppServer.ReportDefModel.Section();
                string sectionName = "Section" + subReportName.Replace(".", "");
                section.Name = sectionName;
                section.Kind = CrystalDecisions.ReportAppServer.ReportDefModel.CrAreaSectionKindEnum.crAreaSectionKindDetail;
                section.Width = headerArea.Sections[0].Width;
                _crystalDocument.ReportClientDocument.ReportDefController.ReportSectionController.Add(section, detailArea, -1);
                _crystalDocument.ReportClientDocument.SubreportController.ImportSubreport(subReportName, _configSettings.InputPath + "\\" + fileName, section);
                ReportDocument subreport = _crystalDocument.OpenSubreport(subReportName);
                return subreport;
            catch (Exception ex)
                Logger.ErrorException(this.GetReportBuilderErrorText(this.GetReportBuilderErrorText(String.Format("Unable to add subreport '{0}' from file {1} to custom Crystal Report", subReportName, fileName))), ex);
                throw;
However, when I attempt to load the 41st report (or sometimes greater) the ImportSubreport method throws an exception with the message, "Invalid Section Height". Note that I have one section for each report. This is to make it easier to place the subreport on in the document and on it's own page.
I cannot seem to determine what is going wrong. Why would the 41+ import fail?
I am using Crystal Reports Version for Visual Studio .NET, 13.0.8.

Hi Ryan,
No need to test, Ludek found this KBA:
1670453 - RAS Can't Create Objects in Crystal Report Sections Past
40
So your only work around is to create a template report with dummy subreports already embedded in it.
Here's something to get you started:
btnReportObjects = Text box
subreportClinetDocument.IsImported is a new API so you may need to upgrade CR for VS.
btnReportObjects.Text = "";
flcnt = 0;
foreach (String resultField in rptClientDoc.SubreportController.GetSubreportNames())
    SubreportController subreportController = rptClientDoc.SubreportController;
    SubreportClientDocument subreportClinetDocument = subreportController.GetSubreport(resultField);
    if (subreportClinetDocument.IsImported)
        textBox1 = "Imported: " + subreportClinetDocument.SubreportLocation.ToString();
        btnReportObjects.Text += textBox1;
        btnReportObjects.AppendText(" 'End' \n");
        ++flcnt;
        btnCount.Text = flcnt.ToString();
    else
        textBox1 = "embedded: " + " " + resultField.ToString();
        btnReportObjects.Text += textBox1;
        btnReportObjects.AppendText(" 'End' \n");
        ++flcnt;
        btnCount.Text = flcnt.ToString();
    CrystalDecisions.CrystalReports.Engine.ReportObjects crReportObjects;
    //set the crSections object to the current report's sections
    CrystalDecisions.CrystalReports.Engine.Sections crSections = rpt.ReportDefinition.Sections;
    if (resultField.ToString() == "World Sales Report.rpt")
        //loop through all the sections to find all the report objects
        foreach (CrystalDecisions.CrystalReports.Engine.Section crSection in crSections)
            crReportObjects = crSection.ReportObjects;
            //loop through all the report objects to find all the subreports
            foreach (CrystalDecisions.CrystalReports.Engine.ReportObject crReportObject in crReportObjects)
                if (crReportObject.Kind == ReportObjectKind.SubreportObject)
                    CrystalDecisions.ReportAppServer.ReportDefModel.Section rasSection;
                    rasSection = rptClientDoc.ReportDefController.ReportDefinition.FindSectionByName(crSection.Name);
                    CrystalDecisions.ReportAppServer.Controllers.SubreportClientDocument MyNewSub;
                    MyNewSub = rptClientDoc.SubreportController.GetSubreport(resultField.ToString());
                    CrystalDecisions.ReportAppServer.ReportDefModel.SubreportObject objSubreport = rptClientDoc.ReportDefController.ReportObjectController.GetAllReportObjects()[crReportObject.Name] as CrystalDecisions.ReportAppServer.ReportDefModel.SubreportObject;
                    CrystalDecisions.ReportAppServer.ReportDefModel.SubreportObject objSubreport2 = (CrystalDecisions.ReportAppServer.ReportDefModel.SubreportObject)objSubreport.Clone(true);
                    rptClientDoc.ReportDefController.ReportObjectController.Remove(objSubreport);
                    CrystalDecisions.ReportAppServer.ReportDefModel.SubreportLinks mySubLinks = rptClientDoc.SubreportController.GetSubreportLinks(objSubreport2.SubreportName.ToString());
                    mySubLinks.RemoveAll();
                    objSubreport2.Left = 10;
                    objSubreport2.Height = 10;
                    objSubreport2.Width = 10;
                    objSubreport2.Name = "sub1";
                    objSubreport2.SubreportName = "sub1";
                    //rptClientDoc.ReportDefController.ReportObjectController.Modify(rptClientDoc.ReportDefController.ReportObjectController.GetAllReportObjects()[crReportObject.Name] as CrystalDecisions.ReportAppServer.ReportDefModel.SubreportObject, objSubreport2);
                    rptClientDoc.ReportDefController.ReportObjectController.Add(objSubreport2, rasSection, -1);
I don't recall now what I was testing but all of the basics are there to replace the dummy subreports with your new ones.
I DID NOT test this with more than 40 subreport objects either so you may still run into the SDK limit. We may have to ask the Report Designer Resource if this can be handled in the report by using Conditional suppression...
Don

Similar Messages

  • DIM IDu0092s are polluted only when we load the Master data and SIDu0092s

    DIM ID’s are polluted only when we load the Master data and SID’s are polluted only when load the retraction data. System automatically performs the reconciliation of DIM and SID’s  when we delete the transaction and master data.
    a.     True
    b.     False

    Hi,
    You can use the mapping section of the transformation file for this purpose. It should be something like:
    *COL(5) + *Str(_) + *COL(1)
    I am considering that the 5th column of your file is the property. The 1st column is the ID.
    Please take a look at the below link for more information:
    http://help.sap.com/saphelp_bpc75_nw/helpdata/en/5d/9a3fba600e4de29e2d165644d67bd1/content.htm
    Hope this helps.

  • Rpt: Invalid section height.

    Hi to all,
                  I'm using Asp.net 2.0-C# and Crystal Report 11.5.
    I have a table with N number of records, i bind all records dynamically now i meet this problem
    Error in File C:\DOCUME1\D3326\ASPNET\LOCALS1\Temp\Cr_ExportToExcel {DCA1604B-76DE-4E89-8502-274969D5D6E6}.rpt: Invalid section height.
                    I checked my code, my the final Fiedlobject top position is 34100, i came to know crystal report doesnt support greater then height 32,767 from
    http://www.forumtopics.com/busobj/viewtopic.php?t=106646&view=next&sid=29c694f5aa0a7d2fca31404ca09a3274
    this web site. If it's true then how can i solve this problem,
    becuase i have nearly one lakh records.
    Actualy i display my records like this
    ColumnName  Data   ColumnName  Data
    ColumnName  Data   ColumnName  Data
    so i'm using only one detail section object because no need of heading section.
    Experts please help me.
    Thanks in advance.
    Edited by: winseelan j on Sep 29, 2008 7:20 PM

    You will have to use RAS. This sample app shows you how to create sections at runtime:
    https://boc.sdn.sap.com/node/6304
    More sample apps are here:
    https://boc.sdn.sap.com/samples/84/1194
    And the developer libraries is here:
    https://boc.sdn.sap.com/developer/library
    Ludek

  • I just bought a Macbook Air and a usb super dive.  How do I install MS Office 2003 on it?  It won't launch the install when I load the disk in the superdrive.

    I just bought a Macbook Air and a usb super dive.  How do I install MS Office 2003 on it?  It won't launch the install when I load the disk in the superdrive.

    A 2003 MS office sounds like a Windows version.  A 2004 MS Office that was Mac compatible can not be run natively on a new MBA since the Lions do not run PPC applications.  You will have to get a newer edition of MS Office that is compatible with your new MBA.
    Ciao.

  • I have a new Linksys router.  When I load the accompanying CD it informs me that it supports OS 10.5.8 or later, OS 10.6.1 or later, and OS 10.7 or later.  I am running 10.9.2, which apparently isn't supported by this Router.  Any suggestions?

    I have a new Linksys router.  When I load the accompanying CD it informs me that it supports OS 10.5.8 or later, OS 10.6.1 or later, and OS 10.7 or later.  I am running 10.9.2, which apparently isn't supported by this Router.  Any suggestions?

    No they should be agnostic about what is behind them, but as to support for IP6, or whether any computers or tablets can use AC... and hasn't Apple's own units sometimes stop being supported with new Mac and new versions of OS X? seems so.
    I said above, why would anyone install any kind of software to use a router? although Netgear's GEnie is or was installed on my systems that adds a nice way to log in and manage the router, so I have to take that back a notch.
    Support for modems and ISPs is a concern, my modem is not certified fully with DOCSIS 3.0 or  FIOS.
    Look around and you can find routers having trouble with some network services like Airplay, printing and scanning, the software bundled with router.
    However, ethernet chips, and the driver, can be a factor. Problems with Intel networking chip and high bandwidth streaming and not being able to handle the load when used by wifi euipment like notebooks and other devices.
    I have only seen the LARGE number of complaints on MacBook forums about wifi issues to suspect something is wrong but not sure what. And those are people that depend on wifi I assume, though some could use their Thunderbolt equipped Mac to use ethernet to get around the problems. And I am seeing the same thing with some Windows users and maybe they all have common Intel chips???
    MacBook Pro constantly losing wireless connectivity
    I use Windows 8.1 primarily. I also don't know enough or as much to know "Why is the sky blue" either.
    Just pass along this example:
    If you're setting up a new PC for the first time, check if your router is fully compatible with Windows. Because of the new networking features in Windows (8.1), some older network routers aren't fully compatible and can cause problems. For a list of routers that are compatible with Windows 8.1 and Windows RT 8.1, go to the Windows Compatibility Center.
    Anyone remember when 10.4.0 had so many issues with LAN that it could not be used, work on fix was going on and wasn't complete until 10.4.2/4.3 (and first time we got a new full 10.4.3 DVD because customers needed a reliable system.

  • PC went south. Geeks brought it back. PS elements and premier 11 can't start. Error msg sez configuration incorrect needs to be reinstalled. When I load the disk I get a blank screen. Try to uninstall and can't find apps i control panel. How can I get the

    PC went south. Geeks brought it back. PS elements and premier 11 can't start. Error msg sez configuration incorrect needs to be reinstalled. When I load the disk I get a blank screen. Try to uninstall and can't find apps i control panel. How can I get the apps back?

    adobeamatuer
    Thanks for the reply.
    Although the security of Windows XP SP3 32 bit is compromised by Microsoft no longer supporting XP, if Windows XP was restored as claimed, you should still be able to install/uninstall Premiere Elements versions of it that you did before the Microsoft support removal.
    I think a revisit to the Geeks would be in order. It may be that they could not restore Windows XP because of the Microsoft non support. I would take along the Premiere Elements installation disks so that you do not leave there without actually seeing Premiere Elements (or a non Adobe program) running on your restored Windows XP. What was the other software that you tried to use that did not work?
    Please update us on your progress when you get a chance.
    Best wishes
    Thanks.
    ATR
    Add On...spelling correct 12 03 2014.

  • I'll ask this again.  I'm running Yosemite, LR 4.4 everything was running fine and I'm not sure if this is connected but when I loaded the last security update from Apple I started getting the "no content" box when I tried to publish to LR (Facebook OK),

    I'll ask this again.  I'm running Yosemite, LR 4.4 everything was running fine and I'm not sure if this is connected but when I loaded the last security update from Apple I started getting the "no content" box when I tried to publish to Flickr (Facebook OK), now I can't get it to authorize, I loaded 3rd party JR plug in and still get can't authorize.  Can anybody help?  Basically LR is useless, it has been nothing but problems.

    It would probably be better to continue your previous thread on the same question than to start a new one.

  • TS1292 I'm trying to activate my itunes gift card but it keeps saying invalid code. When I follow the iTunes support it keeps taking me round in circles to the same page. What do I do?

    I'm trying to activate my itunes gift card but it keeps saying invalid code. When I follow the iTunes support it keeps taking me round in circles to the same page. What do I do?

    I imagine a ton of people are attempting to activate after the update, and the server is getting overloaded. Simple patience, maybe keep trying, and if possible, try a little later. Think of it as all those people lining up at Apple Stores + about a million more.

  • I am trying to install premier elements 11 that I purchased back in 2012 on a new machine with 8.1. I get "invalid serial number" when I enter the serial number I received with the original activation e-mail when I purchased the product, thanks!

    I am trying to install premier elements 11 that I purchased back in 2012 on a new machine with 8.1. I get "invalid serial number" when I enter the serial number I received with the original activation e-mail when I purchased the product, thanks!

    Error "The serial number is not valid for this product" | Creative Suite

  • I have followed every forum's direction and continue to get an error 100 when I load the adobe installer assistant and try to sign in to complete the download of Adobe Pro XI trial.

    I have followed every forum's direction and continue to get an error 100 when I load the adobe installer assistant and try to sign in to complete the download of Adobe Pro XI trial.

    Hi Stacy ,
    Please refer to the following link to get details and solutions about Adobe Download Assistant .Please see if that fixes the issue.
    https://helpx.adobe.com/creative-suite/kb/troubleshoot-download-assistant.html
    Regards
    Sukrit Dhingra

  • Icloud download is incomplete. When I load the control panel it only partially loads. I do not get the page that offers feature

    icloud download is incomplete. When I load the control panel it only partially loads. I do not get the page that offers features. Also when I look in my Windows Programs it shows that the icloud program has loaded 80MB vs 42MB. Can someone pelase help

    Uninstall iCloud and reinstall it (reboot in between)

  • When I loaded the new ios7 software I  found that now the kindle app will not sync my "furthest page read" from iPad, or vice versa. Can someone help me?

    When I loaded the new ios7 software on my ipad, I found that I could not sync my iPad with the kindle app.  I hesitate to delete the app and reload it in fear I will lose all my books.  Can anyone help me?

    Ask in the kindle forums.
    Isn't all your kindle stuff archived by amazon, so that you can't lose it by deleting the app?  In any case, nothing to do with Apple.

  • I tried to play candy crush, but when i launch, app closed. I tried all (reset, restart, reload, etc.) I have the app on my pc, but even if i try to sync, the app do not apply on my iphone. When i load the app direct on my iphone, same proplem, can t open

    i tried to play candy crush, but when i launch, app closed. I tried all (reset, restart, reload, etc.) I have the app on my pc, but even if i try to sync, the app do not apply on my iphone. When i load the app direct on my iphone, same proplem, can t open

    Thank you for your help are you aware of any apps that will work the iso 4.2.1 system that will let you watch movies on the phone. Also I tried to down load something else the other day and got message that Safari wont let you open this is ther any to see if i have the latest safari on my phone?

  • Works fine on macs but when i load the page on p.c i get 404 media not foun

    works fine on macs but when i load the page on p.c i get 404 media not found. Which is odd since it works on any mac i've tried on the same network, does anyone have any ideas?

    I too am having the 404 media not found on my blogs, but its on both my mac and pcs. I am wondering if your macs can see it because of them being bound to the server?? Just an idea, which doesn't help me at all. So if you find a way to fix it please please post it.
    Kcam1999

  • When is loaded the SID Table?

    Hi,
    I thought that the SID table is filled when a Cube is loaded or when the Masted Data Attribute is loaded.
    But we are facing a problem with the InfoObject 0ACTIONREAS (it has the 0ACTIONTYPE as compounding).
    When we load the cube it says "No SID found for value 'Z317 ' of characteristic 0ACTIONREAS".
    This InfoObject has a datasource to load the Text but not the Attribute (althoug it has checked the Master data attribute).
    What could it be happening?
    Regards, Federico

    This is a data quality issue, it appears. You state that the message being thrown is:
    "No SID found for value 'Z317 ' of characteristic 0ACTIONREAS".
    If you notice, the value has a space at the end, which SAP BW chokes on, and therefore cannot generate a SID for that value if one doesn't exist. You're going to need to modify the transformational logic for the target of this Characteristic by changing it to a Formula and using the R_TRIM function, to trim the space off of the value. SAP BW doesn't allow values to have a space at the beginning or ending of a Characteristic and will throw this error when it's encountered.

Maybe you are looking for