我在crstal Report中如何动态连接数据库
这些代码是在crystalReportViewer的Loan()里加吗?
我是新手,还望各位高手多多帮忙!谢谢!
这些代码是在crystalReportViewer的Loan()里加吗?
我是新手,还望各位高手多多帮忙!谢谢!
解决方案 »
- 好心人帮我看看错在哪里了 急急急急!
- 网站老是报XX行不属于表TABLE
- c#语句含义 急急急!!!
- textbox文本下如何修改指定位置的值而不能改变其他的值(100分)
- 急~~~~~~~~在线等~~~~!!!! Gridview 双击回传并关闭子窗口
- 请大哥们指点
- 如何去除dataGrid中列表中为null的显示。
- 问一个简单的form提交的问题看了一个上午未解决。。
- VS2008下的Crystal Reports Runtime Packages 是免费的吗?
- 谁有Xtreme Toolkit3. 1 给个链接吧,8国联军强过我们的,我们今天也强他们的^_^
- 高考考了593,能去上海什么大学,理科的,谢谢
- 两个页面之间传值 javascript
//如果是要web打印只有cr10才可以实现
public void printReport(string reportPath,DataSet reportSet,string PrinterPath,string passWrd)
{
ReportDocument crystalReportObject=new ReportDocument();
//crystalReportObject.
crystalReportObject.Load(reportPath);//"e://temp//crt.rpt"
//crystalReportObject.s
crystalReportObject.SetDataSource(reportSet);
crystalReportObject.Refresh();
this.SetConnectionInfo(crystalReportObject,passWrd);
//crystalReportObject.PrintOptions.PrinterName =@"\\office1\HP1000";
crystalReportObject.PrintOptions.PrinterName =PrinterPath ;
try
{
crystalReportObject.PrintToPrinter(1,false, 0, 0);
}
catch
{
;
}
finally
{
crystalReportObject.Close();
}
//CrystalDecisions.Web.CrystalReportViewer myView=new CrystalDecisions.Web.CrystalReportViewer();
//myView.LogOnInfo
}
public void printReport(string PrinterPath,ReportDocument crystalReportObject)
{ crystalReportObject.PrintOptions.PrinterName =PrinterPath ;
try
{
crystalReportObject.PrintToPrinter(1,false, 0, 0);
}
catch(PrintException e)
{
DataPlatform.DataAccess.common.setMessage(e.ToString());
;
}
finally
{
crystalReportObject.Close();
}
//CrystalDecisions.Web.CrystalReportViewer myView=new CrystalDecisions.Web.CrystalReportViewer();
//myView.LogOnInfo
}
这是网上的代码,我没具体试过,这些代码要写在你的打印按钮事件里!