问题描述
我只想用 A4 纸的一半打印一张账单,即宽度:8.269 英寸,高度:5.847 英寸.我已经尝试了几次不同的设置.它得到了大小,但问题是它以 landscape 方向打印.就像下图一样.
即使经过大量搜索,我也无法得到问题的答案.在我写问题时,stackoverflow 给了我一些答案建议.
喜欢
2.水晶报告-->设计-->页面设置
使用自定义尺寸纸张选择您的打印机并设置方向.
打印!!!
I just want to print a bill in half of A4 size paper i.e. Width: 8.269 inches, Height: 5.847 inches. I have tried several times with different settings. It gets the size, but the problem is it is printing in landscape orientation. Just like the picture below.
Even after a massive search, I am unable to get the answer of my question. When I am writing my question, stackoverflow gave me some answer suggestions.
Like this.
But how can I get the client's printer setup in my development pc ? Is it not like generic that works fine in all printers ? If client change the printer for any reason, it will be a mess right ?
In this question, the problem persists and the question was not solved.
As per the answer of this question, I tried this process before, but failed.
I have written to SAP. They answered me with a link of a file and stated it could solve my problem. I found it is a c# code where I am using vb.net. I can understand the code, but I am unable to understand from where to start.
I always use crystal reports
directly to the printer.....
Dim stdata As New DataSet() dbcommand.Connection = conn dbcommand.CommandText = qry dbadapter.SelectCommand = dbcommand dbadapter.Fill(stdata) stdata.WriteXml(Application.StartupPath & "ReportXmlill.xml", XmlWriteMode.WriteSchema) Dim objRpt As New NormalSaleBill objRpt.SetDataSource(stdata.Tables(0)) Dim printPages As Integer = G_DefaultPrintPages '<--- A variable with print page count objRpt.PrintToPrinter(printPages, True, 0, 0)
or
with report viewer...
Dim stdata As New DataSet() dbcommand.Connection = conn dbcommand.CommandText = qry dbadapter.SelectCommand = dbcommand dbadapter.Fill(stdata) stdata.WriteXml(Application.StartupPath & "ReportXmlSaleBill.xml", XmlWriteMode.WriteSchema) Dim objRpt As New NormalSaleBill objRpt.SetDataSource(stdata.Tables(0)) FormReport.RptViewer.ReportSource = objRpt FormReport.ShowDialog() FormReport.RptViewer.RefreshReport()
So where should I put the custom paper/page size (If it can only be done programatically) ?
I am totally confused. I need it badly, but I am unable to resolve it. I do not want any ready-made code. But at least a guide could help me.
For your information, I am using VB.NET 2010 with Crystal Report 13.
I Have the same problem and I resolved this with the following steps.the problem occurs due to a width greater than height. Due to that automatically rotate paper as landscape.
1.Create custom size paper in your printer
2.Crystal Reports--> Design-->Page Setup
Select your Printer with custom size paper and set orientaion.
Print!!!
这篇关于Crystal Report 自定义页面/纸张大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!