Crystal Report上的默认纸张尺寸设置

时间:2015-11-03 10:14:48

标签: asp.net vb.net visual-studio-2008 crystal-reports

我在visual studio 2008上开发了带有水晶报告的asp.net网页表单。我将默认纸张尺寸设置为"自定义尺寸"。但是,当我发布网站时,水晶报表查看器始终呈现为A4尺寸。

我也添加了代码来将纸张尺寸设置为我的"自定义尺寸"在代码背后。但是当我再次发布网站时,它显示错误消息"无法加载报告"

任何人都知道如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

试试这个 -

Private Sub frmPrinterOption_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim i As Integer xmlDoc.Load(Application.StartupPath + "\Printer.xml") Dim xNodeBase As XmlNode = xmlDoc.DocumentElement Dim xNode As XmlNodeList xNode = xNodeBase.SelectNodes("//Print//PrintName") For i = 0 To xNode.Count - 1 Me.PrinterTextEdit.Text = (xNode.Item(i).ChildNodes(0).Value) Next i xNode = xNodeBase.SelectNodes("//Print//PaperSize") For i = 0 To xNode.Count - 1 Me.PrintSizeTextEdit.Text = (xNode.Item(i).ChildNodes(0).Value) Next i End Sub Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click Dim xNodeBase As XmlNode = xmlDoc.DocumentElement Dim xNode As XmlNodeList xNode = xNodeBase.SelectNodes("//Print//PrintName") xNode.Item(SIndex).ChildNodes(0).Value = Me.PrinterTextEdit.Text xmlDoc.Save(Application.StartupPath + "\Printer.xml") xNode = xNodeBase.SelectNodes("//Print//PaperSize") xNode.Item(SIndex).ChildNodes(0).Value = Me.PrintSizeTextEdit.Text xmlDoc.Save(Application.StartupPath + "\Printer.xml") MsgBox("Saved Successfully.......", MsgBoxStyle.Information + MsgBoxStyle.OkOnly) Me.Close() End Sub