0
votes

I have developed asp.net web form with crystal report on visual studio 2008. I set the default paper size to "custom size". But when i publish the web site, it comes crystal report viewer always render to A4 size.

I have too add code to set paper size to my "custom size" in code behind. But when i publish the website again, it shown an Error message "could not load report"

Anyone know how to fix this?

1

1 Answers

0
votes

Try this-

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