New Response

« Return to the main article

You are replying to:

  1. To do this, you need to include some code in whatever column formula is appropriate. Personally, I have knocked regular views on the head as they never line up right. My web views are just one or two columns (if it's categorised) and the second column contains all the html to write out a complete row of the view, and do a check for a page throw at the end of each line.

    Like this, inside a column formula:

    DBPath:= "\\" + @ReplaceSubstring( @ReplaceSubstring( @Subset( @DbName; -1); "\\"; "/"); " "; "+");.... Yada Yada... declaring all the widths of the <TDs> and stuff...

    Blahdy Blah... now (whilst still in the column formula, declare (but not make) a call to a function checkRow in the JS Header of the document containing this view...

    check_break:="<SCRIPT>checkRow(" + @DocNumber("") + ")</SCRIPT>";

    (NB the ("") param to @DocNumber makes sure it only passes the RHS doc number, even in a categorised view. This is your FREE line count!)

    Now chuck out a line of the view as the return value for the column formula:

    "[[<!-- ignore -->]</NOSCRIPT>" + "<TR VALIGN=top>" + "<TD><SPAN style=\"WIDTH:85px; overflow:hidden\"><FONT SIZE=1 FACE=\"Verdana\">" + FldDateOfDuty.... blah...

    "<NOSCRIPT>" + check_break + "]"

    The inclusion of check_break in this string causes the checkRow function to be called:

    function checkRow(count) {

    if (count % LinesPerPage == 0) // time to throw page { document.write(ThrowPage + PageTopSimple); PageCount++; } }

    where (declared in JS Header of form including this view):

    LinesPerPage is a var in the JS header, set to whatever you need.

    var ThrowPage = "<DIV STYLE=\"page-break-before:always\"></DIV>";

    var PageTopSimple = "<TR><TD><HR></TD></TR>";

    Obviously, my page top is really more than a simple <HR>, it's acutally a knack-off string describing all the table headings, but you get the idea.

Your Comments