Print Page | Close Window

Combine Select data from two records

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22239
Printed Date: 01 May 2024 at 8:48pm


Topic: Combine Select data from two records
Posted By: JWaldmann
Subject: Combine Select data from two records
Date Posted: 15 Feb 2017 at 7:29am
I have a data select issue I cannot handle. For each company in my Excel spreadsheet I have two records. I need to display some of the information from one of the records and other information from the second. As this is rather vague, I am attaching an image with highlighted cells to ultimately display.

Is this even possible; and if so, can anyone help me do this?




Replies:
Posted By: MLEL
Date Posted: 02 Nov 2018 at 8:14am
Greetings. Did you ever figure out your issue? I have a similar problem but it will involve selecting data from 4 - 7 records to complete a page.


Posted By: kevlray
Date Posted: 05 Nov 2018 at 4:04am
Cannot see image.  But if you have a field that unique that you can group on.  With formulas, you might be able to 'separate the data and display the data in the group footer (do not show details)


Posted By: MLEL
Date Posted: 05 Nov 2018 at 6:47am
I can speak to my issue -

My excel input file consists of multiple rows that contain a student name, grade, class title, block in which the class runs, teacher and room. A student will have from 4 to 6 rows depending upon how many courses she is taking.

The report is designed to use the block number to dictate via a formula where on the report the course title, teacher and room prints. Each course will appear in 5 boxes in a defined grid schedule.

I grouped the report by student, hoping that the multiple rows for a single student would be processed before breaking to a new page and the next student.

What I ended up with was a report consisting of up to 6 pages per student with one course correctly laid out on each page. My goal was to get all of the courses for one student on a single page before moving on to the next student.

Is this possible?

Thank you.


Posted By: kevlray
Date Posted: 06 Nov 2018 at 5:29am
For one thing, it appears that you have page breaks when you do not want them.  There are other objects that can cause page breaks (keep group together, keep object together, etc.). 


Posted By: MLEL
Date Posted: 08 Nov 2018 at 7:48am
Thank you for your kind replies.

I am obviously missing something. I tried grouping on the student ID, keeping the original order which is alpha within grade level. I have tried it by checking "Keep Group Together" as well as unchecking the option. I have tried various options within the Section Expert without success. (Although I have managed to make it worse, lol!)

I cannot find an instructional video online that hits on my situation that I find helpful. My expertise in Crystal Reports is minimal and self taught. We have version 11.5.12.1838 that was used in conjunction with a previous student information system. I am trying to build a better mousetrap, so to speak, when printing student schedules. I was hoping Crystal Reports would be my answer.


Posted By: kevlray
Date Posted: 08 Nov 2018 at 1:29pm
I wish I had a solution for you.  Unexpected page breaks are hard to track down.  Basically you need to find all the places where a Keep Group Together or Keep Object Together and uncheck the boxes


Posted By: MLEL
Date Posted: 09 Nov 2018 at 8:34am
Intuitively, I would have thought it a good thing to Keep Group Together when you want records to print as a group. :)

I will uncheck any such boxes to see where that gets me.

Thank you.


Posted By: DBlank
Date Posted: 09 Nov 2018 at 11:24am
It also sounds like you might have some unexpected line breaks or line feeds inside your data set.
I find it odd that it is a new pager per row even with the 'keep together' issue.
You might want to try to put lines around the fields to see if they are growing or to trim the fields to remove excess spaces or line feeds.


Posted By: MLEL
Date Posted: 12 Nov 2018 at 9:15am
The excel file is created from a query (a "list" in Blackbaud-speak) against the student information system database. There are no page breaks or carriage controls that I can find in the output. It is a pretty straightforward extract of a student's classes by term.

It is good to know - on one hand - that this seems like it should be a feasible report.

I wonder if it is the structure of the report. I have a series of formula fields to identify the block in which a class occurs and to format the text of the class info in the appropriate pattern of the schedule. Simple If/Then statements. Each record or row in the input file appears in multiple locations on the report grid that is the 7 day schedule, representing one class. A student will have up to 6 records to identify her full schedule. The schedule grid is 5 rows with 7 columns where up to 30 of the 35 "bins" should contain class information.

The output now is 5 bins (of 35) for one class per student, per page. A student will have up to 6 pages in my current configuration.

I truly appreciate your time in helping me with this.

Thank you.


Posted By: MLEL
Date Posted: 14 Nov 2018 at 5:39am
Well, I think I know what is wrong - I just don't know if I can make it work in Crystal Reports.

My details section is a grid where I have a series of formula fields set up to populate the grid. One class will have data scattered throughout the grid, occupying a distinct 5 cells of the 35 in the grid. The next class will have its distinct 5 cells in the grid and so on.

The details section is the bulk of the landscape oriented report. I am trying to populate a single details section with multiple records, not moving on until I have a new student ID. My guess is that since only one details section fits on the page, it is advancing to the next page to serially print out the next details section.

Is there a way to overlay a set of details sections, layering the courses over each other (there shouldn't be a conflict) to build up a full picture of all classes for a student? If I could have a details section for each block pattern and overlay them before advancing to the next page, it might work.

Thank you for your time.


Posted By: MLEL
Date Posted: 19 Nov 2018 at 4:54am
I believe I know why my report is behaving the way that it is. I am not sure if there is a solution I will like, lol.

I am trying to populate one, common detail section using multiple records. The reason I am getting only one record per page is because the grid layout of my details section is designed to only fit one per page. Of course it advances to the next page with the next input record. My bad.

Is there a way that I can populate a table (my grid) using multiple records but only print it when there is a key data change - the next student? Could I use the group footer section for something like that?

Thanks again for your time.


Posted By: MLEL
Date Posted: 07 Dec 2018 at 9:32am
Thank you to all who have taken the time to respond.

My problem is that I am trying to cull data from multiple records for a single detail line. It just isn't working.

I have tried to build my output as a group footer that prints with a group change, but that is also unsuccessful.

Is there an ability in Crystal Reports to build a two dimensional table and print that table upon a change at a group level? That way I can process all the needed records, formatting them in a table, to print them at a change in the student ID.

Is this possible?

Thanks.



Print Page | Close Window