printer info

Developers
2008-12-25
2012-08-14
  • This statement (with Lee's PrinterObject) gets various info:

    -- Gather data on the particuliar printer being used
    cap_array = oprn~GetCaps

    Is there a similar statement that gets the (currently set) number of lines per page ?
    Maybe complicated by the fact that the first page printed from my program has more space at the top than subsequent pages--about three line feeds. I'm trying to wrap headers and footers around multi-page reports.

    Data is one M record (totals) followed by various number of B records:

    iPage = 1
    
    nLoop = jLoop + 1
    
        Record_Type = SUBSTR(jArray[nLoop],1,1)
    
     if Record_Type =  'B' then
    call top                            --Headings used only if there are B records
    

    DO nLoop = nLoop to jArray~items /---------------start nLoop/

        Record_Type = SUBSTR(jArray[nLoop],1,1)
    
     if Record_Type =  'B' then 
       do
        if Lines > 52 then
           do
            Lines = 0
            iPage = iPage + 1
            call Footings
            call Headings_NJWR30_Xtra  -- subsequent page headings with 3 xtra linefeeds at the top
            call Top                   
           end
            ee_SS_Num = SUBSTR(jArray[nLoop],2,9)
            ee_SS_Num = INSERT('-',ee_SS_Num,5)
            ee_SS_Num = INSERT('-',ee_SS_Num,3)
            ee_Name = SUBSTR(jArray[nLoop],11,30)
            ee_Name_Control = SUBSTR(jArray[jLoop],11,4)
            ee_Wages = (SUBSTR(jArray[nLoop],41,12) / 100)~format(9,2)
            ee_Weeks = SUBSTR(jArray[nLoop],53,2)~format(2)
    
        Lines = Lines + 1
    
        oprn~PrintLine('   ' ee_SS_Num'    ' ee_Name ee_Wages'          ' ee_Weeks)
    
        if  Total_Employees < 19 then
            do
            oprn~PrintLine(' ')       --      double space if there is room
            Lines = Lines + 1
            end
       end
     else
       do
        jLoop = nLoop - 1       -- put jLoop back one record (to M record)
        nLoop = jArray~items    -- jump out of nLoop
       end
    

    END
    /---------------stop nloop/
    oprn~PrintLine(' ') / space at bottom /
    Lines = Lines + 1

    Needed = 53 - Lines
    do iFill = 1 to Needed
    oprn~PrintLine(' ')
    end

    call Footings -- maybe not if total B records = integer multiple of 52
    --Gary

     
    • Mark Miesfeld
      Mark Miesfeld
      2008-12-25

      Gary,

      You'll need to get Lee to help you with his printer object. It is written in Visual Basic as I recall. So we can't look into the source and tell you any thing about it. ;-(

      Maybe you can talk him into contributing the source to the project. If he were to do so, I'd try to rewrite the COM object in C++ and add it as an extension. Which could give ooRexx printing support on Windows.

      --
      Mark Miesfeld