找不到类型或命名空间名称“ReportPrintTool” [英] type or namespace name 'ReportPrintTool' could not be found
问题描述
private void button1_Click(object sender,EventArgs e){
XtraReport1 report = new XtraReport1();
using(ReportPrintTool printTool = new ReportPrintTool(report)){
//调用打印对话框。
printTool.PrintDialog();
//将报告发送到默认打印机。
printTool.Print();
//将报告发送给指定打印机。
printTool.Print(myPrinter);
}
在上面的代码中出错6找不到类型或命名空间名称'ReportPrintTool'(您是否缺少using指令或程序集引用?)
我必须做什么?
任何人都会纠正它。
你的班级ReportPrintTool $ c您正在使用的$ c>属于您忘记添加的程序集和/或命名空间d使用
指令进入项目引用
和/或使用进入代码。
< blockquote>在Visual Studio中使用添加引用添加对DevExpress.XtraPrinting.v14.1.dll(或任何版本)的引用
添加这些行到模块的顶部
使用 DevExpress.XtraPrinting;
使用 DevExpress.XtraReports.UI;
使用 DevExpress.XtraPrinting.Preview;
private void button1_Click(object sender, EventArgs e) {
XtraReport1 report = new XtraReport1();
using (ReportPrintTool printTool = new ReportPrintTool(report)) {
// Invoke the Print dialog.
printTool.PrintDialog();
// Send the report to the default printer.
printTool.Print();
// Send the report to the specified printer.
printTool.Print("myPrinter");
}
In the above code Error 6 The type or namespace name 'ReportPrintTool' could not be found (are you missing a using directive or an assembly reference?)
what i have to do in this?
Anyone rectify it.
Your classReportPrintTool
that you are using is belong to an assembly and/or namespace that you forgot to added into yourproject references
and/or into your code withusing
directive.
Use "Add Reference" in Visual Studio to add a reference to DevExpress.XtraPrinting.v14.1.dll (or whatever version you have)
Add these lines to the top of your moduleusing DevExpress.XtraPrinting; using DevExpress.XtraReports.UI; using DevExpress.XtraPrinting.Preview;
这篇关于找不到类型或命名空间名称“ReportPrintTool”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!