Print Page | Close Window

printing twice the same data

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=2870
Printed Date: 19 May 2024 at 3:47am


Topic: printing twice the same data
Posted By: kaosvader
Subject: printing twice the same data
Date Posted: 09 Apr 2008 at 2:21pm
Hi, someone knows what I need to do to print tywice the information in the same sheet??, let me be clear, my report has the info about delivery money, but I need to have a "copy" of this info in the same report, but I dont know how to do it, please help me...
 
In advance, thanks


-------------
MCCC ALEX



Replies:
Posted By: BrianBischof
Date Posted: 09 Apr 2008 at 5:33pm
This can only be done using subreports. Put the same subreport on the main report twice to trick it into printing the data twice. I cover many tips and tricks about subreports in Chapter 9 of my Encyclopedia book. You can find out more about my books at http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20 - Amazon.com or reading the http://members.crystalreportsbook.com - Crystal Reports eBooks online.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: paulwpark
Date Posted: 19 Apr 2008 at 11:24pm
I try to avoid subreports whenever possible.  I learned this tip from this one developer.  Instead of using subreports, try using a cartesean join by joining your data with a table with 2 records.  This way, your report will go through the data twice and you can use that data to show the data differently on the same report.


Posted By: theBlueFrog
Date Posted: 22 Apr 2008 at 4:33am
Alternatively (and more or less the same solution as paul's, only neater ;-) ), you could create an SQL view that joins 2 identical SELECT statements together in a UNION join, and add a field to the end with a 0 for rows in the first SELECT statement, and a 1 for rows in the second SELECT.
 
Then group by the 0 or 1 field in the report.
 
Then you've created no extra table to 'fudge' your report - just a view that does the job and contains the correct data for the report (and will probably run a little quicker than the table join, too).
 
 
Like Paul, I always try to avoid using sub-reports.  They add a level of complexity to your report design and have an undesirable performance-hit.  In short, they're ugly!  You can get around the need for them in almost all situations by creating an SQL view.


Posted By: paulwpark
Date Posted: 22 Apr 2008 at 9:36am
THe only issue with what Blue Frog mentioned is that you would have to create a custom view every time you want to see data duplicated in two ways.  What I did was create a stored procedure with a parameter to enter the number of times I want to see the records duplicated and then use this stored procedure with any report I want to see the same data more than once. 



Print Page | Close Window