views:

315

answers:

1

The simplest example that I can provide for what I want to do is this:

I need to create a Report, whose only requirement is that I have (4) of the same subreport on the page (imagine 4 portrait-oriented post cards on a page), each quadrant using a separate row from my datatable, yet all 4 are identical in terms of fields. If there are more than 4, it needs to carry over to a new page with the same format.

I'm using C# and the built-in Crystal Reports Basic for the task.

+1  A: 

Couple of suggestions:

  • What about structuring your subreport to have two entries side by side, bind two rows to that subreprt, and handle formatting such that the last one on the right side is blanked should you have an odd number of rows?
  • Or there may be a way to specify your page size to be 1/4 of the full page size (4.25 x 6.5 inches) and then fit four reports on one page.
John at CashCommons
Both sound like great ideas, the second one sounds like the least work, but will Crystal handle the report like that? I know it will fit 2 vertically, but will it also fit another to the right of the original subreport?I'm not sure how to bind 2 rows to the subreport's definition... I thought that was an impossibility, until you suggested it.
C. Griffin
Binding two rows to a subreport would be in the code. It would break encapsulation of whatever object structure you have (now you have a "Siamese" object that joins two of your original object) but then you can print two wide without having side-by-side subreports. As for the second suggestion, that may even be a printer setting (four per page) but you'd probably want to be able to format them in code and not rely on the printer being able to do that for you.
John at CashCommons
Thanks, John. I got exactly what I wanted by following up on your second suggestion. On the main report, by inserting a "subreport", and setting the box's size to be the size of the full-page, I was able to then set the subreport's detail size to be the exact height/width that I wanted. In the section expert (of the detail of the subreport), I specified multiple column layout, and by restricting the height/width to fit within the mainreport's subreport box (4 times), it tiles perfectly -- even from left to right then down (with the aid of a checkbox in the section expert).
C. Griffin
That's good to know! Glad my "spider senses" helped. ;)
John at CashCommons