Solved

Crystal report referencing another report

Posted on 2013-05-11
7
466 Views
Last Modified: 2013-05-12
I have a report which sorts by 'Room numbers' and calculate duration from 'Entry' and 'Exit' data, this data is compiled from a SQL database table from one system. I then have a second 'folio' report which is also sorting by 'room-number' and compile data from a different Database table/source. Room numbers, registration data booked in from 'date' to expiry date is reflected in this report.

When I eventually get the first report data to reflect duration properly I will need to find a way to 'reference the second 'folio' reports by room number to get a count of how many days each room number was actually booked for. This combined data will then be used to show the actual duration a patron was parked inside the facility. (Total registration period from the folio - Total Duration spend outside the facility)

I'm using Visual cut to transfer separate data tables from separate sources into one local database and separate tables, which makes it easier to work with when creating the 2 reports.

Is there a way to reference the room number in the folio report from the main report or carry multiple room number (Array, stored variable) to the main report ?
0
Comment
Question by:John-S Pretorius
[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
  • 4
  • 3
7 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 39158268
You can't reference data from another report unless you include it in the report as a subreport.

Since you are putting the data into a single database how about using both tables in the report to get the data you need.

mlmcc
0
 

Author Comment

by:John-S Pretorius
ID: 39158276
I have tried that but can only use 'room-number' to link them and the data is not the same from the one to the other so when you do this the data is all over the place no matter how you construct it.

I was thinking of including the second report in the main report as a sub report, how will I reference it if I have it in the main report as a subreport ?
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39158350
First make sure you link the subreport in correctly.
Probably at lest by room number

Basic method

In the main report report header add a formula

WhilePrintingRecords;
Shared NumberVar MyNumber;
""

In the subreport add a formula to set the value
WhilePrintingRecords;
Shared NumberVar MyNumber;
MyNumber := 45;  //Use some formula or expression
""

IN the main report in a section after the subreport add a formula

WhilePrintingRecords;
Shared NumberVar MyNumber;
myNumber

mlmcc
0
Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

 

Author Comment

by:John-S Pretorius
ID: 39158358
Question,

Since I have multiple groups (Room numbers) in the main report and in the subreport will the subreport 'value' populate in each one of the main reports Group headers ?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39158531
You will have to put the subreport in the group header by itself.
add a second group header and move what is in the group header to it
Put the subreport in the group header

mlmcc
0
 

Author Comment

by:John-S Pretorius
ID: 39158835
Thank you for your input, you have always been extremely on the dot with everything. Before I jump into this approach would you mind having a look at my snapshot and actual 'saved' report data.

I have finally figured out to get the duration for daily movements In and out, and want to take/reference the main report with them or visa versa with values 'Parked' and 'Not Parked'

Snapshot
Do you think I will be able to do this by having the main report as the Folio data and fill out the 'Skidata movements' and 'Total Duration' by 'carrying from the Subreport (Skidata Movements) based on room number ?

Appreciated.
SkiUsers-localDetailed.rpt
GALT-Folio-Raw-Local.rpt
0
 

Author Closing Comment

by:John-S Pretorius
ID: 39159428
I got it to work by following your Instructions, thank you - RUNS slow as expected by I am happy with the results which is as required.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Suggested Courses

734 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