Print Page | Close Window

Sub Reports - Getting them to work how they SHOULD

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1231
Printed Date: 01 May 2024 at 5:00am


Topic: Sub Reports - Getting them to work how they SHOULD
Posted By: Jasey
Subject: Sub Reports - Getting them to work how they SHOULD
Date Posted: 27 Aug 2007 at 9:10am
I have a number of reports that require the customers Logo to appear at the top. They have 3 divisions with different logos.
 
Up until now we've been putting these logos into each report and supressing the logos as required.
 
We noticed the other day that the .rpt files were very large and it was these logos causing the problem.
 
Easy we thought - We'll put the logos in a sub-report and simply call the subreport - that way there wont be all these copies of these damned logos.
 
But no - Inserting a sub report would appear to create a copy of the sub report and insert that into the report Angry
 
Is there any way to simply insert a sub report so it will just run it and not make copies of it ?
 
Using Visual Studio 2003 and the version of crystal reports that came with it - presumably because it wouldn't sell on it's own !!!!
 
ps Apologies - Hello there - my name's Jason and I'm in Sunny Aberdeen, Scotland - Just about to go home Smile



Replies:
Posted By: BrianBischof
Date Posted: 27 Aug 2007 at 10:01am
All subreports are embedded in a report. Can't do anything about it. What you need to do is change the resolution on your logo. You can do this in Photoshop (or other program) and not lose the quality of the logo. I've done this before and it will shrink the file size greatly.

-------------
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: Jasey
Date Posted: 27 Aug 2007 at 11:30pm
Thanks for that Brian - you've saved me a few more hours pulling what little hair I have left trying to achieve the un-achievable Smile.
 
Will see if I can get the Logos reduced.


Posted By: Jasey
Date Posted: 28 Aug 2007 at 12:09am
Hmmm.
 
I've done what you suggested and got the files down from approx 1.5mb to about 30kbBig%20smile.
 
However - When I put the Images into the sub report - which basically only houses these Images the file size of the rpt file is 944kb.
 
Now - that is better than the original 2.2mb for each report but still not Ideal - Is there a way to tell Crystal Reports not to increse the file size by a factor of 30 for small files Confused


Posted By: Jasey
Date Posted: 28 Aug 2007 at 12:20am

More info Dead

Inserting compressed jpg files total size 30kb resulted in a rpt file size of 944kb.
 
Inserting compressed bmp files total size 120kb resulted in a rpt file size of 192kb
 
Shocked


Posted By: jkwrpc
Date Posted: 28 Aug 2007 at 6:49am
I have not done this, so it is more of a thought than something I know will work. Would it be possible to use an OLE Object to link to the pictures/images outside of the file? As I understand it, the image would be pulled from its source and not stored within the report itself. If it would work then your report file sizes should see a sizeable drop. Since there are three different logos, assuming this would work, you would have to create some logic to deal with those different images.
 
 
Regards,
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net
 
 


Posted By: BrianBischof
Date Posted: 28 Aug 2007 at 11:50am
This is an interesting thread. I have to ask the question as to why are you still using subreports? I thought you were only doing this in the attempt to remove the images from the main file. But you see that this doesn't actually work. Plus, there is more overhead with storing a new report inside of an existing report. Why don't you get rid of the subreports and just put the new compressed BMPs into the main report?

Also, I find it interesting that small jpgs result in a larger file than bigger BMPs. I'm going to have to flag this one for future research. I never expected that. There must be additional overhead in storing JPGs internally. If you have more stats for us re this, that would be great.


-------------
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: Jasey
Date Posted: 29 Aug 2007 at 12:09am
Originally posted by jkwrpc

I have not done this, so it is more of a thought than something I know will work. Would it be possible to use an OLE Object to link to the pictures/images outside of the file? As I understand it, the image would be pulled from its source and not stored within the report itself. If it would work then your report file sizes should see a sizeable drop. Since there are three different logos, assuming this would work, you would have to create some logic to deal with those different images.
 
 
Regards,
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net
 
 
Hi John,
Yep this does work - we've the code somewhere for it - and I wish I'd done this but when it comes to problems I'm like a dog with a bone Smile - I believe in CR11 it's included. We didin't want to use this method for this project as the customer is very fussy Angry and we need to have absolute control over the Images - but I might go back and do it properly one day.
 


Posted By: Jasey
Date Posted: 29 Aug 2007 at 12:17am
Originally posted by BrianBischof

This is an interesting thread. I have to ask the question as to why are you still using subreports? I thought you were only doing this in the attempt to remove the images from the main file. But you see that this doesn't actually work. Plus, there is more overhead with storing a new report inside of an existing report. Why don't you get rid of the subreports and just put the new compressed BMPs into the main report?

Also, I find it interesting that small jpgs result in a larger file than bigger BMPs. I'm going to have to flag this one for future research. I never expected that. There must be additional overhead in storing JPGs internally. If you have more stats for us re this, that would be great.
I decided on a subreport beacause we are controlling the display of the image using the format formula - and I know that we are going to have to add additional Images in the future and I had wanted to be able to update the Images once and propogate through all the other reports without having to hand crank code or do too much copy & paste & testing.
 
Also - when we find out how to include the v small jpegs without it creating large rpt files I can update it all in one place - now all we need is an "update this report everywhere it appears as a subreport" button and I'll be happy Big%20smile
 
The small jpgs v big bmps was a bit of a suprise for me too - still I've spent most of the day creating the 7 or so reports using the reduced size images and I've had enough of CR for this week.
 
Got a few days off to go and see the Braemar Gathering of the clans Smile
 
http://www.braemargathering.org/index.html - http://www.braemargathering.org/index.html


Posted By: BrianBischof
Date Posted: 29 Aug 2007 at 1:20am
Wow. That looks like quite an event.

Well, if that's the only reason for using a subreport, what about using a database field. Some other way to store it rather than a subreport.

Have fun at the gathering!


-------------
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: Jasey
Date Posted: 29 Aug 2007 at 3:37am
I'll probably go for the DB field in the end - if I do I'll have to set it up so the users can load up whatever logo they want then they can leave me alone :)
 
Will have fun at the gathering - they have a massed pipe band at the end - usually a band of 400 or so pipers and drummers Shocked



Print Page | Close Window