cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Position Several Subreports so they "jigsaw" together

Former Member
0 Kudos

I am struggling with getting several subreports to layout so that they kind of jigsaw together.  What I mean is I want zero additional white space vertically and horizontally between my subreports.  Similar to the below schema:

I have tried several things after reading many posts and am still stumped.

I got close with

  1. Placing my largest subreport in a section for which I selected "Underlay Following Sections"
  2. Positioning my subreports in individual sections to the right of the main subreport in a single column

The resulting report did not show any of the subreports until the second page so I had a whole bunch of unacceptable white space.  (This thing should really be a one page report whenever the data allows).

My next attempt was to arrange subreports around the bigger subreport and then right click each subreport, selecting Format Subreport, and unchecking Keep Together.

This was also a no-go as you can see from the following image of the resulting report (black-outs for confidentiality):

Fine.  I then bought a book which mentioned SubreportObject for use with RAS SDL version XI.  This led me to searching com.crystaldecisions.sdk.report.definition and wondering if there is a way to grab the position of a subreport then add roughly 0.025 inches to the X and Y postions to code where the next subreport should be positioned.

My questions are really: 

  1. How can I make these report objects "jigsaw" together?
  2. If this has to be done programmatically; EXACTLY what code should I be writing  (gettop(), getheight(), getwidth(); then what?) & where should I be putting it? In a formula field from the size a position dialog box?  Where?

I only know enough to be dangerous--no where near enough to infer any kind of usable past programming knowledge.

Please help!

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Laura,

It will be very difficult to achieve the exact jig-saw structure you want. Subreports 'can gow' and the moment you separate them into sections, you're bound to have the whitespaces. If you keep them in the same section, they overlap. 'Underlay following sections' won't help much as it takes care of one of the Subreports only, the others will still overlap onto the first one.

I do remember a similar discussion sometime back (with a similar structure as yours) here on SCN where Jamie came up with a wonderful workaround. I've searched and I can't seem to locate the thread now, however I do remember the workaround.

Of course, this won't be exactly the structure you want, but you have something to take back to the client. Try this:

1) Create a report pointing to any datasource

2) Insert multiple details sections - one each for a Subreport. So if you have 6 Subreports, insert 6 details sections. Don't place any fields from the current datasource in the Details Sections

3) Place the Subreports one below the other and make sure the sections are just as large as the subreports' heights - use the 'Fit Section' option for a better fit

4) Go to the Section Expert > Select the Details Section > Check the Option 'Format with multiple columns' > Go to the Layout tab > Set the width, perhaps around 3.5 or 4

Let me know how this goes.

-Abhilash

Former Member
0 Kudos

Thank you for your rapid response.  So far it isn't turning out the way I had hoped.  I think I have to resign myself to working with something not exactly in-line with my hopes and dreams. 

I do wonder if anyone out there knows a way to find the position of objects at runtime so you could build position codes for other objects.

Answers (0)