i have a hard time trying to solve this one
scenario: at first, we using Letter format to print Delivery Order and Invoice..it run smoothly and in CR we just using Letter as the Page Setup..
now new paper format is coming which is half of the Letter size
at first i thougt it is easy because we only need to create new paper size on Server Properties under Printer and Faxes then use the new size at Paper Size in CR then redesign it to fit but it all when wrong, eventhough it display correctly but when i want to print it, it turn up everything that vertical become horizontal..very2 strange behaviour
so i give using CR.PrintReport method..i ended up format it to .rtf then print it using this code
it print correctly now, hope it turn up well in Live
see u
scenario: at first, we using Letter format to print Delivery Order and Invoice..it run smoothly and in CR we just using Letter as the Page Setup..
now new paper format is coming which is half of the Letter size
at first i thougt it is easy because we only need to create new paper size on Server Properties under Printer and Faxes then use the new size at Paper Size in CR then redesign it to fit but it all when wrong, eventhough it display correctly but when i want to print it, it turn up everything that vertical become horizontal..very2 strange behaviour
so i give using CR.PrintReport method..i ended up format it to .rtf then print it using this code
Dim oDoc As New ReportDocument
Dim sFileName As String = String.Empty
oDoc.Load(_ReportPath)
'must use this line to make sure it print using the new size
'credit goes to Ali from dotnet.netindonesia.net
Dim printDoc As System.Drawing.Printing.PrintDocument = New System.Drawing.Printing.PrintDocument
Dim i As Integer
Dim rawKind As Integer = 0
For i = 0 To printDoc.PrinterSettings.PaperSizes.Count
If printDoc.PrinterSettings.PaperSizes(i).PaperName = "NEW_SIZE_PAPER" Then
rawKind = CInt(GetField(printDoc.PrinterSettings.PaperSizes(i), "kind"))
Exit For
End If
Next i
oDoc.PrintOptions.PaperSize = CType(rawKind, CrystalDecisions.Shared.PaperSize)
'oDoc.PrintToPrinter(1, False, 0, 0)
Dim CrExportOptions As ExportOptions = New ExportOptions()
Dim CrDiskFileDestinationOptions As DiskFileDestinationOptions = New DiskFileDestinationOptions
Dim CrFormatTypeOptions As PdfRtfWordFormatOptions = New PdfRtfWordFormatOptions
CrDiskFileDestinationOptions.DiskFileName = sFileName
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
CrExportOptions.ExportFormatType = ExportFormatType.RichText
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions
CrExportOptions.FormatOptions = CrFormatTypeOptions
oDoc.Export(CrExportOptions)
Dim myProcess As New Process()
myProcess.StartInfo.FileName = sFileName
myProcess.StartInfo.Verb = "Print"
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.ErrorDialog = False
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
myProcess.Start()
it print correctly now, hope it turn up well in Live
see u
Comments