作者:雪灵女子_826 | 来源:互联网 | 2023-05-17 21:27
Software:MicrosoftAccess2007SP2DatabaseFileVersion:Access2000软件:MicrosoftAccess2007
Software: Microsoft Access 2007 SP2
Database File Version: Access 2000
软件:Microsoft Access 2007 SP2数据库文件版本:Access 2000
I have an access program that I inherited from a previous employee. It uses forms for reports and since I don't have much experience in access I have continued to do this. I have created a copy of the program for another project and modified it to suit.
我有一个访问程序,我从前一个员工继承。它使用报表的形式,因为我没有太多的访问经验,我继续这样做。我为另一个项目创建了一个程序副本并对其进行了修改以适应。
I am having trouble getting more then one chart to print. All the charts display in form view, they all have the same properties (excepting data, position, etc.) For some reason they are not printing. They don't even show up in the print preview.
我无法获得更多的图表来打印。所有图表都显示在表单视图中,它们都具有相同的属性(除了数据,位置等)。由于某些原因,它们不是打印。它们甚至没有出现在打印预览中。
I am thinking it must be something with the graphs themselves as they sometimes lose all information. I have to open the graphs in edit mode and change the data source from column to row and back again so that it gets redrawn. (Refresh doesn't fix it)
我认为它必须与图表本身有关,因为它们有时会丢失所有信息。我必须在编辑模式下打开图形并将数据源从列更改为行再返回,以便重新绘制。 (刷新无法修复)
So right now I don't even have a clue as to where to look so ideas are welcome.
所以现在我甚至都不知道在哪里看,所以欢迎这些想法。
Edit #1
It seems to be a problem with linking to an unbound form.
链接到未绑定的表单似乎是一个问题。
Subform Field Linker: Can't build a link between unbound forms.
子表单字段链接器:无法在未绑定表单之间建立链接。
The query for the main form is
主窗体的查询是
SELECT tTest.ixTest, tMotorTypes.ixMotorType, tMotorTypes.asMotorType, tMotorTypes.fDeprecated, tTestType.asTest, tTest.asSerialNum, tTest.asOrderNum, tTest.asFrameNum, tTest.asRotorNum, tTest.asOperator, tTest.iStation, tTest.dtTestDate, tTest.ixTestType
FROM tMotorTypes
INNER JOIN (tTestType
INNER JOIN tTest ON tTestType.ixTestType=tTest.ixTestType)
ON tMotorTypes.ixMotorType=tTest.ixMotorType;
The query for the chart is:
图表的查询是:
SELECT qGraphRSTTemperatures.Frequency, qGraphRSTTemperatures.[Drive End], qGraphRSTTemperatures.[Non Drive End], qGraphRSTTemperatures.[Air In], qGraphRSTTemperatures.Core
FROM qGraphRSTTemperatures
ORDER BY qGraphRSTTemperatures.ixTemperature;
Query qGraphRSTTemperatures:
SELECT tElectricalData.dblFrequency AS Frequency, tTemperatures.dblDrvEnd AS [Drive End], tTemperatures.dblNonDrvEnd AS [Non Drive End], tTemperatures.dblAirIn AS [Air In], tTemperatures.dblCore AS Core, tSubTest.ixTest, tTemperatures.ixTemperature
FROM (tSubTest INNER JOIN tElectricalData ON tSubTest.ixSubTest = tElectricalData.ixSubTest)
LEFT JOIN tTemperatures ON tElectricalData.ixElectrical = tTemperatures.ixElectrical
WHERE (((tSubTest.ixSubTestType)=5))
ORDER BY tSubTest.ixTest, tTemperatures.ixTemperature;
So how come, in the form view it shows the graph with the correct data when linked thus:
那么为什么在表单视图中显示链接时带有正确数据的图形:
Child field: ixTest
Master field: ixTest
子字段:ixTest主字段:ixTest
but won't print the graph.
但不会打印图表。
The graph will print if I remove the links, but then I have all the data from chart query as it is not limited by ixTest.
如果我删除链接,图表将打印,但随后我将获得图表查询中的所有数据,因为它不受ixTest的限制。
edit #2
It seems to be a data retrieval/rendering issue in printing. Is there anything in printing that changes the context of records with respect to parent/child relationships?
它似乎是打印中的数据检索/渲染问题。打印中是否存在更改父/子关系记录上下文的内容?
4 个解决方案
I have a similar problem with a report. I created a graph that is in a group to give me a separate graph for each category (say divisions). The graphs all display fine in the report view (for each division) and the print preview but when I print to a pdf only the first graph prints. If I open the report and go to the print preview and then print to a PDF it works great. If this is the problem you are having here is my work around:
我的报告有类似的问题。我创建了一个组中的图形,为每个类别(比如分区)提供了一个单独的图表。图表在报告视图(每个分区)和打印预览中都显示正常,但是当我打印到pdf时,只打印第一个图形。如果我打开报告并转到打印预览,然后打印到PDF,它的效果很好。如果这是你遇到的问题,我的工作是:
I used VBA to follow a sequence to solve the problem. When a button is clicked on my main form the following events happen (1)Open the report in print preview (hidden), (2)open the print dialog box, after the PDF has been created the (3)report closes.
我使用VBA按顺序解决问题。当在我的主窗体上单击按钮时,会发生以下事件(1)打印打印预览中的报告(隐藏),(2)打开打印对话框,在创建PDF后(3)报告关闭。
Dim stDocName As String stDocName = "My Reports Name"
Dim stDocName As String stDocName =“我的报告名称”
(1) DoCmd.OpenReport stDocName, acViewPreview, , , acHidden
(1)DoCmd.OpenReport stDocName,acViewPreview ,,, acHidden
(2) DoCmd.RunCommand acCmdPrint
(2)DoCmd.RunCommand acCmdPrint
(3) DoCmd.Close acReport, "My Reports Name"
(3)DoCmd.Close acReport,“我的报告名称”