home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / ib / setups / intrabld / data.z / ENTRIES.JRP < prev    next >
Text File  |  1996-12-11  |  8KB  |  251 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 11/06/96 by IntraBuilder Samples Group                             *
  23. * $Revision:   1.18  $                                                       *
  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 11/06/96
  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.       onDesignLoad = {;_sys.scripts.load(_sys.env.home() + "apps\\shared\\dateex.js")};
  46.       title = "Guest Book Entries";
  47.       linkText = "Next Page of Guest Book Entries";
  48.    }
  49.  
  50.  
  51.    with (this.ibapps1 = new Database()){
  52.       left = 0;
  53.       top = 0;
  54.       databaseName = "IBAPPS";
  55.       active = true;
  56.    }
  57.  
  58.  
  59.    with (this.guest1 = new Query()){
  60.       left = 0;
  61.       top = 0;
  62.       database = parent.ibapps1;
  63.       sql = "select * from guest order by visittime desc";
  64.       active = true;
  65.    }
  66.  
  67.  
  68.    with (this.guest1.rowset) {
  69.  
  70.    }
  71.  
  72.  
  73.    with (this.streamSource1 = new StreamSource(this)){
  74.  
  75.    }
  76.  
  77.  
  78.    with (this.streamSource1.detailBand) {
  79.       height = 1099;
  80.    }
  81.  
  82.  
  83.    with (this.streamSource1.detailBand.CommentHTML = new HTML(this.streamSource1.detailBand)){
  84.       height = 200;
  85.       width = 9000;
  86.       color = "black";
  87.       text = {||this.form.guest1.rowset.fields["COMMENT"].value};
  88.    }
  89.  
  90.  
  91.    with (this.streamSource1.detailBand.FullnameHTML = new HTML(this.streamSource1.detailBand)){
  92.       height = 200;
  93.       top = 200;
  94.       width = 9000;
  95.       color = "black";
  96.       fontBold = false;
  97.       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>)")};
  98.    }
  99.  
  100.  
  101.    with (this.streamSource1.detailBand.WherefromHTML = new HTML(this.streamSource1.detailBand)){
  102.       height = 200;
  103.       top = 400;
  104.       width = 9000;
  105.       color = "black";
  106.       fontBold = false;
  107.       text = {||this.form.noNull(this.form.guest1.rowset.fields["WHEREFROM"].value + " - ") + this.form.getVisitDate(this.form) + " at " + this.form.getVisitTime(this.form)};
  108.    }
  109.  
  110.  
  111.    with (this.streamSource1.detailBand.FirstVisitHTML = new HTML(this.streamSource1.detailBand)){
  112.       height = 200;
  113.       top = 600;
  114.       width = 9000;
  115.       color = "mediumvioletred";
  116.       suppressIfBlank = true;
  117.       fontBold = false;
  118.       text = {||this.form.guest1.rowset.fields["FIRSTVISIT"].value ? "(First time visitor)" : ""};
  119.    }
  120.  
  121.  
  122.    with (this.streamSource1.detailBand.rule1 = new Rule(this.streamSource1.detailBand)){
  123.       top = 800;
  124.       size = 2;
  125.       right = 9000;
  126.    }
  127.  
  128.  
  129.    with (this.pageTemplate1 = new PageTemplate(this)){
  130.       height = 15840;
  131.       width = 9000;
  132.       marginTop = 0;
  133.       marginLeft = 0;
  134.       marginBottom = 0;
  135.       marginRight = 0;
  136.       gridLineWidth = 0;
  137.       color = "a4d5ff";
  138.    }
  139.  
  140.  
  141.    with (this.pageTemplate1.streamFrame1 = new StreamFrame(this.pageTemplate1)){
  142.       height = 10000;
  143.       top = 1599;
  144.       width = 9000;
  145.    }
  146.  
  147.  
  148.    with (this.pageTemplate1.GuestBookLogo = new Image(this.pageTemplate1)){
  149.       height = 1250;
  150.       width = 1250;
  151.       dataSource = "filename GESTBK31.GIF";
  152.       alignment = 4;
  153.    }
  154.  
  155.  
  156.    with (this.pageTemplate1.HeadingHTML = new HTML(this.pageTemplate1)){
  157.       height = 630;
  158.       left = 1500;
  159.       width = 7500;
  160.       color = "steelblue";
  161.       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>';
  162.    }
  163.  
  164.  
  165.    with (this.pageTemplate1.HomePageLinkImage = new Image(this.pageTemplate1)){
  166.       onImageClick = class::HomePageLinkImage_onClick;
  167.       height = 1250;
  168.       top = 12000;
  169.       width = 1250;
  170.       dataSource = "filename HOMEPG31.GIF";
  171.       alignment = 4;
  172.    }
  173.  
  174.  
  175.    with (this.pageTemplate1.HomePageLinkHTML = new HTML(this.pageTemplate1)){
  176.       height = 300;
  177.       left = 1500;
  178.       top = 12000;
  179.       width = 4315;
  180.       color = "black";
  181.       fontBold = false;
  182.       text = {||'<A HREF="/ibapps/index.htm">Return to Home Page</A>'};
  183.    }
  184.  
  185.  
  186.    with (this.pageTemplate1.rule1 = new Rule(this.pageTemplate1)){
  187.       top = 13400;
  188.       size = 2;
  189.       right = 9000;
  190.    }
  191.  
  192.  
  193.    with (this.pageTemplate1.generatedHTML1 = new GeneratedHTML(this.pageTemplate1)){
  194.       height = 255;
  195.       top = 13500;
  196.       width = 9000;
  197.    }
  198.  
  199.  
  200.    with (this.printer) {
  201.       duplex = 1;
  202.       orientation = 1;
  203.       paperSource = 15;
  204.       paperSize = 1;
  205.       resolution = 4;
  206.       color = 2;
  207.       trueTypeFonts = 2;
  208.    }
  209.  
  210.  
  211.    with (this.reportGroup) {
  212.       groupBy = "";
  213.    }
  214.  
  215.  
  216.    with (this.reportGroup.headerBand) {
  217.       height = 0;
  218.    }
  219.  
  220.  
  221.    with (this.reportGroup.footerBand) {
  222.       height = 0;
  223.    }
  224.  
  225.    this.firstPageTemplate = this.form.pageTemplate1
  226.    this.form.pageTemplate1.nextPageTemplate = this.form.pageTemplate1
  227.    this.form.pageTemplate1.streamFrame1.streamSource = this.form.streamSource1
  228.    this.form.streamSource1.rowset = this.form.guest1.rowset
  229.  
  230.    function getVisitDate(frm) {
  231.       var dateEx = new DateEx(""+frm.guest1.rowset.fields["VisitTime"].value);  // in dateex.js
  232.       return (dateEx.getSDate());
  233.    }
  234.  
  235.    function getVisitTime(frm) {
  236.       var dateEx = new DateEx(""+frm.guest1.rowset.fields["VisitTime"].value);  // in dateex.js
  237.       return (dateEx.getSTime(false,true) + " (" + dateEx.getSTimezone() + ")");
  238.    }
  239.  
  240.    function noNull( val ) {
  241.       return ( val==null ? "" : val );
  242.    }
  243.  
  244.    function HomePageLinkImage_onClick()
  245.    {
  246.    // {Export} This comment causes this function body to be sent to the client
  247.       location.href="/ibapps/index.htm";
  248.    }
  249.  
  250. }
  251.