使用Crystal Report时出现问题 [英] Problem in using Crystal Report

查看:75
本文介绍了使用Crystal Report时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Epson u220打印机,并且每次生成发票报告时都需要继续打印纸张.

现在,我在如何将纸张大小"设置为宽度" = 5以及长度"设置为动态时很费劲.

含义如果发票报告的数据可以填满25英寸的长度,则自定义"纸张尺寸将为
5 X25.并且如果发票报告的数据只能填满10英寸的长度,则自定义纸张尺寸将为
5 X 10.

因此,无论如何都可以将纸张尺寸的长度"设置为动态".我的编码是:

I am using a Epson u220 printer and need to print Continues paper, when ever I generate invoice Report.

Now I have a hard time on how to set my Paper Size to Width = 5 and the Length to be a dynamic.

Meaning If the Data of the Invoice Report can fill up a Lenght 25 inches then the Custom paper size will be
5 X 25. and If the Data of the Invoice Report can fill up only to the length of 10 inches then the Custom paper size will be
5 X 10.

So is there anyway possible to set the Length of the Paper Size to be Dynamic. My Coding is:

ReportDocument report = new ReportDocument();
report.Load(Server.MapPath("CrystalReport2.rpt"));
report.SetDatabaseLogon("sa", "amman", @"AMMAN-42796DF5F\SQLEXPRESS", "Medicals");
report.SetDataSource(dt); 
CrystalReportViewer1.ReportSource = report;
if (!IsPostBack)
{
  report.PrintToPrinter(1, false, 0, 0);
}

推荐答案

根据您的Crystal Report版本,"printtoprinter"方法还有第二种选择.

您可以在其中传递printersettings和pagesettings对象的一种方法.
通过操纵pagesettings对象,您也许可以做到这一点,但是我从来没有尝试过,所以无法确定.
Depending on your crystal reports version there is a second option to the ''printtoprinter'' method.

One where you can pass a printersettings and a pagesettings object.
By manipulating the pagesettings object you might be able to do this but I''v never try''d it so can''t be sure.


这篇关于使用Crystal Report时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆