ms-access - 如何让我的 webbrowser-control 的内容在打印时显示在我的 MS Access 报告中?

标签 ms-access pdf vba webbrowser-control

此处重复未回答:MsAccess Webbrowser Control on a Report not working

大家好。我尝试执行以下操作均未成功:

当我的 MS Access 2010 报告处于打印预览状态以及当我将其导出为 pdf 时,使我的网络浏览器控件的内容(在本例中为使用 api 的静态谷歌地图)可见。

对于我的工作示例,我的 Access 2010 数据库中有以下三个对象:

1) 一个名为“tbl_Locations”的表(其中包含三个站点的位置数据)

表格如下:

LocationID | Location_Name |      Address         | Zip | 

      1          Site A      162 East 33rd street  10016
      2          Site B      550 1st Avenue        10016
      3          Site C      151 West 26th Street  10001

enter image description here

2) 一个表单 - 称为“frm_Locations”(此表单的控件源是“tbl_Locations”)。值得注意的是,这是包含 webbrowser-control 对象的表单(其中静态谷歌地图是从“tbl_Locations”中的数据生成的)。

设计 View 中的表单:

enter image description here

表单 View 中的表单:

enter image description here

3) 一份报告 - 称为“rpt_Locations”(我在其中嵌入了“frm_Locations”对象)

“报告” View 中的报告

enter image description here

在“打印预览”中报告

enter image description here

如果您单击上面的图片链接,您可以看到网络浏览器控件及其内容在“frm_Locations”的“表单” View 和“rpt_Locations”的“报告” View 中可见。

但是,在“rpt_Locations”的“打印预览” View 中并非如此。此外,当我将报告对象导出为 pdf 时,我看不到 webbrowser-control 或其中的静态谷歌地图。

我想知道为什么会发生这种情况,如果有 VBA 解决方案我可以用来改善这种情况。

最佳答案

静态 map API 似乎从 URL 返回 Google map 的 jpg

https://developers.google.com/maps/documentation/staticmaps/

然后您可以在您的浏览器中加载 jpg 或将 jpg 嵌入您的报告中,并且大概会出现在您的 pdf 中。

就像这个网址

https://maps.googleapis.com/maps/api/staticmap?center=40.714728,-73.998672&zoom=12&size=400x400

提供这张 map

enter image description here

关于ms-access - 如何让我的 webbrowser-control 的内容在打印时显示在我的 MS Access 报告中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26286483/

相关文章:

java - 将日期时间插入 MS Access

sql - 如何将多行excel数据传输到 Access 表中

C# OleDbParameter 与 Access DateTime 查询

javascript - Safari 12 不会下载 PDF blob

pdf - 如何将文本对象添加到现有的pdf

visual-studio - 使用 Visual Studio 而不是内置 VBA 编辑器

c# - 如何从带有变量的 Access 数据库运行 C# 中的 Select 语句?

powershell - 使用 Powershell 和 iTextSharp 旋转 PDF

Excel 2010 - 具有覆盖字段的值小计

excel - 在 Excel 中检查/检测动态数组溢出