Solved

Visual C#, Crystal Reporting with Subreports in Multiple columns

Posted on 2009-06-29
10
851 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal Reports 2008 6 26
Crystal Reports total formula with groups? 4 38
Help with sorting data in Listbox using VB.NET 3 53
Vb. Net application freezes 9 31
Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

21 Experts available now in Live!

Get 1:1 Help Now