× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Here's a post I did about 6 to 9 months ago... I modified the Net.Data macro... 
I'll cut & paste it, but Craig Pelike did the work initially, and I played with 
it a little... it's a cool thing.  SQL did a lot of this work... Click on the 
link to see it in action (my goodness - the macro still exists!!) ...
***************************************************************************************************************
This is actually work done by Craig Pelike with some (ok maybe few)
modifications by myself but it's merely a possibility...

http://12.24.177.228/cgi-bin/db2www/ndsubfile.ndm/input

This is STANDARD net-data reading an SQL request - but I'm sure it can
be simulated with RPG Called routines, and Net.Data table support...

I think Joel hit the head on the nail - the programming is just
different.  We'd not put 100 fields to fill out on one screen 640x480
screen.  But - here's things I've seen that've been lost!

1) My wife ordered some Tupperware online - she's NOT a computer person.
Whereas you and I know to click on images when the mouse turns into a
finger, she was LOST - I observed her and learned how LITTLE intuitive
stuff is really on these pages.  No buttons that say "More Info" - it
seems stupid to you and I - but if people can't figure it out from a
glance, we're not doing our jobs right.  The buttons must be clear -
"Add to Cart" "More Info"  etc... buttons are ugly - but they work.
2) Help - you can have some INCREDIBLE person using WORD as an editor
create a help page.  When someone "clicks" on it, it grabs it out of the
IFS...

How will the user want to use the program.  How will it respond to them.
That sort of touchie feelie stuff


%{----------------------------------------------------------------------------%}
%{ StartRow.ndm -- Net.Data table processing with Starting Row number         %}
%{ Create numbered links to show sections of a resultset.                     %}
%{                                                                            %}
%{ Copyright (c) 2000, Craig Pelkie                                           %}
%{ ALL RIGHTS RESERVED                                                        %}
%{----------------------------------------------------------------------------%}

%{----------------------------------------------------------------------------%}
%{ Section A - Define section for the macro                                   %}
%{----------------------------------------------------------------------------%}
%define {

    DATABASE            = "*LOCAL"
    DTW_DEFAULT_REPORT  = "NO"
    DTW_SET_TOTAL_ROWS  = "YES"
    RPT_MAX_ROWS        = "10"

    currentPage         = "0"
    pageCount           = "1"
    rowCount            = "0"
    rowIndex            = "1"
    rowIndexNext        = "1"
    totalPages          = "0"
    DTW_USE_DB2_PREPARE_CACHE="YES"

%}

%{----------------------------------------------------------------------------%}
%{ Section B - RUNSQL - run the SQL statement, generate HTML table            %}
%{----------------------------------------------------------------------------%}

%function(DTW_SQL) RUNSQL() {

    select * from apilib/parts order by partno

    %report{

        %{--------------------------------------------------------------------%}
        %{ Section C - test for empty result set, exit if empty               %}
        %{--------------------------------------------------------------------%}

        %if (TOTAL_ROWS == "0")
            No rows retrieved for query.
            @dtw_exit()
        %endif

            <!---------------------------------------------------
                    Table headers
            ---------------------------------------------------->
            <table  border="1"
                    cellpadding="2"
                    cellspacing="0"
                    bgcolor="white"
                    width="500">

            <!-----------------------------------------------
                Navigation data and links
            ------------------------------------------------>
            <tr bgcolor="white" align="right">
                <td colspan="5">
                    <font size="-1" color="blue">

                        
%{---------------------------------------------------------%}
                        %{ Section D - calculate/display total number of pages 
to  %}
                        %{             generate (whole and fractional)          
   %}
                        
%{---------------------------------------------------------%}

                        @dtw_assign(totalPages, @DTW_RINTDIV(TOTAL_ROWS, 
RPT_MAX_ROWS))


                        %if (@dtw_rdivrem(TOTAL_ROWS, RPT_MAX_ROWS) > "0")
                            @dtw_add(totalPages, "1", totalPages)
                        %endif

                        Total rows: $(TOTAL_ROWS)
                        &nbsp;&nbsp;

                        Total pages: $(totalPages)
                        &nbsp;&nbsp;&nbsp;&nbsp;

                        
%{---------------------------------------------------------%}
                        %{ Section E - Put "<< Prev"" option if on page 2..n    
   %}
                        
%{---------------------------------------------------------%}

                        %if (START_ROW_NUM > RPT_MAX_ROWS)
                            <a href="input?s=@dtw_rsubtract(START_ROW_NUM, 
RPT_MAX_ROWS)">
                                << Prev
                            </a>
                            &nbsp;
                        %else
                                << Prev
                            &nbsp;
                        %endif

                        
%{---------------------------------------------------------%}
                        %{ Section F - Put links for each page                  
   %}
                        
%{---------------------------------------------------------%}

                        %while(pageCount <= totalPages) {

                            
%{-----------------------------------------------------%}
                            %{ Section G - link for "current page"              
   %}
                            
%{-----------------------------------------------------%}

                            %if (rowIndex == START_ROW_NUM)
                                <b>$(pageCount)</b>
                                @dtw_assign(rowIndexNext, @dtw_radd(rowIndex, 
RPT_MAX_ROWS))
                                @dtw_assign(currentPage, pageCount)

                            
%{-----------------------------------------------------%}
                            %{ Section H - link for other pages                 
   %}
                            
%{-----------------------------------------------------%}

                            %else
                                <a href="input?s=$(rowIndex)">$(pageCount)</a>
                            %endif

                            &nbsp;

                            @dtw_add(rowIndex,  RPT_MAX_ROWS, rowIndex)
                            @dtw_add(pageCount, "1",          pageCount)
                        %}

                        
%{---------------------------------------------------------%}
                        %{ Section I - Put "Next >>" option if on page 1..n-1   
   %}
                        
%{---------------------------------------------------------%}

                        %if (currentPage < totalPages)
                            <a href="input?s=$(rowIndexNext)">
                                Next >>
                            </a>
                            &nbsp;
                        %else
                                Next >>
                            &nbsp;
                        %endif

                    </font>
                </td>
            </tr>

            <!-----------------------------------------------
                Section J - Column names
            ------------------------------------------------>
            <tr bgcolor="lightsteelblue">
                <th><font size="-2">$(N1)</font></th>
                <th><font size="-2">$(N2)</font></th>
                <th><font size="-2">$(N3)</font></th>
                <th><font size="-2">$(N4)</font></th>
                <th><font size="-2">$(N5)</font></th>
            </tr>

            <!---------------------------------------------------
                 Section K - Table rows
            ---------------------------------------------------->

            %row{
                <tr>
                    <td align="center"><font size="-2">$(V1)</font></td>
                    <td>               <font size="-2">$(V2)</font></td>
                    <td align="right"> <font size="-2">$(V3)</font></td>
                    <td align="right"> <font size="-2">$(V4)</font></td>
                    <td align="center"><font size="-2">$(V5)</font></td>
                </tr>
            %}

        </table>
    %}
%}

%{----------------------------------------------------------------------------%}
%{ INPUT - initial section called, calls RUNSQL macro function                %}
%{----------------------------------------------------------------------------%}
%html(INPUT) {

        <html>
        <head>
            <title>Net.Data macro StartRow.ndm</title>
        </head>

        <body>
            <center>
                <h1>Net.Data macro StartRow.ndm</h1>

            
%{--------------------------------------------------------------------%}
            %{ Section L - Extract the starting row number from the Query 
String  %}
            
%{--------------------------------------------------------------------%}

            @dtw_assign(queryString, @dtw_rgetenv("QUERY_STRING"))
            @dtw_assign(eqPos,       @dtw_rpos("=", queryString))

            %if (eqPos >= "1")
                @dtw_assign(START_ROW_NUM, @dtw_rsubstr(queryString, 
@dtw_radd(eqPos, "1")))
            %else
                @dtw_assign(START_ROW_NUM, "1")
            %endif

            @RUNSQL()
            </center>
        </body>
    </html>
%}

Andrew Borts / Webmaster
Seta Corporation
6400 East Rogers Circle
Boca Raton, FL 33499

E-mail: Andrewb@setacorporation.com
Corporate web site http://www.setacorporation.com
E-Commerce web site http://www.palmbeachjewelry.com
                              http://www.myfreeitems.com
Voice: 561-994-2660 Ext. 2211 / Fax: 561-997-0774

-----Original Message-----
From: Nathan M. Andelin [mailto:nandelin@RELATIONAL-DATA.COM]
Sent: Monday, October 21, 2002 2:22 PM
To: web400@midrange.com
Subject: Re: [WEB400] Can CGI Do this ???

> From: "Andrew Borts" <Andrewb@SETACORPORATION.com
> Actually - on Pelike's web site, he has an example of a "Subfile" process
> in net.data (pushing the free solution built into ALL AS/400's...)

Andrew,

I too am a proponent of Net.Data for some applications.  Would you mind
sharing the link?

Nathan M. Andelin
www.relational-data.com


_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/web400
or email: WEB400-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.