Highlighted
Absent Member.
Absent Member.
3203 views

[archive] View/Print with Internet Explorer

[Migrated content. Thread originally posted on 22 January 2009]

We are calling Internet Explorer (with a script using c$system) to display reports, which is working great. The problem is page breaks. It seems as though internet explorer is not recognizing the breaks if the last line of the page is blank. If there is data in the last line of a page it seems to break/display correctly. Has anyone else experienced this problem or have any ideas? Or does anyone know of a free small viewer with print capabilities we could use instead?
Thanks, Kim
0 Likes
15 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] View/Print with Internet Explorer

when i use html to print which page breake i use the html-code to define a page break.

For Example:





when i dosn't need a print-preview i use the mshtml.dll to print the html-page

Example:

           call "c$run" using 'rundll32.exe mshtml.dll,PrintHTML "c:\muf
      -                       'frohr\dummy.html"'.


David
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] View/Print with Internet Explorer

KevinB I would be interested if your C$SYSTEM call is being used over Thin or are your apps run locally?

We have been looking at ways to call IE on a multitude of types of machines that our users have (PC's, Thin-Client Citrix, etc). I would also like to see the code you used to call IE, maybe I can make it work for us.

Thanks
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] View/Print with Internet Explorer

If you want to be able to print html in an easy way on thin client, why don't you just use the WebBrowser component?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] View/Print with Internet Explorer

Sorry for hijaxing this thread....

We do use the WebBrowser component for some things. We use it to automatically get driving directions from address to address, lookup zip codes, etc. The issue we have with it is websites that require logins, our users are forced to login over and over all day. With IE they simply pull it up and leave it all day on the same website.

We have at one time had the IE working using the following:

Call "DISPLAY_REG_QUERY_VALUE"
USING HKEY_CLASSES_ROOT,
WS-RETURN-VALUE,
WS-RETURN-SIZE,
"\HTTP\shell\open\command",
GIVING WS-STATUS-CODE.

MOVE 1 TO PTR.
UNSTRING WS-RETURN-VALUE DELIMITED BY ".EXE"
INTO WS-RETURN-VALUE1
WITH POINTER PTR.

STRING WS-RETURN-VALUE(1:PTR) DELIMITED BY SIZE
" http://www.msn.com/" DELIMITED BY SIZE
INTO WS-ADDRESS.

call "c$system" using WS-ADDRESS, 129.

This seems to work on some machines and on others it does not. We understand that the registry of different versions of windows is probably the issue.

One other issue is we also have lots of HP Thin-Client boxes hooked into the system via Citrix so lots of normal Windows logic just does not work on those thin-client boxes.

This is the reason that I asked about the c$system call used by the other user, I would like to see other methods of getting to IE.

Thanks
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] View/Print with Internet Explorer

Well, this is how I would do it:

       IDENTIFICATION               DIVISION.
       PROGRAM-ID.                  TEMPLATE.
       ENVIRONMENT                  DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
       WORKING-STORAGE SECTION.
       77  CNTL-FONT                USAGE HANDLE OF FONT SMALL-FONT.
       77  KEY-STATUS               IS SPECIAL-NAMES
           CRT STATUS               PIC 9(4) VALUE 0.
           88  EXIT-PRESSED         VALUE 27.
       SCREEN      SECTION.
       01  TEMPLATE-SCREEN.
           03 WEB-BROWSER
              LINE                  02
              COL                   02
              LINES                 34
              SIZE                  77
              VALUE                 "[URL]http://www.msn.com[/URL]".     
           03 PUSH-BUTTON
              LINE                  38
              COL                   63
              SIZE                  14
              TITLE                 "E&xit"
              SELF-ACT
              EXCEPTION-VALUE       = 27.
       PROCEDURE DIVISION.
       MAIN-LOGIC.
           DISPLAY STANDARD         GRAPHICAL WINDOW
                   TITLE            "Browser demo"
                   CONTROL          FONT CNTL-FONT
                   SIZE             80
                   LINES            40
                   BACKGROUND-LOW.
    PERFORM INITIALIZE-DATA.
           DISPLAY TEMPLATE-SCREEN.
           PERFORM WITH TEST AFTER  UNTIL EXIT-PRESSED
                   ACCEPT           TEMPLATE-SCREEN
           END-PERFORM.
           DESTROY TEMPLATE-SCREEN.
           STOP    RUN.
       INITIALIZE-DATA.
           INITIALIZE               KEY-STATUS.
           EXIT    PARAGRAPH.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] View/Print with Internet Explorer

Very nice, thanks for the direction (code)!

That leads me to another question: If the system kicks up the window as seen below is there a way to send a new address to it without just starting a new version of the program with a new address? I would like to just keep one IE type window up and just push new addresses to it, so the user does not have 10 IE type windows open.

Thanks again!!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] View/Print with Internet Explorer

I don't see a window below, but you can reuse the browser there is by using the MODIFY verb:

           03 MyBrowser        WEB-BROWSER
              LINE                  02
              COL                   02
              LINES                 34
              SIZE                  77
              VALUE                 "[URL]http://www.msn.com[/URL]". 
          ...
          MODIFY MyBrowser Value = "http://[URL="http://www.microfocus.com"]www.microfocus.com[/URL]"
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] View/Print with Internet Explorer

Sorry for not explaining better.....let me try again.

If we make our system create the IE Type screen (using the logic below as a guide to creating the standard window) how can we change the address in that browser window from another process/program?

Concept we are trying to hammer down is being able to open IE browser and update that browser with different addresses instead of opening multiple IE browsers.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] View/Print with Internet Explorer

A component is bound to its window, e.g. you cannot modify it directly. However, if you are running threads, you can use the message mechanism between threads to achieve this.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] View/Print with Internet Explorer

I played with threads for most of the day (not what I was scheduled to do, but it was fun). I was attempting to use the Send - Receive commands but could never get the IE Type screen program to see "receive" any info.

I was attempting:

To start the IE Type program I had a CALL THREAD {PROGRAM NAME} HANDLE IE-HANDLE.

After it was up and running on the screen, I minimized it (or moved it out of the way) and went back into the original program and did a SEND [working storage variable] in handle {handle name}.

In the ID type program I had the logic running that was from the AcuDocs samples to RECEIVE [working storage variable] from any thread. I then checked the value of the working storage variable the value from the first program but never got anything.

I know this is just words and no code, but I had to remove the code I was playing with at the end of the day (since I was in a production program).

Is there a sample program out there that would help with this?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] View/Print with Internet Explorer

There is an example of send/receive on the web site, go to:
http://supportline.microfocus.com/examplesandutilities/extend/SamplePrograms/GeneralProgTechniques.asp

Look for sendrcv.zip

Do note that as I presume your IE program is put in an ACCEPT state, you will have to tell it to accept messages, you do this:
ACCEPT myscreen ALLOWING MESSAGES
An incoming message will then throw the exception W-MESSAGE (95) to which you will respond with a RECEIVE command to get the message.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.