How to get a date on different pages?

Hey everyone, I am working on a daily planner for the office and have a script that automatically generates the dates but I don´t know how to get each of the dates on a different page. I'd really appreciate if anyone could help me get each date generated by the script on teh following page of my 365 page document. The scrip is:
var months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
var length = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
var days = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ];
count = 0;
day = 0;
month = 0;
weekday = 5;
str = "";
while (count < 365)
count++;
str += days[weekday]+", "+(day+1)+" "+months[month]+"\r";
day++;
if (day >= length[month])
  day = 0;
  month++;
  if (month > 11)
   month = 0;
weekday = (weekday+1) % 7;
app.selection[0].contents = str;
Tanks!

Try this,
app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
app.activeDocument.zeroPoint = [0,0];
with(app.activeDocument.viewPreferences){
    horizontalMeasurementUnits=MeasurementUnits.points;
    verticalMeasurementUnits=MeasurementUnits.points;
    rulerOrigin=RulerOrigin.pageOrigin;
var months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
var length = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
var days = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ];
count = 0;
day = 0;
month = 0;
weekday = 5;
str = [];
while (count < 365)
count++;
str[count]= days[weekday]+", "+(day+1)+" "+months[month]+"\r";
str1 =str.toString();
day++;
if (day >= length[month])
  day = 0;
  month++;
  if (month > 11)
   month = 0;
weekday = (weekday+1) % 7;
for(i=0;i<document.pages.length;i++)
var myTextframe = document.pages[i].textFrames.add({geometricBounds:[0,0,50,150]});
myTextframe.insertionPoints[0].contents=str[i+1];
Vandy

Similar Messages

  • Discoverer 11g - How to get Sales Data in different periods?

    Good afternoon,
    I am currently using Discoverer 4.1 and I can run reports that display all of these different types of sales.
    I have a Cross tab and I want 5 columns showing the Sales below.
    2013 Month Sales, 2013 YTD Sales, 2012 Month Sales, 2012 YTD Sales, and 2012 Total Sales
    I installed Discoverer 11.1.1.3 and I copied my reports over, but no sales show up.
    Does the NEW Discoverer need different calculations or conditions?
    I couldn't find anything on it.
    I have all of these checked.
    My Conditions:
    Short Date Range = '2013' AND Month = 'FEBRUARY'
    My Calculations:
    2012 Total = CASE WHEN "Year" = '2012' THEN Net Selling ELSE 0 END
    2012 YTD = CASE WHEN YearMon IN ('201201', ‘201202’) THEN Net Selling ELSE 0 END
    2012 Mth = CASE WHEN YearMon = '201202' THEN Net Selling ELSE 0 END
    2013 YTD = CASE WHEN YearMon IN ('201301', ‘201302’) THEN Net Selling ELSE 0 END
    2013 Mth = CASE WHEN YearMon = '201302' THEN Net Selling ELSE 0 END
    Keep in mind, these conditions and calculations work perfectly in Discoverer 4.1.
    Any help is appreciated.
    Let me know if you require anymore information.
    Thanks,
    Andy Hoang

    Have a look at the following note:-
    Note 1573200 - How to restructure the statistic data of the sales information system (SIS)
    But before trying to carry out the process as detailed in the above note, first check with other SIS reports like MCTA etc., and no reports are showing correctly, then you can proceed.  Otherwise, you need to raise an OSS message with SAP.
    G. Lakshmipathi

  • How to get footer only in last page of report

    anybody tell me
    1).how to get footer only in last page while we are displaying reports
        and header only in first page .
    2) how to create search help and how to use it .
    3) how to create lock objects and how can we use it

    Hi
    This posting has an example of using a splitter container:
    Changing width of a custom container dynamically
    This posting has a discussion about using TOP-OF-PAGE:
    Display Page numbers in ALV
    This posting has an example of using picture control:
    Insert picture in selection screen.
    This posting has an example of putting a picture on top of an ALV grid:
    Logo in OO ALV Grid
    The page footer is defined using the statement END-OF-PAGE.
    The processing block following END-OF-PAGE is processed only if you reserve lines for the footer in the LINE-COUNT option of the REPORT statement.
    <u><b>CREATION:</b></u>
    Go to SE11 Tcode
    select search help
    give the 'z' search help name and create
    select the selection method ur table name eg : 'mara'
    dialog module 'display value immediately'.
    add the field whatever u want and lpos = 1 and spos = 1 and check import and export parameter.
    where left position when displaying and spos = search position
    and then save and activate ..
    <b>Creating Search Help:</b>
    http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_basic.htm
    http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_imp.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ee86446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ee2b446011d189700000e8322d00/frameset.htm
    A lock object is a virtual link of several SAP tables which is used to synchronize simultaneous access by two users to the same set of data ( SAP lock concept).
    Locks are requested and released in the programming of online transactions by calling certain function modules which are automatically generated from the definition of the lock objects. These lock objects must be explicitly created in the ABAP Dictionary.
    <b>To set locks, you must perform the following steps:</b>
    1. You must define a lock object in the ABAP Dictionary. The name of the lock object should begin with E.
    2. The function modules for requesting and releasing locks which are created automatically when the lock object is activated must be linked to the programming of the relevant online transactions.
    <u><b>Reasons for Setting Locks</b></u>
    Suppose a travel agent want to book a flight. The customer wants to fly to a particular city with a certain airline on a certain day. The booking must only be possible if there are still free places on the flight. To avoid the possibility of overbooking, the database entry corresponding to the flight must be locked against access from other transactions. This ensures that one user can find out the number of free places, make the booking, and change the number of free places without the data being changed in the meantime by another transaction.
    <u><b>Lock Mechanisms in the Database System</b></u>
    The database system automatically sets database locks when it receives change statements (INSERT, UPDATE, MODIFY, DELETE) from a program. Database locks are physical locks on the database entries affected by these statements. You can only set a lock for an existing database entry, since the lock mechanism uses a lock flag in the entry. These flags are automatically deleted in each database commit. This means that database locks can never be set for longer than a single database LUW; in other words, a single dialog step in an R/3 application program.
    Physical locks in the database system are therefore insufficient for the requirements of an R/3 transaction. Locks in the R/3 System must remain set for the duration of a whole SAP LUW, that is, over several dialog steps. They must also be capable of being handled by different work processes and even different application servers. Consequently, each lock must apply on all servers in that R/3 System.
    <u><b>SAP Locks</b></u>
    To complement the SAP LUW concept, in which bundled database changes are made in a single database LUW, the R/3 System also contains a lock mechanism, fully independent of database locks, that allows you to set a lock that spans several dialog steps. These locks are known as SAP locks.
    The SAP lock concept is based on lock objects. Lock objects allow you to set an SAP lock for an entire application object. An application object consists of one or more entries in a database table, or entries from more than one database table that are linked using foreign key relationships.
    Before you can set an SAP lock in an ABAP program, you must first create a lock object in the ABAP Dictionary. A lock object definition contains the database tables and their key fields on the basis of which you want to set a lock. When you create a lock object, the system automatically generates two function modules with the names ENQUEUE_<lock object name> and DEQUEUE_<lock object name> . You can then set and release SAP locks in your ABAP program by calling these function modules in a CALL FUNCTION statement.
    <u><b>Lock Types</b></u>
    There are two types of lock in the R/3 System:
    <u><b>
    Shared lock</b></u>
    Shared locks (or read locks) allow you to prevent data from being changed while you are reading it. They prevent other programs from setting an exclusive lock (write lock) to change the object. It does not, however, prevent other programs from setting further read locks.
    <u><b>Exclusive lock</b></u>
    Exclusive locks (or write locks) allow you to prevent data from being changed while you are changing it yourself. An exclusive lock, as its name suggests, locks an application object for exclusive use by the program that sets it. No other program can then set either a shared lock or an exclusive lock for the same application object.
    example uses the lock object ESFLIGHT and its function modules ENQUEUE_ESFLIGHT and DEQUEUE_ESFLIGHT to lock and unlock the object.
    For more information about creating lock objects and the corresponding function modules, refer to the Lock objects section of the ABAP Dictionary documentation.
    The PAI processing for screen 100 in this transaction processes the user input and prepares for the requested action (Change or Display). If the user chooses Change, the program locks the relevant database object by calling the corresponding ENQUEUE function.
    MODULE USER_COMMAND_0100 INPUT.
      CASE OK_CODE.
        WHEN 'SHOW'....
        WHEN 'CHNG'.
    * <...Authority-check and other code...>
          CALL FUNCTION 'ENQUEUE_ESFLIGHT'
    EXPORTING
    MANDT = SY-MANDT
    CARRID = SPFLI-CARRID
    CONNID = SPFLI-CONNID
    EXCEPTIONS
    FOREIGN_LOCK = 1
    SYSTEM_FAILURE = 2
    OTHERS = 3.
    IF SY-SUBRC NE 0.
    MESSAGE ID SY-MSGID
    TYPE 'E'
    NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    The ENQUEUE function module can trigger the following exceptions:
    FOREIGN_LOCK determines whether a conflicting lock already exists. The system variable SY-MSGV1 contains the name of the user that owns the lock.
    The SYSTEM_FAILURE exception is triggered if the enqueue server is unable to set the lock for technical reasons.
    At the end of a transaction, the locks are released automatically. However, there are exceptions if you have called update routines within the transaction. You can release a lock explicitly by calling the corresponding DEQUEUE module. As the programmer, you must decide for yourself the point at which it makes most sense to release the locks (for example, to make the data available to other transactions).
    If you need to use the DEQUEUE function module call several times in a program, it makes good sense to write it in a subroutine, which you then call as required.
    The subroutine UNLOCK_FLIGHT calls the DEQUEUE function module for the lock object ESFLIGHT:
    FORM UNLOCK_FLIGHT.
         CALL FUNCTION 'DEQUEUE_ESFLIGHT'
              EXPORTING
                  MANDT     = SY-MANDT
                  CARRID    = SPFLI-CARRID
                  CONNID    = SPFLI-CONNID
              EXCEPTIONS
                  OTHERS    = 1.
         SET SCREEN 100.
    ENDFORM.
    You might use this for the BACK and EXIT functions in a PAI module for screen 200 in this example transaction. In the program, the system checks whether the user leaves the screen without having saved his or her changes. If so, the PROMPT_AND_SAVE routine sends a reminder, and gives the user the opportunity to save the changes. The flight can be unlocked by calling the UNLOCK_FLIGHT subroutine.
    MODULE USER_COMMAND_0200 INPUT.
      CASE OK_CODE.
        WHEN 'SAVE'....
        WHEN 'EXIT'.
          CLEAR OK_CODE.
          IF OLD_SPFLI NE SPFLI.
             PERFORM PROMPT_AND_SAVE.
          ENDIF.
          PERFORM UNLOCK_FLIGHT.
          LEAVE TO SCREEN 0.
        WHEN 'BACK'....
    <b>
    Another Example</b> :
    please see this link with Screen shot .....
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/frameset.htm
    Reward all helpfull answers
    Regards
    Pavan

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

  • How to filter the data in different sections (e.g. Report Footers)?

    Hi,
    I am using Crystal Reports 11 to generate cross-tables.
    I plan to generate 3 cross-tabs, and each cross-table will be put in a section. For example, cross-tab1 in Report Footer a; cross-tab2 in Report Footer b; cross-tab3 in Report Footer c.
    I know use "Select Expert" to filter data. But, it seems that "Select Expert" filters data for the whole report.
    I want to filter the data for each cross-table separately. For example, filter cross-tab1 based on condition1; filter cross-tab2 based on condition2; filter cross-tab3 based on condition3.
    How to filter the data in different sections (e.g. Report Footers)?
    Thank you in advance.

    Hi,
    Now that you've inserted the subreport just right-click the sub-report and click Edit. The Design page for sub-report should open up.
    You can now insert the cross-tab on the Report Header and insert a record selection formula of your choice.
    Also, suppress all the other sections of the subreport so the Main report only shows the crosstab without any spaces.
    Do the same for all the subreports.
    -Abhilash

  • How to Hightlight the Data in Jsp Page

    How to Hightlight the Data in Jsp Page,
    I am doing doing search page,based on values given search page those are sent to servlet,in servlet based on some conditions if particuler id i am getting then i am redirecting to Respective jsp page with highlight the data from database..
    Thanks in advance...

    "Highlighting data in JSP sounds strange".
    Without looking at your search specific algorithms I feel you are finally going to display a page (HTML content) to user which contains highlighted text. Highlighting is not directly related to server side language you use (JSP, ASP, PHP etc.). This is purely HTML and CSS. However, server side script (such as JSP) should generate HTML content for getting highlight effect.
    Following HTML shows highlighted text using background-color property on span element.
    <html>
      <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
      </head>
      <body>
          <p style="font-size:1.1em">This is a long paragraph which contains <span style="background-color: yellow;">highlighted text</span> and non highlighted text.</p>
      </body>
    </html>Thanks,
    Mrityunjoy
    Edited by: mrityunjoy on 14 Jun, 2010 3:30 AM

  • How to get javabean data in Servlets.( JavaBean -- Servlet(Controller)

    how to get javabean data in Servlets.
    1) I am using name ,password in Jsp(View )
    2) when I submit this Bean will be called and Setter methods will be called .
    3) In ServletController (controller) I want to get data of javabean.
    In this I have to do validation of user.
    I want to pass the javabean obj as like -->
    request.getAttribute("beanObj");
    My intention is to get all the poperties in javabean by passing bean id
    or beanobj ,
    Is there any way to get all the data using bean id or beanObj.
    Plz Reply,

    Now in the Servlet we can get the same bean by this code:
    PageContext pageContext = JspFactoryImpl.getDefaultFactory().getPageContext(this, request, response, null, true, 8192, true);
    UserBean userbean = (UserBean)pageContext.getAttribute("userbean", PageContext.SESSION_SCOPE);
    String userid = userbean.getUsername();
    For this code to work it is needed to import 2 files:
    import org.apache.jasper.runtime.JspFactoryImpl;
    import javax.servlet.jsp.PageContext;
    The JspFactoryImpl is in jasper-runtime.jar file provided in tomcat dir.It seems to me that you are exactly knowing what you are doing :-(
    You can get a Bean stored in a Session by
    request.getSession().getAttribute("userbean");
    In the login.jsp page for example we have the code
    <jsp:useBean id="userbean" scope="session"class="com.newproj.UserBean" />
    <jsp:setProperty name="userbean" property="*" />the jsp:setProperty is not called when you click on the submit button
    if fills the bean with the request values from the previous request.
    andi

  • Displaying a group of data in different Pages

    Hello
    I will try to explain my Problem below briefly
    I have a problem with displaying a group of data in different Pages.I want to display a group of data like this:
    page1      page2
    data1Part1      data1Part2
    Page3     Page4
    data2Part1      data2Part2
    Page5     Page6
    data3Part1      data3Part2
    page 7     Page 8
    data4Part1      data4Part2
    What I get is :
    page1      page2
    data1Part1      data2Part1
    Page3     b]Page4
    data3Part1      data4Part1
    Page5     Page6
    data2Part2      data3Part2
    page 7     Page 8
    data4Part2      data4Part2
    I test <?for-each-group@section:ROW?> and Different first page etc. It doesn't work.I would appreciate your help. I can send you the output, template and xml doc, if you can have a look at it.
    Thanks

    Send me all files along with expected output at [email protected]

  • How to get changed data in ALV in Web Dynpro for ABAP

    METHOD on_data_check .
    DATA:
        node_spfli                          TYPE REF TO if_wd_context_node,
        node_sflight                        TYPE REF TO if_wd_context_node,
        itab_sflight2                        TYPE if_display_view=>elements_sflight.
      node_spfli = wd_context->get_child_node( name = if_display_view=>wdctx_spfli ).
      node_sflight = node_spfli->get_child_node( name = if_display_view=>wdctx_sflight ).
      CALL METHOD node_sflight->get_static_attributes_table
        IMPORTING
          table = itab_sflight2.
    this code is ..get all data(changed and not changed)
    but i want get changed data only, not all data.
    how to get changed data?
    Edited by: Ki-Joon Seo on Dec 27, 2007 6:04 AM

    Hi,
    To get only the changed data in the ALV grid of a WD, you need to capture the "ON_DATA_CHECK" of the ALV grid.
    To this please do the following in the ALV initialization of the ALV table settings :
        lr_table_settings->set_data_check(
                IF_SALV_WD_C_TABLE_SETTINGS=>DATA_CHECK_ON_CELL_EVENT ).
    You may also do this:
        lr_table_settings->set_data_check(            IF_SALV_WD_C_TABLE_SETTINGS=>DATA_CHECK_ON_CHECK_EVENT)
    The above two ways would depend on when do you need to check for the changed data. If you want to check the data as soon as it is entered, then use the first method. Else, use the second method.
    You need to register an EVENT HANDLER for this event.(You may do this in your VIEW or Component Controller).
    In this Event handler, you would find an importing parameter R_PARAM which is a ref type of      IF_SALV_WD_TABLE_DATA_CHECK.
    The attribute T_MODIFIED_CELLS of this interface IF_SALV_WD_TABLE_DATA_CHECK will contain the modified cells of the ALV with the old & new values.

  • How to get attribute value from standard page ?

    Hi,
    How to get attribute value from standard page ?
    String str = (String)vo.getCurrentRow().getAttrbute("RunId");
    But this value is returning a null value ....
    Can anyone help me to get this attribute value which is actually having a actual value .

    getCurrentRow() would always return null if no setCurrentRow() is used.
    Please check the page design and understand how many rows of VO are there. You can also use the following to get the row:
    vo.reset();
    vo.next();
    Regards
    Sumit

  • How to get all data from nokia to i5s

    how to get all data from nokia E71 to i5s???

    if you can put those data in your computer then add it in iTunes. your iPhone 5s should get it thru syncing.

  • How to get the data from multiple nodes to one table

    Hi All,
    How to get the data from multiple nodes to one table.examples nodes are like  A B C D E relation also maintained
    Regards,
    Indra

    HI Indra,
    From Node A, get the values of the attributes as
    lo_NodeA->GET_STATIC_ATTRIBUTES(  IMPORTING STATIC_ATTRIBUTES = ls_attributesA  ).
    Similarily get all the node values from B, C, D and E.
    Finally append all your ls records to the table.
    Hope you are clear.
    BR,
    RAM.

  • How to get the data from pcl2 cluster for TCRT table.

    Hi frndz,
    How to get the data from pcl2 cluster for tcrt table for us payroll.
    Thanks in advance.
    Harisumanth.Ch

    PL take a look at the sample Program EXAMPLE_PNP_GET_PAYROLL in your system. There are numerous other ways to read payroll results.. Pl use the search forum option & you sure will get a lot of hits..
    ~Suresh

  • How to get the data from Pooled Table T157E.

    Hi Experts,
    How to get the data from Pooled Table T157E.
    Any help.
    Thanks in Advance,
    Ur's Harsha.

    create some internal table similar to T157E and pass all data as per SPRAS.
    After that use internal table in your program as per the requirement.
    Regds,
    Anil

  • How to get purchasing data from SAP R/3 to OWB (Oracle warehouse builder).

    Hi,
    My name is Pavan Tata. I work as a SAP BW developer. Here is the situation at my client place. Client decided to retire BW system and wants to replace with OWB(Oracle warehouse). In all this currently we have purhchasing application in BW production system and wants to move this application to OWB for the same type of reporting what they are getting currently.
    Here is my question:
    How to get purchasing data from SAP R/3 to OWB(Warehouse) with initial full loads and deltas mechanism in the same way as we do in BW.
    Please help on this, also send me any documentation about this if you have.
    Thanks,
    Pavan.

    Hello,
    here is a short report which converts S012 entries to strings with separator semicolon. Perhaps this will help you?
    Regards
    Walter Habich
    REPORT habitest2 LINE-SIZE 255.
    TYPES:
      strtab_t TYPE TABLE OF string.
    CONSTANTS:
      separator VALUE ';'.
    DATA:
      it_s012 LIKE s012 OCCURS 0,
      wa_s012 LIKE s012,
      strtab TYPE strtab_t,
      strele TYPE string.
    SELECT * FROM s012 INTO TABLE it_s012 UP TO 100 ROWS.
    PERFORM data_to_string
      TABLES
        strtab
      USING
        'S012'. "requires it_s012 and wa_s012
    LOOP AT strtab INTO strele.
      WRITE: / strele.
    ENDLOOP.
    *&      Form  data_to_string
    FORM data_to_string TABLES strtab TYPE strtab_t
                        USING  ittab TYPE any.
      DATA:
        h_zaehler TYPE i,
        line_str TYPE string,
        l_tabellenname(10) TYPE c,
        l_arbeitsbereichsname(10) TYPE c,
        h_string TYPE string,
        h_char(255) TYPE c.
      FIELD-SYMBOLS: <l_tabelle> TYPE ANY TABLE,
                     <l_arbeits> TYPE ANY,
                     <feldzeiger> TYPE ANY.
      CLEAR strtab.
      CONCATENATE 'IT_' ittab INTO l_tabellenname.
      ASSIGN (l_tabellenname) TO <l_tabelle>.
      CONCATENATE 'WA_' ittab INTO l_arbeitsbereichsname.
      ASSIGN (l_arbeitsbereichsname) TO <l_arbeits>.
      LOOP AT <l_tabelle> INTO <l_arbeits>.
        CLEAR: h_zaehler, line_str.
        line_str = ittab.
        DO.
          ADD 1 TO h_zaehler.
          ASSIGN COMPONENT h_zaehler OF
            STRUCTURE <l_arbeits> TO <feldzeiger>.
          IF sy-subrc <> 0. EXIT. ENDIF.
          WRITE <feldzeiger> TO h_char LEFT-JUSTIFIED.          "#EC *
          h_string = h_char.
          CONCATENATE line_str separator h_string INTO line_str.
        ENDDO.
        APPEND line_str TO strtab.
      ENDLOOP.
    ENDFORM.                    "data_to_string

Maybe you are looking for