Solved

Crystal report referencing another report

Posted on 2013-05-11
7
429 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

19 Experts available now in Live!

Get 1:1 Help Now