简体   繁体   English

C#XPS FixedDocument无法保存,宽度和高度必须为非负数

[英]C# XPS FixedDocument fails to save, width and height must be non-negative

I am having a problem with a XAML report that needs to be saved to XPS. 我的XAML报告有问题,需要将其保存到XPS。 Whenever the save is called the XPS Writing failed due to, "Height and Width must be non-negative". 每当调用保存时,由于“高度和宽度必须为非负数”,XPS写入失败。

When I inspect the object, most heights and widths are set to NaN. 当我检查对象时,大多数高度和宽度都设置为NaN。 I am assuming this is ok and is used as an auto value. 我假设这是可以的并用作自动值。 I have 2 reports built the same way and one saves and one doesn't. 我以相同的方式构建了2个报告,一个保存了,一个没有。

Is it possible that the problem is in the XAML usercontrols rather than in the way the document is constructed? 问题是否可能出在XAML用户控件中,而不是文档的构造方式中? The page size is set as follows. 页面尺寸设置如下。

fixedDocument = new FixedDocument();
fixedDocument.DocumentPaginator.PageSize = new Size(fixedDocumentWidth, fixedDocumentHeight);

Any ideas would be much appreciated! 任何想法将不胜感激!

问题已解决,制图软件出错导致图层问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C#:索引超出范围。 必须为非负数” - C# “Index was out of range. Must be non-negative” 索引超出范围。 必须为非负数并且小于集合的大小。 C# - Index was out of range. Must be non-negative and less than the size of the collection. C# C#:索引超出范围,必须为非负且小于集合的大小 - C#: Index was out of range, must be non-negative and less than the size of the collection 索引超出范围,在C#中打印网格视图时必须为非负错误 - Index was out of range, must be non-negative error while printing Grid view in c# 错误C#:索引超出范围。 必须为非负数且小于集合的大小 - Error C#: Index was out of range. Must be non-negative and less than the size of the collection c#>索引超出范围。 必须为非负数且小于集合的大小 - c# > Index was out of range. Must be non-negative and less than the size of the collection C# WPF 数据网格。 指数超出范围。 必须是非负数且小于集合的大小。 参数“索引” - C# WPF DataGrid. Index was out of range. Must be non-negative and less than the size of the collection. Parameter 'index' ASP.NET C#:发生错误:索引超出范围。 必须为非负数并且小于集合的大小。 参数名称:索引(GRIDVIEW) - ASP.NET C#: Error occured: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index (GRIDVIEW) 错误:索引超出范围。 必须为非负且小于集合的大小: sumList[i]=(sumList[i] + formula3[j]); C# - ERROR: Index was out of range. Must be non-negative and less than the size of the collection: sumList[i]=(sumList[i] + formula3[j]); C# 索引超出范围。 必须为非负数并且小于集合的大小。 参数名称:C#asp.Net中的索引 - Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index in C# asp.Net
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM