Print Page | Close Window

Year Title Change

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3927
Printed Date: 26 Apr 2024 at 7:06pm


Topic: Year Title Change
Posted By: cardpogi
Subject: Year Title Change
Date Posted: 07 Aug 2008 at 6:34am
Well basically whats happening to me is that im trying to make a formula where it can change the report Title each year.This is my formula
IF Year (CurrentDate) = {MENSAJE_ANNO.ANNO}THEN
{MENSAJE_ANNO.DESCRIPCION}, where Mensaje_ANNO.ANNO save the year in an INT FORMAT, and MENSAJE_ANNO_DESCRIPCION is the new title, the point is the formula is working but for some od reason it duplicate everything in the detail of my report. you can download the project here, if anyony could please help.I need it for work and its killing me...
Project: http://cid-55fcbf7f8702b506.skydrive.live.com/viewpermissions.aspx/Public/rptCatalogoPreguntas.rar - http://cid-55fcbf7f8702b506.skydrive.live.com/viewpermissions.aspx/Public/rptCatalogoPreguntas.rar



Replies:
Posted By: cardpogi
Date Posted: 07 Aug 2008 at 9:25am
if i could get a reply i would really appreciate


Posted By: jkwrpc
Date Posted: 08 Aug 2008 at 11:48am
I just tried looking at your web page using the link, it says it does not exist.
 
Regards
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net


Posted By: cardpogi
Date Posted: 09 Aug 2008 at 4:47am
Its in the page header,
Re-uploaded file
http://www.mediafire.com/?sharekey=a1f1ce5f14a13e49d2db6fb9a8902bda - http://www.mediafire.com/?sharekey=a1f1ce5f14a13e49d2db6fb9a8902bda


Posted By: jkwrpc
Date Posted: 09 Aug 2008 at 9:54am
I looked at your report. Since I dont have the database to run against I cannot give a you a solution that I know will work. I did create the following formula against the sample database for CR.
 
This formula works to compare a datebase field  to value (this could be another database field and then then return a year. This again could be value parsed from another datafield source. If the comparision fails it then returns the year from the current system date.
 
If I have understood your problem correctly, the formula should give you the path to a possible solution. On the surface I looked at your formula and I cannot tell you why it did not work. There is a space between the Year and CurrentDate field. Perhaps that is the problem. Anyway I hope what follows will help your sort it out. Let us know either way.
 
-------------------------------------------------------------
If Year({Command.Statement Date}) = 2003 then "2003"
else
ToText(Year(CurrentDate),0,"")
---------------------------------------------
 
Regards,
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net



Print Page | Close Window