Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Visual C#, Crystal Reporting with Subreports in Multiple columns

Posted on 2009-06-29
10
Medium Priority
?
859 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 1500 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 101

Expert Comment

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

mlmcc
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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
 
LVL 101

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 101

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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

604 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