on 10-10-2008 6:56 PM
Is it possible to programmatically set the position of a subreport inside
of a section? I am currently programmatically creating subreports inside
of a report.
If I add a new detail section for each subreport it works fine,
but I quickly exceed the maximum number of sections. I tried adding
multiple subreports to the same section, but they end up on top of each
other.
Is there a way to have 2 objects above of each other in the same
section, both with the "Enable Can Grow" property set to true and the top
one bump the bottom one down?
I am using VB.Net with Crystal XI
(Please don't send this to the design team, I am doing this programmatically
- not using the designer)
Hi Jeff,
Yes, use the object browser and find or search on Top, Left and Height...
CrystalDecisions.CrystalReports.Engine.ReportObject.Height
The subreport is an object but to set the size and location use the main report objecttype = subreport
What you want to do is set the subreport object top, left and height and use the Can grow option also. When this is turned on it should push the following subreport down the page... Generically when inserting the subreports space them accordingly.
Just one warning, for each subreport that is inserted it will make a new database connection. If you place the subreport in the detail section for instance for every record returned it will run the subreport and thus open up a DB connection etc. Example: Main report returns 1000 records, 2 subreprots in the detail section will cause each subreport to run 1000 times. Just be careful how you layout the report or your users/customers will see a huge delay in report processing.
Thank you
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jeff,
to give yuou some more hints you can download a CS sample for VS 2005 [How to add a Subreport|ftp://ftp.businessobjects.com/pub/incoming/NET-CS2005_RAS-Unmanaged_CR115_Add_Subreport.zip].
This sample demonstrates how to add a subreport using unmanaged inproc RAS.
I hope it answers all your questions.
Best regards
Falk
Falk,
The example you refer to just shows how to programmatically add a simple subreport, I don't have any problem with this. I need to know how to align the top and height of each when I have many subreports to programmatically add. I think Don's suggestion should be the solution, but I cannot find this object he is referring to.
Adding 1 per section works, but is limited. I need to know how to determine the height of each subreport and then set the top accordingly on each of them.
Thanks,
Jeff
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.