Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to suppress header and footer based on condition? 1

Status
Not open for further replies.

hatemgamil

Programmer
Mar 18, 2010
41
hi all lets say i have a report looks like that


Customer_ID Customer_Name Order_Date Order_Amount

1 hatem 21/2/2010 8
3 gamil 13/3/2009 1

i have made a Suppress condition in Details Section to make the report shows only the date of current year
so the report will be like this

Customer_ID Customer_Name Order_Date Order_Amount

1 hatem 21/2/2010 8

my question is if there is no records found for the current year i want to know how can i make a suppress condition in Page Header Section to Suppress it when there is no records found for the current year

thnx
 
You could create a formula in the field explorer {@curryr}:

if year({order.date}) = year(currentdate) then 1

Then you could use a suppression formula on the page header:

sum({@curryr}) = 0

This assumes that you are testing the entire report for the presence of record this year.

But why not just eliminate records from other years in your selection formula? Then you could just go to file->report options and check "suppress printing if no records".

-LB
 
thnx Lb,,ur posts always are solutions for me,,
but i cant eliminate the other records of last as i need them to make a chart with records of current year in order to show the difference between current year and last year,,
secondly i would go for the first solution where i will make a conditional field ,
and i want to tell you that i am using the standard version of crystal report that installed with vs2008 ,i don't it's version but i want to update it because i am pretty sure that there is new versions out their that will help me to do things faster so do u have any suggestions about that issue

thnx again
 
So you got the suppression to work as you wished?

I'm not familiar with integration with VB, so don't know what versions are available for that. With stand-alone versions of CR, generally at least the professional version is necessary to get most functionality and the development version gives you even more advanced functionality.

-LB
 
yes ,,it worked fine,,thnx

i am intending to make my reports in the future with stand alone versions with CR then i will and .rpt file to my .Net application in VS ,,but i wana ask u about the latest versions of crystal reports stand alone and where i can get it for free,,i mean if u give me a url where i can download it i will be very thankful for u

thx
 
Crystal Reports and the word Free do not really mix!!

You have to buy a developer version so that you can embed within your application. However, if you then want to deploy your application you will need to purchase further user licences.

If you want a free reporting tool you need to look at other products such as Pentaho or JasperSoft which are open source BI tools which have a reporting tool which can be deployed separately. However, they do not have the ease of use of functionality availbale in Crystal.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top