Last post Dec 06, 2010 03:32 PM by MyronCope
Dec 06, 2010 10:26 AM|MyronCope|LINK
Using vb.net 2005 and crystal reports.
I am creating a crystal report that shows products and contains a section for "productDetails" that lists in bullet type format details for each product. For a small number of products the number of PRoductDetails are larger than what can fit in the available
space. So I am considering on creating a second crystal report that will exclude some sections currently on the report so I can display all of the ProductDetails for each product.
The sections that i mentioned that will be replaced are all image sections which are in a typed dataset and then bound to the report so I am thinking of the following possible solutions and wondering if any of you have done the following:
1. bind 2 different crystal reports to a report viewer (is this possible) and the 2nd report bound will show the productDetails for products that have more than x number of productDetails records returned. so the result is that first I will display crystalReport1
and then display crystalReport2 in the same CrystalReportViewer? OR
2. I have an image field in my typed dataset that I bind to the report, is it possible to change the type for this so that I can hide the image and instead list text (the productDetails records returned text)?
meaning I still want to display images for products that less than x number of productDetails but I want to hide the images for products that have more than x number of productDetails and then I want to display the extra text productDetails.
Defined in the xsd as follows, and filled in value in the vb code:
'add Image column to myTable that I will later bind crystal report
'open the image and read the bytes into the myImage column
Dim FilStr As New System.IO.FileStream(strLinkToTheLocationOfTheImage, IO.FileMode.Open)
Dim br As New System.IO.BinaryReader(FilStr)
myDataRow("MyImage") = br.ReadBytes(br.BaseStream.Length)
3. I have a label above the image that I will replace if there are too many PRoductDetails records. I found for this lable I can set the "EnableGrow" property to True and instead of setting the label value to the name of the image I can set that label to
the records of the ProductDetails field and it will display however many ProductDetails records I have.
The only problem with 2 is this: It displays the ProductDetails rows on top of the image, for this instance only (on this page) I need to hide the image, but If there are less than x number of ProductDetails I want to show the image. Is there a way I can
specify which page on a crystal report to hide or show a field?
Sorry, I know this is a lot of information. Has anyone experience something like this before?
Dec 06, 2010 03:32 PM|MyronCope|LINK
I have a solution to my issue:
* when there are more than x number of ProductDetails records then I will not bind an image to the image field and then
* since the label is set to EnableGrow then I will allow the extra records to be bound to the label and the extra records will display instead of the image