IF THEN ELSE in DATA TEMPLATE NOT IN RTF

Hi,
Can any one tell me How to Implement IF THEN ELSE or DECODE or CASE Logic in a DATA TEMPLATE not in RTF
as I saw loads of Post about implementing them in RTF not in the Template itself.
I have a requirement please click this below for the Detailed Version of this Post, Else Please Just give me a Snippet from which i can Implement the IF THEN ELSE Logic in a DATA TEMPLATE( the .xml file) bu please not via a RTF not using PL/SQL Package
Logic to select Report name based on User's input.
Thanks
vasanthanand

Hello
I am looking to do the same type of thing did you ever get an answer without having to use a RTF format perhaps in another forum or through investigation?

Similar Messages

  • Grouping of Individual groups of Data Template in the RTF

    Hi All,
    We have a scenario where we may require the grouping of Individual groups of Data Template in the RTF.
    Lets say
    1. I have group of Invoices with the Group Name G_INV
    2. I have a list of Payments done for the Invoices under G_PAY
    3. I also have a list of Prepayment Applications that are happened on the Invoices G_PRE
    All the three groups G_INV, G_PAY, and G_PRE are independent and they are at same level
    G_INV (Main Header)
    G_PAY (Main Header)
    G_PRE (Main Header)
    Extract
    <ROOT>
    <G_INV>
    <INV>I1</INV>
    </G_INV>
    <G_INV>
    <INV>I2</INV>
    </G_INV>
    <G_INV>
    <INV>I3</INV>
    </G_INV>
    <G_PAY>
    <PAY>P1</PAY>
    <INV>I1</INV>
    </G_PAY>
    <G_PAY>
    <PAY>P2</PAY>
    <PAYINV>I2</PAYINV>
    </G_PAY>
    <G_PRE>
    <PRE>PRE1</PRE>
    <PREINV>I1</PREINV>
    </G_PRE>
    </ROOT>
    But in the Report output,
    we need the data to be displayed as follows
    G_INV (Main Header)
    G_PAY (Sub Group of Payments)
    G_PRE (Sub Group of Prepayments)
    Output
    I1
    P1
    PRE1
    I2
    P2
    I3
    So, Can you please suggest us,
    Whether we can get these Individual groups into the above required hierarchical manner. If so, please let us know how to achieve the same.
    Also, it will be great if you advice us regarding the Performance, how best will be if we group the queries in this heirarchical manner in the RTF rather than getting the hardcoded dependency through linking of the Data Queries in the Data Template file.
    Thanks,
    Praveen G

    Hi
    I dont think you can stop the table growing using Word controls. The easiest way to do it would be to limit the amount of data coming in.
    <?for-each:LOOPELEMENT[position()<5]?>
    This is take only the first 5 rows
    Tim

  • How to write Boolean function (If Then Else) For Date Caluclation.

    Dear All,
    I have a scenario where i need to calculate Position time hold by an employee in an organisation.
    I have 2 date Char ( DATE FROM & DATE TO), the problem is that is , If an employee is having
    2/3 position in an organisation its current position End Date is always 31.12.999 as its End date is
    not know. For previous position End Date is maintained.
    My requirement is to calculate Position hold time including Current position.
    Can it be done directly in formula variable with If Then Else condition.
    or i need to write user exit if its exit,
    please guide me for ABAP Code.
    Thanks V V much.
    Regards,

    Hi,
    Following options are available for you:
    1. Is the valid to, valid from dates available as a result of standard time dependency of navigational attributes? if yes , you can not use them in calculations, in such case you may have to write a full fledged routine at formula variable, using uxer exit.
    2. Another simple method, that i would suggest would be using temporal joins (infoSets), that precisely fits you case.
    Helpful links:
    About Infosets:
    [http://help.sap.com/saphelp_nw70/helpdata/EN/ed/084e3ce0f9fe3fe10000000a114084/frameset.htm]
    About Temporal joins:
    [http://help.sap.com/saphelp_nw70/helpdata/EN/11/723c3b35703079e10000000a114084/frameset.htm]
    Hope this helps.
    Cheers,
    Sumit

  • Validation "is a valid date" does not pass but Apex proceeding anyway

    Hi,
    I have a simple date-item which I validate first against "not null", then for "is a valid date", then that the date is not in the future.
    In debug mode the first validation passes, the second ( is a valid date ) does not pass, but the validation process proceeds anyway...!? Then the third validation "date not in the future" produces ad DB-Error because it is not a valid date.
    Why does the validation proceed even if the validation does not pass...?
    Version 2.2.0
    Juergen

    Juergen,
    "In debug mode the first validation passes, the second ( is a valid date ) does not pass, but the validation process proceeds anyway...!?"
    Do you mean that the third validation is firing even though the second is failing? This behaviour is correct. All validations fire (regardless of any having already failed) unless they have specific conditions set on them to make them act differently.
    If you don't want the third validation to fire if the second has failed then you will need to put a condition on the 3rd validation to prevent this. Alternatively you could bundle all you validations into one of type "PL/SQL returning Error Text" then have some IF...THEN...ELSE logic in your PL/SQL to return the relevant validatoin text depending on what the problem is (i.e. Date is null, date is invalid or date is in the future).
    Andy

  • 5.6.3 XMLPub Data Template

    Does anyone know how to call a 5.6.3 data template?
    I want to extract the data retrieved from the data template in the rtf doc using the xml tag.

    ashee1,
    Please refer XMLP User Guide Chapter 9. You need to define data definitions and upload the data template to DataTemplate filed.
    Create the Template Definition and upload your RTF Template.
    Create a Report Definition in Concurrent Program/Manager and set the executable as XDODTEXE. make sure the program short name is the same as Data Definition.
    Set the output type as XML and the OPP will pick your RTF Template.
    -Ashish

  • How to use if-then-else-end if in template building?

    hi,
    I am not able to use the "if-then-else-end if" in my template. I want to display a data based on a condition. My requirement is as follows:
    if bal_for_vd < 0 then
    bal_for_vd * no_of_days
    else 0
    end if
    I tried using
    1.<?if: BAL_FOR_VD < 0 then BAL_FOR_VD*NO_OF_DAYS else 0 end if?>
    2.<?xdofx:if BAL_FOR_VD < 0 then BAL_FOR_VD * NO_OF_DAYS end if?>
    3.<?choose:?>
    <?when:BAL_FOR_VD < 0?> <?BAL_FOR_VD * NO_OF_DAYS ?>
    <?end when?>
    <?otherwise?>0
    <?end otherwise?>
    <?end choose?>
    4.<?if:BAL_FOR_VD < 0?><?BAL_FOR_VD*NO_OF_DAYS?><end if?>
    but ended up getting errors or nothing is getting displayed.
    When i used <?BAL_FOR_VD * NO_OF_DAYS ?> alone its working fine and correct getting result. But on giving condition its erring out.
    I will be glad if i get some solution for this.
    Regards,
    Vishnu T Ramakrishnan

    Hi..
    Below syntax should work..I tried with a sample xml..
    <?xdofx:if BAL_FOR_VD < 0 then BAL_FOR_VD * NO_OF_DAYS
      else
    0
    end if?>HTH..

  • How to call oracle Function which has If else condition in Data Template

    Hi,
    currently I am working on creating Data Template which uses a Oracle Function which I need to make use in my data template. But I have some confusions on using the same. Could anybody please help me in this regard.
    I have a function like this,
    function invoice_query (p_facility_id facility.facility_id%TYPE,
    p_wave_nbr pick_directive.wave_nbr%TYPE,
    p_container_id unit_pick_group_detail.container_id%TYPE,
    p_distro_nbr unit_pick_group_detail.distro_nbr%TYPE) return invoice_refcur IS
    refcur invoice_refcur;
    begin
    IF p_wave_nbr IS NOT NULL THEN
    OPEN refcur FOR SELECT t1.distro_nbr,
    t1.cust_order_nbr,
    t1.pick_not_before_date,
    SYSDATE,
    t1.ship_address_description,
    t1.ship_address1,
    t1.ship_address2,
    t1.ship_address3,
    t1.ship_address4,
    t1.ship_address5,
    t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
    t1.ship_country_code,
    t1.bill_address_description,
    t1.bill_address1,
    t1.bill_address2,
    t1.bill_address3,
    t1.bill_address4,
    t1.bill_address5,
    t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
    t1.bill_country_code,
    min(t2.pick_order),
    NULL,
    t2.wave_nbr
    FROM stock_order t1,
    pick_directive t2,
    unit_pick_group_detail t3
    WHERE t1.facility_id = t2.facility_id
    AND t1.facility_id = t3.facility_id
    AND t2.facility_id = t3.facility_id
    AND t1.distro_nbr = t2.distro_nbr
    AND t1.distro_nbr = t3.distro_nbr
    AND t2.distro_nbr = t3.distro_nbr
    AND t1.facility_id = p_facility_id
    AND t2.wave_nbr = p_wave_nbr
    AND g_scp(p_facility_id, 'interface_tcp_flag') = 'N'
    AND t2.pick_type = 'U'
    AND t3.group_id in (SELECT t4.group_id
    FROM unit_pick_group t4
    WHERE t4.facility_id = p_facility_id
    AND t4.wave_nbr = p_wave_nbr)
    GROUP BY t1.distro_nbr,
    t1.cust_order_nbr,
    t1.pick_not_before_date,
    t1.ship_address_description,
    t1.ship_address1,
    t1.ship_address2,
    t1.ship_address3,
    t1.ship_address4,
    t1.ship_address5,
    t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
    t1.ship_country_code,
    t1.bill_address_description,
    t1.bill_address1,
    t1.bill_address2,
    t1.bill_address3,
    t1.bill_address4,
    t1.bill_address5,
    t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
    t1.bill_country_code,
    t2.wave_nbr
    ORDER BY MIN(t3.group_id), MAX(t3.slot);
    elsif p_container_id is not null then
    OPEN refcur FOR SELECT distinct t1.distro_nbr,
    t1.cust_order_nbr,
    t1.pick_not_before_date,
    SYSDATE,
    t1.ship_address_description,
    t1.ship_address1,
    t1.ship_address2,
    t1.ship_address3,
    t1.ship_address4,
    t1.ship_address5,
    t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
    t1.ship_country_code,
    t1.bill_address_description,
    t1.bill_address1,
    t1.bill_address2,
    t1.bill_address3,
    t1.bill_address4,
    t1.bill_address5,
    t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
    t1.bill_country_code,
    NULL,
    t2.dest_id,
    null
    FROM stock_order t1,
    unit_pick_group_detail t2
    WHERE t1.facility_id = t2.facility_id
    and t1.distro_nbr = t2.distro_nbr
    and t1.facility_id = p_facility_id
    AND g_scp(p_facility_id, 'interface_tcp_flag') = 'N'
    AND t2.container_id = p_container_id;
    else
    open refcur for SELECT distinct t1.distro_nbr,
    t1.cust_order_nbr,
    t1.pick_not_before_date,
    SYSDATE,
    t1.ship_address_description,
    t1.ship_address1,
    t1.ship_address2,
    t1.ship_address3,
    t1.ship_address4,
    t1.ship_address5,
    t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
    t1.ship_country_code,
    t1.bill_address_description,
    t1.bill_address1,
    t1.bill_address2,
    t1.bill_address3,
    t1.bill_address4,
    t1.bill_address5,
    t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
    t1.bill_country_code,
    NULL,
    NULL,
    t3.wave_nbr
    FROM stock_order t1,
    unit_pick_group_detail t2,
    unit_pick_group t3
    WHERE t1.facility_id = t2.facility_id
    and t2.facility_id = t3.facility_id
    and t1.distro_nbr = t2.distro_nbr
    and t2.group_id = t3.group_id
    and t1.facility_id = p_facility_id
    AND g_scp(p_facility_id, 'interface_tcp_flag') = 'N'
    AND t2.distro_nbr = p_distro_nbr;
    END IF;
    return refcur;
    end;
    I have created data template like following,
    <sqlStatement name="Q_INVOICE">
                   <![CDATA[
              SELECT Pack_Slip_R.invoice_query(:P_FACILITY_ID,:P_WAVE_NBR,:P_CONTAINER_ID,:P_DISTRO_NBR) from dual
                                                     ]]>
    </sqlStatement>
    But how does I create a element for the "t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip" column in the oracle function. I normally create an element like following,
    <group name="G_INVOICE" source="Q_INVOICE">
                   <element name="CUST_ORDER_NBR" value="cust_order_nbr"/>
                   <element name=":dest_id" value="dest_id"/>
    </Group>
    But how do i create element if a column name is kind of dynamic. Please help. I cannot Rename/change the Column in SQL Query. Please let me know If I could handle this whole logic in BI Publsiher.
    Regards,
    Ashoka BL

    try useing alias
    t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip as <COLUMN_ALIAS>

  • End date should not less than Start date, else CLEAR it

    Hello
    I put CONTRACT START DATE and CONTRACT END DATE fields on the form. These 2 objects (Date/Time objjects) i pulled them from Satndard tab of pallette and dropped on my layout page design, fine.
    Now, am trying to put a validation that the end dat eshould not lower than start date, so, i got a thread as below from Niall,
    http://forums.adobe.com/message/1909551
    and i did my FormCalc coding under EXIT event of END DATE field as below,
    // Pls. note this FormCalc
    // End date should not less than Start date, else CLEAR it - Begin
    var stDate
    var endDate
    stDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_START_DATE") .rawValue
    endDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue
    if (stDate > endDate) then
        xfa.host.messageBox("End date is lower than Start date! End date is cleared")
        xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue = null
    endif
    // End date should not less than Start date, else CLEAR it - End
    I tried in VALIDATE, CALCULATE, CHANGE events of END DATE, but nothing working!!
    PLs. let me kow how can i achieve my requirement? I am anewbie,
    Thank you

    If you use the exit event, you will probably have to have the same code on both the start and end date fields since they have a dependancy on each other. Maybe better to try the validate event of the end date so that if either field is changed the event gets fired. You can try the following for validate event
    // Pls. note this FormCalc
    // End date should not less than Start date, else CLEAR it - Begin
    var stDate
    var endDate
    stDate = CON_START_DATE.rawValue
    endDate = $.rawValue
    if ( HasValue(endDate) ) then
        if (stDate > endDate) then
            xfa.host.messageBox("End date is lower than Start date! End date is cleared")
            $.rawValue = null
        endif
    endif
    1
    // End date should not less than Start date, else CLEAR it - End

  • Contract End date should not less than Start date, else CLEAR it

    Hello
    I put CONTRACT START DATE and CONTRACT END DATE fields on the form. These 2 objects (Date/Time objjects) i pulled them from Satndard tab of pallette and dropped on my layout page design, fine.
    Now, am trying to put a validation that the end dat eshould not lower than start date, so, i got a thread as below from Niall,
    http://forums.adobe.com/message/1909551
    and i did my FormCalc coding under EXIT event of END DATE field as below,
    // Pls. note this FormCalc
    // End date should not less than Start date, else CLEAR it - Begin
    var stDate
    var endDate
    stDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_START_DATE") .rawValue
    endDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue
    if (stDate > endDate) then
        xfa.host.messageBox("End date is lower than Start date! End date is cleared")
        xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue = null
    endif
    // End date should not less than Start date, else CLEAR it - End
    I tried in VALIDATE, CALCULATE, CHANGE events of END DATE, but nothing working!!
    PLs. let me kow how can i achieve my requirement? I am anewbie,
    Thank you

    http://forums.adobe.com/message/4264933#4264933

  • Problem with IF THEN ELSE in RTF template

    HI ALL,
    I have two layouts in the RTF template. Based on the parameter value it has to show the value.
    For example if P_State='United States' then first layout should come. else second one should come.
    I tried to use the IF Then else logic through the form field but i am getting error.
    Please help on this to get it.
    Regards
    Boopathi

    You can do that.
    i guess, the syntax you are using is wrong.
    please refer documentation or this forum for choose:
    Use choose statement. it s better.
    Or send me the template to my id in my profile. or upload it here http://apps2fusion.com/forums/viewforum.php?f=60

  • If then Else statement not working under Computation in APEX

    Hi
    Can anyone help me where I am going wrong? I am trying to use the following code in Computation Process on Submit. I am not able to get the value. It's showing nothing.
    Page:
    *Item Name (Value Required)
    Type
    Static Assignment
    PL/SQL Function Body
    SQL Query (return single value)
    SQL Query (return colon separated value)
    SQL Expression
    PLSQL Expression
    Item Value
    Computation Point
    *Sequence (Value Required)
    Computation Point
    On New Instance (new session)
    Before Header
    After Header
    Before Region(s)
    After Region(s)
    Before Footer
    After Footer
    After Submit
    Source
    *Computation (Value Required)
    BEGIN
    IF :P3_AGING_DAYS <= '0' THEN
    :P3_AGING_BUCKET := 'Within due date';
    elsif :P3_AGING_DAYS > '0' AND :P3_AGING_DAYS <= '3' then
    :P3_AGING_BUCKET := 'Within 3 days';
    end if;
    end;

    1efb2968-171d-43f9-9d5d-d38151735ed7 wrote:
    Please update your forum profile with a real handle instead of "1efb2968-171d-43f9-9d5d-d38151735ed7".
    Can anyone help me where I am going wrong? I am trying to use the following code in Computation Process on Submit. I am not able to get the value. It's showing nothing.
    BEGIN
    IF :P3_AGING_DAYS <= '0' THEN
    :P3_AGING_BUCKET := 'Within due date';
    elsif :P3_AGING_DAYS > '0' AND :P3_AGING_DAYS <= '3' then
    :P3_AGING_BUCKET := 'Within 3 days';
    end if;
    end;
    A PL/SQL Function Body computation has to return a value rather than assigning it to an item in the PL/SQL block (APEX turns the block into the body of a function). The item for which the value is to be computed is specified in the computation properties (P3_AGING_BUCKET).
    begin
      return case
               when :p3_aging_days < 1
               then
                 'Within due date'
               when :p3_aging_days between 1 and 3
               then
                 'Within 3 days'
             end;
    end;

  • I-photo:  I used 2 cameras to take pictures on a trip --- i have put the pictures from both cameras into an album --- when i click on view and then sort by date, the pictures do not sort by date --- any ideas on how to get the pics sorted by date?

    I-photo:  I used 2 cameras to take pictures on a trip --- i have put the pictures from both cameras into an album --- when i click on view and then sort by date, the pictures do not sort by date --- any ideas on how to get the pics sorted by date?

    Select all the photos that you need to change, then click the "Photos" menu and choose "Adjust Date and Time".
    If you add a year, it will adjust all the photos that you selected by adding a year (so if you accidentally select one of the photos that already has "2012", that will change to "2013"). 

  • In data template xml , dataQuery not getting executed

    hello i have the data template XML as :
    name of the file XMLPDF.xml
    <?xml version = "1.0" encoding="UTF-8" ?>
    <dataTemplate name="XMLTEST" description = "testing the" Version = "1.0">
    <properties>
    <property name="xml_tag_case" value="upper" />
    <property name="include_parameters" value="true"/>
    <property name="include_null_Element" value="true"/>
    </properties>
    <parameters>
    <parameter name="P1" dataType = "DATE"></parameter>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[
    SELECT CASH_RECEIPT_ID , AMOUNT , SET_OF_BOOKS_ID
    FROM AR_CASH_RECEIPTS_ALL
    WHERE STATUS = :P1
    ]]>
    </sqlStatement>
    </dataQuery>
    <datastructure>
    <group name = "G1" SOURCE = "Q1" groupFilter="">
    <element name="CASH_RECEIPT" value ="CASH_RECEIPT"/>
    <element name="AMOUNT" value="AMOUNT"/>
    <element name="SET_OF_BOOKS_ID" value="SET_OF_BOOKS_ID"/>
    </group>
    </datastructure>
    </dataTemplate>
    Date Definition:
    Name XMLPDF Code XMLPDF
    Application Receivables Start Date 07-Jan-2011
    Concurrent Program
    registered the report output xml and used the seeded executable XDODTEXE
    when i run the report output is:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <XMLTEST>
    <P1 />
    </XMLTEST>
    i do not see my query in the data template getting executed. i am expecting my 3 columns that i have defined in the query to be shown up in the output xml file.
    I'd really appreciate if someone can help me here. Thanks a lot

    <?xml version = "1.0" encoding="UTF-8" ?>
    <dataTemplate name="XMLTEST" description = "testing the" Version = "1.0">
    <properties>
    <property name="xml_tag_case" value="upper" />
    <property name="include_parameters" value="true"/>
    <property name="include_null_Element" value="true"/>
    </properties>
    <parameters>
    <parameter name="P1" dataType = "CHARACTER"></parameter>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[
    SELECT CASH_RECEIPT_ID , AMOUNT , SET_OF_BOOKS_ID
    FROM AR_CASH_RECEIPTS_ALL
    WHERE STATUS = :P1
    ]]>
    </sqlStatement>
    </dataQuery>
    <datastructure>
    <group name = "G1" SOURCE = "Q1" groupFilter="">
    <element name="CASH_RECEIPT" value ="CASH_RECEIPT"/>
    <element name="AMOUNT" value="AMOUNT"/>
    <element name="SET_OF_BOOKS_ID" value="SET_OF_BOOKS_ID"/>
    </group>
    </datastructure>
    </dataTemplate>
    i have modified the date datatype. im still seeing the same output. how do i change the element to be derived value? can you help me with the syntax.
    Thanks!

  • Web template :Error Valid Data provider not assigned

    Hello Friends we have the web template that was working before , we did the upgrade to SP13 from SP11.
    It gives the error Valid Data provider not assigned and
    Bad integer Parameter value of Parameter BLOCK_COLUMNS_SIZE of Object item:ANALYSIS_ITEM:ANALYSIS;
    Please help where do i need to assign the Data provider beacuse the Values are same for Dataprovider as before
         Portal Runtime Error
    An exception occurred while processing your request
    Exception id:
    See the details for the exception ID in the log file.
    Thanks
    Soniya
    Message was edited by:
            soniya kapoor

    Open the template in WAD and do a validation against the server and make sure the template is well formed.
    Also make sure you apply BI JAVA Patch 1 for SPS 13.

  • I created an application and in  that application if date is changed the application starts from splash screen on re-entering and if date is not changed and u re-enters the application then it open in page where u leaved.Not working in USA timezone.

    I created an application and in  that application if date is changed the application starts from splash screen on re-entering and if date is not changed and u re-enters the application then it open in page where u leaved.It works fine in our side (Timezone,kolkata ,india even for Timezone,slvaniya,USA) but our USA client is telling that on changing the date it not starts from start-up sequence.Can anyone plz suggest the reason for it.

    This is the code which we have used.
    //////////Return if it is first time for the day or not//////////////
    + (BOOL)isFirstTimeToday {
    BOOL result = YES;
    NSDate *now = [[NSDate alloc] init];     /// represents the current time
    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
    NSDateComponents *components = [gregorian components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate: now];
    NSDate *today = [gregorian dateFromComponents:components];
    [now release];
    [gregorian release];
    NSDate *savedDate = [[NSUserDefaults standardUserDefaults] objectForKey:LAST_TIME_VISITED];
    if (savedDate) {
    if ([today earlierDate:savedDate] == today) {
    result = NO;
    return result;
    ////////Stores the date/////////////
    + (void)userDidVisitReenforceScreenToday {
    [[NSUserDefaults standardUserDefaults] setObject:[NSDate todayAtMidnight] forKey:LAST_TIME_VISITED];
    ////////////What [NSDate todayAtMidnight] stores/////////////////////
    + (NSDate *)daysFromNowAtMidnight:(NSInteger)nOfDays {
    NSDate *date = [NSDate dateWithTimeIntervalSinceNow: (86400*nOfDays)];
    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
    NSDateComponents *components = [gregorian components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate: date];
    NSDate *dateAtMidnight = [gregorian dateFromComponents:components];
    [gregorian release];
    NSLog(@"dateAtMidnight : %@",dateAtMidnight);
    return dateAtMidnight;
    + (NSDate *)todayAtMidnight {
    return [self daysFromNowAtMidnight:0];
    Please Suggest..

Maybe you are looking for

  • Is it possible to display A/R Invoice Installment stages in ALD?

    Hi everyone I need to know if it is possible to print the same number of invoices as installment stages that are defined in teh Accounting tab of the form and instead of the Invoice total the installment stage totals are printed? When you go to the B

  • TDMS for RETAIL/STORE

    Hello Expert Zone, Finally I started working on the CRM extraction, and here is my scenario. Source system: 300 warehouses worth of member data. Target: Blank/empty. Objective: Copy /extract member/membership data from source by warehouse type ( 320

  • Required "/" (root) file system size on UNIX for Solution Manager.

    Hello SAP Gurus,    I am setting up SAP Solution Manager 3.2 on HP-UX. It is asking me about 350MB free sapce on "/" file system for Central Instance installation and about 120MB free sapce on "/" file system for Database Instance installation.    I

  • My iphone is stolen and I have not activated Find My Iphone app, what do I do? Help, please.

    My iphone was stolen at a party last night and I'm worried a fob might've taken it. Unfortunately, I did not have a lock on it nor have I activated my Find My iPhone app on my phone tho I have already downloaded it. I would love to track it down, or

  • X6 16gb - Moving panels round home screen

    I have just got the Nokia X6 16gb and am trying to personalize the Home screen. I have the screen so that the green tool and the red cross appear on the separate panels. The problem I am having is moving the panels around. It says at the bottom of he