打印入库单问题

int64 2004-08-26 03:20:26
我用EastReport控件作的打印
rpt文件已经做好了
DataSet也生成了
我在aspx页面内有一个打印的按钮,要求点击该按钮打印出上面rpt格式的入库单

问:按钮内的代码如何实现呢?
...全文
202 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
moresick 2004-08-31
  • 打赏
  • 举报
回复
标准例子:

public string Files="";
public string Svg="";
public string Firs="";
public string Fill="";

private void Page_Load(object sender, System.EventArgs e)
{

// System.Reflection.Assembly a = System.Reflection.Assembly.GetAssembly(typeof(Form1));
// System.IO.FileInfo fi = new System.IO.FileInfo(ystem.Configuration.ConfigurationSettings.AppSettings["ReportPaht"]);
string sss=System.Configuration.ConfigurationSettings.AppSettings["ReportPaht"];
System.IO.DirectoryInfo Dir=new System.IO.DirectoryInfo(sss);
System.IO.FileInfo[] Files= Dir.GetFiles() ;
for (int i=0;i<Files.GetLength(0);i++)
{
if (Files[i].Name.IndexOf(".rpt")>0)
{
if (this.Files=="")
{
this.Firs=Files[i].Name.Substring(0,Files[i].Name.IndexOf("."));
}
this.Files=this.Files+@"[<a href=""Default.aspx?FileName="+Files[i].Name.Substring(0,Files[i].Name.IndexOf("."))+@""">";
this.Files=this.Files+Files[i].Name.Substring(0,Files[i].Name.IndexOf("."))+@"</a>]";
}
}

if (Request["Filename"]==null)
{


EastReport.Report report = new EastReport.Report();
System.Xml.XmlDocument xmlDoc=new XmlDocument();
xmlDoc.Load(sss+this.Firs+".rpt") ;
report.Load(xmlDoc);
if (report.Pages.Count>0)

this.Svg=@"<div align=""center""><embed width="""+report.Pages[0].Width.ToString()+@""" height="""+report.Pages[0].Height.ToString()+@""" src=""svg.aspx?Filename="+this.Firs+@""" type=""image/svg+xml"" align=""top""></div>";
Fill=this.Firs;

}
else
{
EastReport.Report report = new EastReport.Report();
System.Xml.XmlDocument xmlDoc=new XmlDocument();
xmlDoc.Load(sss+Request["Filename"]+".rpt") ;
report.Load(xmlDoc);
if (report.Pages.Count>0)
this.Svg=@"<div align=""center""><embed width="""+report.Pages[0].Width.ToString()+@""" height="""+report.Pages[0].Height.ToString()+@""" src=""svg.aspx?Filename="+Request["Filename"]+@""" type=""image/svg+xml"" align=""top""></div>";
this.Fill=Request["Filename"];

}




}
int64 2004-08-27
  • 打赏
  • 举报
回复
100分给谁啊?
SuperFC 2004-08-27
  • 打赏
  • 举报
回复
没有用过,应该第三方会有sample吧
goody9807 2004-08-27
  • 打赏
  • 举报
回复
由于你使用的是第3方控件,调用什么函数 打印 。。。
你需要看看这个控件的说明 ,因为别人都没试过这个控件
int64 2004-08-27
  • 打赏
  • 举报
回复
.......................
int64 2004-08-26
  • 打赏
  • 举报
回复
很困难吗?!没人理我

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧