home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / progs / ite / ite10d1.exe / DATA.Z / ENTRIES.JRP < prev    next >
Encoding:
Text File  |  1996-09-07  |  8.2 KB  |  255 lines

  1. /****************************************************************************\
  2. *                                                                            *
  3. * Entries.jrp  --  Guest Book Entries Report                                 *
  4. *                                                                            *
  5. * Entries.jrp is part of the Guest Book solution application. It lists the   *
  6. * existing guest book entries, in order by the date and time of their        *
  7. * entry - most recent entries first. The entries are streamed to the         *
  8. * browser one page at a time, by passing the start and end page parameters   *
  9. * to the report:                                                             *
  10. *                                                                            *
  11. *    _sys.reports.run("entries.jrp",1,1);                                    *
  12. * or                                                                         *
  13. *    http://host.domain/svr/intrasrv.isv?apps/guestbk/entries.jrp(1,1)       *
  14. *                                                                            *
  15. * Dependencies:  apps\shared\dateex.js                                       *
  16. *                apps\shared\controls.cc                                     *
  17. *                gestbk31.gif                                                *
  18. *                homepg31.gif                                                *
  19. *                                                                            *
  20. * Links to:      ibapps/index.htm                                            *
  21. *                                                                            *
  22. * Updated 8/27/96 by IntraBuilder Samples Group                              *
  23. * $Revision:   1.16  $                                                       *
  24. *                                                                            *
  25. * Copyright (c) 1996, Borland International, Inc. All rights reserved.       *
  26. *                                                                            *
  27. \****************************************************************************/
  28.  
  29. // The reference to dateex.js include the full path (found by _sys.env.home())
  30. // so that it will work in both the IntraBuilder designer and server.
  31. _sys.scripts.load(_sys.env.home() + "apps\\shared\\dateex.js");
  32.  
  33. // {End Header} Do not remove this comment//
  34. // Generated on 08/27/1996
  35. //
  36. var r = new ENTRIESReport();
  37. if (ENTRIES.arguments.length == 2) {
  38.    r.startPage = ENTRIES.arguments[0];
  39.    r.endPage = ENTRIES.arguments[1];
  40. }
  41. r.render();
  42. class ENTRIESReport extends Report {
  43.    _sys.scripts.load(_sys.env.home() + "APPS\\SHARED\\CONTROLS.CC")
  44.    with (this) {
  45.       title = "Guest Book Entries";
  46.       linkText = "Next Page of Guest Book Entries";
  47.       onDesignLoad = {;_sys.scripts.load(_sys.env.home() + "apps\\shared\\dateex.js")};
  48.    }
  49.  
  50.    with (this.ibapps1 = new Database()){
  51.       left = 0;
  52.       top = 0;
  53.       databaseName = "IBAPPS";
  54.       active = true;
  55.    }
  56.  
  57.  
  58.    with (this.guest1 = new Query()){
  59.       left = 0;
  60.       top = 0;
  61.       database = parent.ibapps1;
  62.       sql = "select * from guest order by visittime desc";
  63.       active = true;
  64.    }
  65.  
  66.  
  67.    with (this.guest1.rowset) {
  68.  
  69.    }
  70.  
  71.    with (this.printer) {
  72.       duplex = 1;
  73.       orientation = 1;
  74.       paperSource = 15;
  75.       paperSize = 1;
  76.       color = 2;
  77.       trueTypeFonts = 2;
  78.    }
  79.  
  80.  
  81.    with (this.pageTemplate1 = new PageTemplate(this)){
  82.       height = 15840;
  83.       width = 12240;
  84.       marginTop = 1080;
  85.       marginLeft = 1080;
  86.       marginBottom = 1080;
  87.       marginRight = 1080;
  88.       gridLineWidth = 0;
  89.       color = "a4d5ff";
  90.    }
  91.  
  92.  
  93.    with (this.pageTemplate1.streamFrame1 = new StreamFrame(this.pageTemplate1)){
  94.       height = 10000;
  95.       left = 360;
  96.       top = 1599;
  97.       width = 9360;
  98.    }
  99.  
  100.  
  101.    with (this.pageTemplate1.GuestBookLogo = new Image(this.pageTemplate1)){
  102.       height = 880;
  103.       left = 360;
  104.       top = 360;
  105.       width = 800;
  106.       dataSource = 'filename GESTBK31.GIF';
  107.       alignment = 4;
  108.    }
  109.  
  110.  
  111.    with (this.pageTemplate1.HeadingHTML = new HTML(this.pageTemplate1)){
  112.       height = 630;
  113.       left = 1500;
  114.       top = 360;
  115.       width = 4000;
  116.       color = "steelblue";
  117.       text = '<H1><FONT SIZE="+4"><FONT COLOR="mediumvioletred">G</FONT></FONT>uest <FONT SIZE="+4"><FONT COLOR="mediumvioletred">B</FONT></FONT>ook <FONT SIZE="+4"><FONT COLOR="mediumvioletred">E</FONT></FONT>ntries</H1>';
  118.    }
  119.  
  120.  
  121.    with (this.pageTemplate1.HomePageLinkImage = new Image(this.pageTemplate1)){
  122.       height = 630;
  123.       left = 360;
  124.       top = 12000;
  125.       width = 2355;
  126.       dataSource = 'filename HOMEPG31.GIF';
  127.       alignment = 4;
  128.       onImageClick = class::link_to_home_page;
  129.    }
  130.  
  131.  
  132.    with (this.pageTemplate1.HomePageLinkHTML = new HTML(this.pageTemplate1)){
  133.       height = 300;
  134.       left = 3000;
  135.       top = 12000;
  136.       width = 4315;
  137.       color = "black";
  138.       fontBold = false;
  139.       text = {||'<A HREF="/ibapps/index.htm">Return to Home Page</A>'};
  140.    }
  141.  
  142.  
  143.    with (this.pageTemplate1.rule1 = new Rule(this.pageTemplate1)){
  144.       left = 360;
  145.       top = 12800;
  146.       size = 2;
  147.       right = 8000;
  148.    }
  149.  
  150.  
  151.    with (this.pageTemplate1.generatedHTML1 = new GeneratedHTML(this.pageTemplate1)){
  152.       height = 255;
  153.       left = 360;
  154.       top = 13200;
  155.       width = 8000;
  156.    }
  157.  
  158.  
  159.    with (this.streamSource1 = new StreamSource(this)){
  160.  
  161.    }
  162.  
  163.  
  164.    with (this.streamSource1.detailBand) {
  165.       height = 1099;
  166.    }
  167.  
  168.  
  169.    with (this.streamSource1.detailBand.CommentHTML = new HTML(this.streamSource1.detailBand)){
  170.       height = 200;
  171.       width = 8000;
  172.       color = "black";
  173.       text = {||this.form.guest1.rowset.fields["COMMENT"].value};
  174.    }
  175.  
  176.  
  177.    with (this.streamSource1.detailBand.FullnameHTML = new HTML(this.streamSource1.detailBand)){
  178.       height = 200;
  179.       top = 200;
  180.       width = 8000;
  181.       color = "black";
  182.       fontBold = false;
  183.       text = {||this.form.noNull(this.form.guest1.rowset.fields["FULLNAME"].value) + this.form.noNull(" (<a href='mailto:" + this.form.guest1.rowset.fields["EMAIL"].value + "'>" +  this.form.guest1.rowset.fields["EMAIL"].value + "</A>)")};
  184.    }
  185.  
  186.  
  187.    with (this.streamSource1.detailBand.WherefromHTML = new HTML(this.streamSource1.detailBand)){
  188.       height = 200;
  189.       top = 400;
  190.       width = 8000;
  191.       color = "black";
  192.       fontBold = false;
  193.       text = {||this.form.noNull(this.form.guest1.rowset.fields["WHEREFROM"].value + " - ") + this.form.getVisitDate(this.form) + " at " + this.form.getVisitTime(this.form)};
  194.    }
  195.  
  196.  
  197.    with (this.streamSource1.detailBand.FirstVisitHTML = new HTML(this.streamSource1.detailBand)){
  198.       height = 200;
  199.       top = 600;
  200.       width = 8000;
  201.       color = "mediumvioletred";
  202.       suppressIfBlank = true;
  203.       fontBold = false;
  204.       text = {||this.form.guest1.rowset.fields["FIRSTVISIT"].value ? "(First time visitor)" : ""};
  205.    }
  206.  
  207.  
  208.    with (this.streamSource1.detailBand.rule1 = new Rule(this.streamSource1.detailBand)){
  209.       top = 800;
  210.       size = 2;
  211.       right = 8000;
  212.    }
  213.  
  214.  
  215.    with (this.reportGroup) {
  216.       groupBy = "";
  217.    }
  218.  
  219.  
  220.    with (this.reportGroup.headerBand) {
  221.       height = 0;
  222.    }
  223.  
  224.  
  225.    with (this.reportGroup.footerBand) {
  226.       height = 0;
  227.    }
  228.  
  229.    this.firstPageTemplate = this.form.pageTemplate1
  230.    this.form.pageTemplate1.nextPageTemplate = this.form.pageTemplate1
  231.    this.form.pageTemplate1.streamFrame1.streamSource = this.form.streamSource1
  232.    this.form.streamSource1.rowset = this.form.guest1.rowset
  233.  
  234.    function getVisitDate(frm) {
  235.       var dateEx = new DateEx(""+frm.guest1.rowset.fields["VisitTime"].value);  // in dateex.js
  236.       return (dateEx.getSDay() + ", " + dateEx.getSDate());
  237.    }
  238.  
  239.    function getVisitTime(frm) {
  240.       var dateEx = new DateEx(""+frm.guest1.rowset.fields["VisitTime"].value);  // in dateex.js
  241.       return (dateEx.getSTime(false,true) + " (" + dateEx.getSTimezone() + ")");
  242.    }
  243.  
  244.    function noNull( val ) {
  245.       return ( val==null ? "" : val );
  246.    }
  247.  
  248.    function link_to_home_page()
  249.    {
  250.    // {Export} This comment causes this function body to be sent to the client
  251.       location.href="/ibapps/index.htm";
  252.    }
  253.  
  254. }
  255.