Visual C#, Crystal Reporting with Subreports in Multiple columns

Hi Friends,

I am developing a windows application in VS 2008 using C#, and has MS-Access database.
I am using bundled Crystal reporting feature of VS 2008 and I need to design a Crystal report with has 6-7 sub reports and requirement is like report will have two columns Left ( around 3.5 inch wide) and right (around 5 inch wide).

What I need to know is how to design a crystal report with 2 columns and put 4 sub reports in Left section and 2-3 sub reports in right section. Following is rought idea of required layout

--------------------------------------------------------------------------------------------
|                                                  |                                                                       |
|         Sub- Report 1                   |                                                                       |
|  ----------------------------------- |                                                                       |
|                                                  |                                                                       |
|         Sub- Report 2                   |                                                                       |
|                                                  |                                                                       |
|  ----------------------------------   |                   Sub Report 5                               |
|                                                  |                                                                       |
|               Sub-Report 3             |  --------------------------------------------------  |
|                                                  |                                                                       |
|  --------------------------------     |                     Sub Report 6                             |
|                                                  |                                                                       |
|             Sub-Report 4                |                                                                       |
--------------------------------------------------------------------------------------------

moreover Left section will continue to print on only left side even if right hand section has no data to print and same is true vice verse.

Thanks in Advance.


ArunVashistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Crystal doesn't support multiple columns like that.

The best you can do is put them in the same area with 4 on the left and shrink to 3 inches wide and the others on the left and shrink to fit.

Remember you will have to allow for margins on the printer so you probably only have 8" to play with.  If this willno be printed just displayed you could select the NO PRINTER option and set the margins to 0.

You will need to select the are for the subreport
Group header/footer or detail section

You can add additional sections by right clicking a section in the left margin and clicking INSERT SECTION BELOW

Repeat until you have 4 sections
The reason for this is that when a subreport grows it doesn't push objects in its section job but overwrites it.
You will have something like

DetailA
Subreport 1                                     Subreport 5
DetailB
Subreport 2                                     Subreport 6
DetailC
Subreport 3                                     Subreport 7
DetailD
Subreport4

The main issue is that the subreports in the same section will grow together so if one is larger than the other you will have white space in the other column

For instance
DetailA
Subreport 1                                     Subreport 5
Subreport 1                                     Subreport 5
Subreport 1                                     Subreport 5
Subreport 1
Subreport 1
DetailB
Subreport 2                                     Subreport 6
DetailC
Subreport 3                                     Subreport 7
DetailD
Subreport4

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ArunVashistAuthor Commented:
HI mlmcc,

thanks for the reply, well I have already tried this method but it is really not making sense with the layout, as you explained there is lots of wastage of space and reports look weird.

Well is there any way to use nested reports like.. I create a report which includes two sub reports left and right and in turn left and right reports also includes sub reports.

like

main report
Left Section [Sub report ]              Right Section [ sub report ]
     Sub Report 1                             Sub Report 5
     Sub Report 2                             Sub Report 6
     Sub Report 3
     Sub Report 4

I try to use this method but then I am not able to programatically change the datasource of sub reports please guide.
0
mlmccCommented:
You can't nest reports.   A subreport cannot have a subreport.

mlmcc
0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

ArunVashistAuthor Commented:
so there is no way to have two independent column in a report with subreports.
0
ArunVashistAuthor Commented:
Well Mlmcc,

Can you guide me to design a report which contains 6-7 subreports all fetching data from individual tables and are linked through common keycolumn. like

PatientDetails [PatientId : Pkey]
             |-- FamilyHistory [ PatientId : Fkey ]
             |-- Insurance       [ PatientId : Fkey ]  
|-- Schedule        [PatientId  : Fkey, ScheduleId : Pkey]
|-- PatientMedicine     [ ScheduleId : Fkey ]
|-- Medical Problem   [ ScheduleId : Fkey ]
|-- Review of System [ ScheduleId : Fkey ]
|-- Allergies                 [ ScheduleId : Fkey ]
|-- Assessments       [ ScheduleId : Fkey ]

Now let me explain this.. In our database we have a PatientDetails table which contains personal and contact information about patient, and FamilyHistory table contains details of family members. these table contains information which is collected once and is updated if required.

But in Schedule table we store Date of appointment, patientId and physicianId and use ScheduleId as Fkey in other tables to store data related to particular Date of Service. A patient can have multiple Schedule/Date of service records. and tables like PatientMedicine, MedicalProblem, ReviewOfSystem, Allergies, Assessments stores information for a particular Date of service relevant to PatientId.

Now I am trying to design a report as mentioned above with Left and Right section, where data related to particular date of service will appear on Left ( 5 sub reports) and patient other information will be displayed on right side (2 sub reports). Now I want to know the following things

1.  A good layout to display records
2.  Grouping of report based on PatientId and sub-grouping based on Schedule Id,
     means report shows every Patient data and every schedule data of same patient add a page break and then start printing next patient data.

3. How can I make same report print record of any particular patient and if possible selected patients.

4. How can i make same report print records of selected patient and selected scheduleIds.


thanks in advance

0
mlmccCommented:
I really don't know.

One idea you can try which will work if you can keep subs 1-4 on 1 page would be to have 7 detail section.  Insert a subreport into each.
You can then format the detail section to use multiple columns.

mlmcc
0
ArunVashistAuthor Commented:
No desired solutions... so decided to close on my own.
0
mlmccCommented:
As the HELP on closing says, sometimes the answer is It can't be done.  Thus my first comment is probably the answer since I basically said that then made a suggestion that might work.

mlmcc
0
ArunVashistAuthor Commented:
Ok mlmcc,

my heartiest regards for you and full marks..
0
ArunVashistAuthor Commented:
Thanks for your expert guidance.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.