Solved

Visual C#, Crystal Reporting with Subreports in Multiple columns

Posted on 2009-06-29
10
850 Views
Last Modified: 2013-12-17
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.


0
Comment
Question by:ArunVashist
  • 6
  • 4
10 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 24741890
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
 

Author Comment

by:ArunVashist
ID: 24748581
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 24751636
You can't nest reports.   A subreport cannot have a subreport.

mlmcc
0
 

Author Comment

by:ArunVashist
ID: 24753105
so there is no way to have two independent column in a report with subreports.
0
 

Author Comment

by:ArunVashist
ID: 24753709
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 100

Expert Comment

by:mlmcc
ID: 24759673
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
 

Author Comment

by:ArunVashist
ID: 24771626
No desired solutions... so decided to close on my own.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24774375
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
 

Author Comment

by:ArunVashist
ID: 24774699
Ok mlmcc,

my heartiest regards for you and full marks..
0
 

Author Closing Comment

by:ArunVashist
ID: 31598197
Thanks for your expert guidance.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now