Print Page | Close Window

Need help with requirements

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
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=107
Printed Date: 18 May 2024 at 11:49pm


Topic: Need help with requirements
Posted By: MrNorth
Subject: Need help with requirements
Date Posted: 10 Jan 2007 at 12:16pm
Hi!
 
My client want me to design a report for a winforms .net 2005 application. The requirements are as follows, the reports should be able to:
 
1 Display a picture from database
 
2 have 4 parameters determined at runtime
 
3 to show a table of data by where the columns are determined at runtime. The data is returned from a webservice as a ado.net dataset. At designtime the number of columns are unknown.
 
 
4 have the ability to evaluate each row of the table generated at 3, and if a certain column has a certain data, then the entire lines text should be of style "linethrough" and have red text.
 
I have very limited knowledge of the Crystal Reports for .NET 2005 so before I start digging into this, I want to ask you pros if all these 4 requirements are possible to achieve using the .net component?
 
kind regards
Henrik
 



Replies:
Posted By: hilfy
Date Posted: 15 Jan 2007 at 12:57pm
Item 1
Absolutely can be done.  You should be able to just drag the field onto your report.
 
Item 2
You can set up the 4 parameters to the report and send the values in your code.
 
Item 3
A totally variable number of columns is not do-able.  There are ways around this, but you'll have to know the absolute MAX number of possible columns that can be on the report.  You then set up the dataset with that many columns.  Also, one of the issues you may run into if they select too many columns is the amount of "real estate" available on the report for displaying all of the columns.
 
Also, in order to design the report, your ado.net dataset will have to have a pre-specified set of columns so that the report "sees" them at design-time.  You should give these columns generic names and then put the correct data into them from your application in the order that the user wants them displayed, leaving any unused columns null.  In your report you can set the suppress formula on the fields to suppress them if the value in the field is null.
 
Item 4
This is quite possible.  In the report design, right-click on each field in the details line of the report, select "Format Object" (in VS2005) or "Format Field" (in Crystal) and go to the Fonts tab.  Click on the formula button next to the Color drop-down and, assuming that "certain text" is always the same, enter something like the following:
If {table.certain_column} = "certain text" then
  red
else
  black
In the formula for StrikeThrough, you'll put something like this:
{table.certain_column} = "certain text"
(This expression just needs to resolve to True or False.)
 
Good luck!
 
-Dell
 


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window