gpt4 book ai didi

reporting-services - 在 Reporting Services 中,将背景图像的质量提高到 96 dpi 以上

转载 作者:行者123 更新时间:2023-12-04 15:24:36 25 4
gpt4 key购买 nike

我想使用背景图像,当我将其放入 Reporting Services 2008 R2 时,图像 dpi 降低到 96 dpi。 (而不是 300)

我担心,这太低了,用户无法阅读。

当我上网时,我发现这样的结果:

http://social.technet.microsoft.com/Forums/en-US/sqlreportingservices/thread/48de91f9-1844-40c1-9614-5ead0b4b69a5#P1Q14

Question 14: How to improve PDF quality of the report exported in Reporting Services 2005?

Answer: The PDF renderer in Reporting Services 2005 resizes all images that it is given at 96 DPI no matter what DPI the image is when you pass it to the renderer. That means that a 300 DPI image or even a 600 DPI image will be sized in the PDF as if it is only 96 DPI. In other words, your high DPI image may render larger than expected.
Despite sizing the images as if they were 96 DPI, the PDF renderer appears to render higher DPI images at a higher quality than 96 DPI. Even if the sizing being wrong, the image actually is rendering at a higher quality. A necessary workaround is to size the image to the proper number of inches based on 96 DPI calculations. Then use Bitmap.SetResolution to set the images to at least 300 DPI. That may provide a higher quality image that is the proper number of pixels to fit properly in the report.



但我不知道如何使用 Bitmap.SetResolution,我使用的是经典的报表查看器 Web 控件,我真的需要一个功能齐全的 pdf 导出。

PS:也许这个问题在 Reporting Services 2012 中得到了解决。有人有一些信息吗?

问候

最佳答案

我找到了一个网页,它解释了如何以良好的 dpi 导出 PDF。 http://codeproject.com/Articles/95750/High-fidelity-printing-through-the-SSRS-Report-Vie

关键是用xml代码初始化deviceInfo字符串

       var sb = new System.Text.StringBuilder(1024);
var xr = System.Xml.XmlWriter.Create(sb);
xr.WriteStartElement("DeviceInfo");
xr.WriteElementString("DpiX", "296");
xr.WriteElementString("DpiY", "296");
xr.Close();

deviceInfo = sb.ToString();

rsExec.SetExecutionParameters(parameters, "fr-fr");

results = rsExec.Render(format, deviceInfo,
out extension, out encoding,
out mimeType, out warnings, out streamIDs);

在这种情况下,此解决方案有效。我可以用好的 dpi 生成一个 pdf 文件,但是带有 activex 的打印按钮不起作用(这应该不是问题)和导出按钮。我必须添加一个下载按钮才能打印。恕我直言,这是一个部分解决方案

关于reporting-services - 在 Reporting Services 中,将背景图像的质量提高到 96 dpi 以上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13764759/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com