返回首页

亲爱的荣誉,



我在我的Windows应用程序的一些报道..其作品的罚款。NET解决方案。但是,当我与我的Setup.exe执行崛起"负荷报告失败"......

在这里,我的代码...

如果可能的话在我的代码不改变..


public void PrintMethod()

{

string strPath;

lsInvNo = frmCustomerInv.gsInvNo;

string query2 = "select InvNo from tblCustomerInvoice where InvNo='" + lsInvNo + "' and State=''";

string InvoNu = DataAccess.GetSingleValue(query2);

if (InvoNu == string.Empty)

{

...

}

else

{

...

}

 

SqlDa = new SqlDataAdapter(Query, SqlCon);

DataTable dt = new DataTable();

dt.Clear();

SqlDa.Fill(dt);

ReportDocument REportDoct = new ReportDocument();

string reportPath = GetAppFolder();

 

int index = reportPath.ToLower().IndexOf("bin");

if(index >= 0)

{

reportPath = reportPath.Substring(0, index);

}

 

strPath = reportPath;

reportPath = reportPath + @"\Reports\FinalInvoice.rpt";

REportDoct.Load(reportPath);

REportDoct.SetDataSource(dt);

crystalReportViewer1.ReportSource = REportDoct;

crystalReportViewer1.Refresh();

REportDoct.PrintToPrinter(1, false, 0, 0);

}



提前感谢......

回答

评论会员:l 时间:2