Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Print and Print Preview of Web Page not Working Properly in Microsoft Edge Browser

Print and Print Preview of Web Page not Working Properly in Microsoft Edge Browser

Scheduled Pinned Locked Moved C#
csscomhelptutorialquestion
7 Posts 3 Posters 19 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fokwa Divine
    wrote on last edited by
    #1

    I have a strange issue I am experiencing with a web app. Typically, the user right clicks on the web page and click Print. He views the document in preview and then decides how to print it. On Chrome, everything works fine On Microsoft Edge, It only works if you right click the web page at the top of the page. If you scroll down to the bottom of the page before you right click and select print, the printed document is not formatted properly. The print preview is also not formatted properly. See screen shots below: On Chrome - (User right click from bottom of page) You can see the title of the app, title of the report, report run date etc Report Issue - Chrome.PNG - Google Drive[^] On MS Edge - (User right click from bottom of page) The preview starts at some random data as shown below. Title of the app, title of report etc are not shown in the preview and printed version. Report Issue - MS Edge.PNG - Google Drive[^] As you can see from the above screen shots, Chrome is displayed properly. MS Edge only displays like that if I right click on the web page from the top of the page without scrolling down Below is my code sample:

    Physician Activity Report
    

    Below is the content of mycss.css

    @media print {
    .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
    .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
    float: left;
    }

    .col-md-12 {
        width: 100%;
    }
    
    .col-md-11 {
        width: 91.66666666666666%;
    }
    
    .col-md-10 {
        width: 83.333333
    
    J R 2 Replies Last reply
    0
    • F Fokwa Divine

      I have a strange issue I am experiencing with a web app. Typically, the user right clicks on the web page and click Print. He views the document in preview and then decides how to print it. On Chrome, everything works fine On Microsoft Edge, It only works if you right click the web page at the top of the page. If you scroll down to the bottom of the page before you right click and select print, the printed document is not formatted properly. The print preview is also not formatted properly. See screen shots below: On Chrome - (User right click from bottom of page) You can see the title of the app, title of the report, report run date etc Report Issue - Chrome.PNG - Google Drive[^] On MS Edge - (User right click from bottom of page) The preview starts at some random data as shown below. Title of the app, title of report etc are not shown in the preview and printed version. Report Issue - MS Edge.PNG - Google Drive[^] As you can see from the above screen shots, Chrome is displayed properly. MS Edge only displays like that if I right click on the web page from the top of the page without scrolling down Below is my code sample:

      Physician Activity Report
      

      Below is the content of mycss.css

      @media print {
      .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
      .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
      float: left;
      }

      .col-md-12 {
          width: 100%;
      }
      
      .col-md-11 {
          width: 91.66666666666666%;
      }
      
      .col-md-10 {
          width: 83.333333
      
      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      No idea what the answer is but I did upvote the question because someone down voted it and without explanation. Seems like a reasonable question to me. Perhaps they wanted you to post in a different forum but didn't feel like explaining that.

      F 1 Reply Last reply
      0
      • J jschell

        No idea what the answer is but I did upvote the question because someone down voted it and without explanation. Seems like a reasonable question to me. Perhaps they wanted you to post in a different forum but didn't feel like explaining that.

        F Offline
        F Offline
        Fokwa Divine
        wrote on last edited by
        #3

        Yeah. It is a strange issue that our users recently brought up. Most users use MS Edge. I don't know what angle to analyze from. It is a .NET Core web app.

        1 Reply Last reply
        0
        • F Fokwa Divine

          I have a strange issue I am experiencing with a web app. Typically, the user right clicks on the web page and click Print. He views the document in preview and then decides how to print it. On Chrome, everything works fine On Microsoft Edge, It only works if you right click the web page at the top of the page. If you scroll down to the bottom of the page before you right click and select print, the printed document is not formatted properly. The print preview is also not formatted properly. See screen shots below: On Chrome - (User right click from bottom of page) You can see the title of the app, title of the report, report run date etc Report Issue - Chrome.PNG - Google Drive[^] On MS Edge - (User right click from bottom of page) The preview starts at some random data as shown below. Title of the app, title of report etc are not shown in the preview and printed version. Report Issue - MS Edge.PNG - Google Drive[^] As you can see from the above screen shots, Chrome is displayed properly. MS Edge only displays like that if I right click on the web page from the top of the page without scrolling down Below is my code sample:

          Physician Activity Report
          

          Below is the content of mycss.css

          @media print {
          .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
          .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
          float: left;
          }

          .col-md-12 {
              width: 100%;
          }
          
          .col-md-11 {
              width: 91.66666666666666%;
          }
          
          .col-md-10 {
              width: 83.333333
          
          R Offline
          R Offline
          RedDk
          wrote on last edited by
          #4

          I use Edge as a secondary browser when Firefox fails to display a dark background with light foreground because it (Edge) and it's settings remain at default. Nothing there in a contextual right-click and print (apparently CTrl+P also) fails when the target format is .PDF; so I suggest ... printing from the saved .pdf document instead of printing to .png.

          F 1 Reply Last reply
          0
          • R RedDk

            I use Edge as a secondary browser when Firefox fails to display a dark background with light foreground because it (Edge) and it's settings remain at default. Nothing there in a contextual right-click and print (apparently CTrl+P also) fails when the target format is .PDF; so I suggest ... printing from the saved .pdf document instead of printing to .png.

            F Offline
            F Offline
            Fokwa Divine
            wrote on last edited by
            #5

            Hi @RedDK, thanks for your input. Yeah CTrl+P also fails. Like I said in the question even the generated PDF is not formatted properly for MS Edge. Why is it that it works if I right click and click print from the top of the web page but as soon as I scroll down and do the same action it doesn't work in MS Edge ? What can I do to fix it ? What code do I need to add? Why don't I experience same issue in Chrome?

            R 1 Reply Last reply
            0
            • F Fokwa Divine

              Hi @RedDK, thanks for your input. Yeah CTrl+P also fails. Like I said in the question even the generated PDF is not formatted properly for MS Edge. Why is it that it works if I right click and click print from the top of the web page but as soon as I scroll down and do the same action it doesn't work in MS Edge ? What can I do to fix it ? What code do I need to add? Why don't I experience same issue in Chrome?

              R Offline
              R Offline
              RedDk
              wrote on last edited by
              #6

              Perhaps your reticense to post actual code instead of showing images through links is what's keeping me from seeing what could possibly be wrong here. I can right-click and Print this as-is ... with no difficulties.

              F 1 Reply Last reply
              0
              • R RedDk

                Perhaps your reticense to post actual code instead of showing images through links is what's keeping me from seeing what could possibly be wrong here. I can right-click and Print this as-is ... with no difficulties.

                F Offline
                F Offline
                Fokwa Divine
                wrote on last edited by
                #7

                I found the answer: It's a known issue in Edge version 126. The fix has been included in Stable 126.0.2592.81, which had been released on June 27, 2024. Please install the latest Edge Stable version 126.0.2592.81 (Official build) and test again.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups