Presently i am working generation of reports from
Crystal Reports 9 by connecting this with PeopleSoft.
1)Can we create our own templates in Crystal Reports 9
? if it can be, how we can do that?
2)how we can make that template as a default one?
sir plz help me in resolving this problem b'coz my
task should be started with this.
plz reply me back what ever maybe the answer
thank uDo you mean user defined template at run time?|||Do you mean user defined template at run time?
yes userdefined templates like our company logo and backgrounds at design time or runtime|||I think you can use Logoes in Crystal Report. Use Insert image option|||I think you can use Logoes in Crystal Report. Use Insert image option
thanku
but what abt backgrounds, i have my company logo and background with company name on the whole page in shaded manner i have to create the report on that.
number3|||Yes we can add our own templates.
normal reprot can be used a template.
if u get an error it can be of the problem in CRystal Reports 9, for this u should get the service pack from the following address
this service pack will help to resolve the error for crw32.exe error also.
downlaod the service pack which is only for crystal reports 9.other service packs also there.but if ur need is only for crystal reports u can downlaod this.
http://support.businessobjects.com/downloads/updates/service_packs/default.asp#Crystal%20Reports%20Service%20Packs
bye
enjoy
manosql
Showing posts with label presently. Show all posts
Showing posts with label presently. Show all posts
Sunday, March 25, 2012
Friday, February 24, 2012
Can somebody tell me what is wrong with this?
I am trying to created a view and have a need for conditional logic:
Here is what I presently have (not working):
-----------------------
IF (ISDATE(COMPLETIONDATE) = 1)
BEGIN
CASE
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END AS THRESHOLDSTATUS
END
ELSE
IF (ISDATE(COMPLETIONDATE) = 0)
BEGIN
CASE
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END AS THRESHOLDSTATUS
END
-----------------------
Can someone tell me what I am doing wrong?
Basically I am trying to test to see if "completiondate" is a date and if it is then perform a case operation using it, if it is not a date then I want to perform the case operation using "targetcompletiondate".
Thanks...select THRESHOLDSTATUS =
CASE
WHEN DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END
from ...|||First problem: You have a column called "CompletionDate" which may contain something that is NOT A DATE?!?! That's a design issue right there...
Second problem: You are putting this in a VIEW? Complex logic such as this is better off in a stored procedure. You didn't provide your entire CREATE VIEW statement, but depending upon what you are trying to do, your task may not be possible.
You may be able to use nested CASE statements:
CASE WHEN ISDATE(COMPLETIONDATE) = 1
CASE WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END
ELSE
CASE WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END
END AS THRESHOLDSTATUS
...or a single CASE statement with more complex criteria:
CASE
WHEN ISDATE(COMPLETIONDATE) = 1 AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) THEN 'GREEN'
WHEN ISDATE(COMPLETIONDATE) = 1 AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0) THEN 'YELLOW'
WHEN ISDATE(COMPLETIONDATE) = 1 AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
WHEN ISDATE(COMPLETIONDATE) = 0 AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) THEN 'GREEN'
WHEN ISDATE(COMPLETIONDATE) = 0 AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0) THEN 'YELLOW'
WHEN ISDATE(COMPLETIONDATE) = 0 AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END AS THRESHOLDSTATUS|||I thought that that's what I gave the poster...?|||Yeah, you sniped me by 10 minutes. So you get kudos for being first, but I get points for verbosity!
Here is what I presently have (not working):
-----------------------
IF (ISDATE(COMPLETIONDATE) = 1)
BEGIN
CASE
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END AS THRESHOLDSTATUS
END
ELSE
IF (ISDATE(COMPLETIONDATE) = 0)
BEGIN
CASE
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END AS THRESHOLDSTATUS
END
-----------------------
Can someone tell me what I am doing wrong?
Basically I am trying to test to see if "completiondate" is a date and if it is then perform a case operation using it, if it is not a date then I want to perform the case operation using "targetcompletiondate".
Thanks...select THRESHOLDSTATUS =
CASE
WHEN DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END
from ...|||First problem: You have a column called "CompletionDate" which may contain something that is NOT A DATE?!?! That's a design issue right there...
Second problem: You are putting this in a VIEW? Complex logic such as this is better off in a stored procedure. You didn't provide your entire CREATE VIEW statement, but depending upon what you are trying to do, your task may not be possible.
You may be able to use nested CASE statements:
CASE WHEN ISDATE(COMPLETIONDATE) = 1
CASE WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END
ELSE
CASE WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END
END AS THRESHOLDSTATUS
...or a single CASE statement with more complex criteria:
CASE
WHEN ISDATE(COMPLETIONDATE) = 1 AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) THEN 'GREEN'
WHEN ISDATE(COMPLETIONDATE) = 1 AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0) THEN 'YELLOW'
WHEN ISDATE(COMPLETIONDATE) = 1 AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
WHEN ISDATE(COMPLETIONDATE) = 0 AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) THEN 'GREEN'
WHEN ISDATE(COMPLETIONDATE) = 0 AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0) THEN 'YELLOW'
WHEN ISDATE(COMPLETIONDATE) = 0 AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END AS THRESHOLDSTATUS|||I thought that that's what I gave the poster...?|||Yeah, you sniped me by 10 minutes. So you get kudos for being first, but I get points for verbosity!
Subscribe to:
Posts (Atom)