Why .rdlc report renders differently in different

2020-02-15 08:36发布

问题:

I have a project in Visual Studio, which uses .rdlc reports. After it processes all data, it will display the output as a report on the webpage. However, I getting a problem in terms of rendering/formatting.

Problem

When I run within the localhost environment (main browser is IE11), report is rendered as intended and produces the output like following report sample:

However, when I am running the program within the dev environment web server (also in IE11), I am receiving the following bug:

Like shown on the picture, in dev environment the subtitle of the report is going on the top of table header when it reaches newline.

What have I done thus far?

1) I compared IE versions, which were run on localhost and dev environment. They both were run on the same IE11 browsers. Which eliminated my theory in IE browser version differences.

2) I ran both localhost and dev environments in different browsers (Chrome, Firefox). Both localhost and dev environment reports rendered properly in these browsers, which eliminated a different browser theory.

3) Based on the conclusion I made below, I performed some research, and the following post was the closest thing I was able to reach.

Overall

After performing steps above, I noticed that only dev environment in IE11 was producing the header bug (second picture). That led me to the conclusion that it has to do with IE11 rendering. Which makes me even more confused, since localhost environment ran in IE11 browser rendered properly (first picture).

Question

What causes this bug? Why IE on the dev environment behaves differently than localhost environment?

Ultimately, is there a way to fix this bug? If yes, what do I do(add/remove files to the dev environment, write compatibility code lines somewhere)?

EDIT

After some additional research, I found this question, however, this question was never answered. I tried looking into suggestions in comments, but to no avail.

EDIT 2

I have tried adding meta tag to the parent view file, it did not solve the problem.

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

It also does not help when I add the following lines into web.config

<httpProtocol>
    <customHeaders>
        <add name="X-UA-Compatible" value="IE=edge" />
    </customHeaders>
</httpProtocol>

回答1:

The main reason it was causing a problem for me is that it was running in compatibility mode. Ticking off the first flag in Compatibility view settings has solved the issue for me.