我在visual studio 2008上开发了带有水晶报告的asp.net网页表单。我将默认纸张尺寸设置为"自定义尺寸"。但是,当我发布网站时,水晶报表查看器始终呈现为A4尺寸。
我也添加了代码来将纸张尺寸设置为我的"自定义尺寸"在代码背后。但是当我再次发布网站时,它显示错误消息"无法加载报告"
任何人都知道如何解决这个问题?
答案 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