Solved

Crystal report referencing another report

Posted on 2013-05-11
7
450 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
  • 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
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 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