返回首页

如何加载水晶报表,水晶报表没有观众?

回答

评论会员:游客 时间:2012/02/06
塔里克Newaz的Shahriar
这可能表明没有水晶报表水晶报表查看器。有一些其他的格式来显示报告,例如PDF,MS Word等

一个按钮单击事件或任何页面加载事件的背后,使用下面的代码显示在浏览器的PDF插上水晶报表

此外,客户端上的水晶报表查看器打印按钮不起作用。它的印刷只在服务器端。显示和打印文件,它有助于使用PDF,MS WORD的浏览器插件英寸


 

using CrystalDecisions.CrystalReports.Engine;

 



 

protected void btn_Click( object sender, EventArgs e )

{

	try

	{

		// Get the report document

		ReportDocument report = new ReportDocument();

 

		// it was guessed that the .rpt file is under 'Reporting' folder of the project

		report.Load( Server.MapPath( " /Reporting/report1.rpt" ) );

		

		// Stop buffering the response

		Response.Buffer = false;

		// Clear the response content and headers

		Response.ClearContent();

		Response.ClearHeaders();

	

		// Export the Report to Response stream in PDF format

		report.ExportToHttpResponse( ExportFormatType.PortableDocFormat, Response, false, "My Report");

	}

	catch( Exception ex )

	{

		// use any logic to show the error, e.g. label, messageBox..

	}

}


可用的格式导出

该报告可以导出在不同的格式如下:ExportFormatType.PortableDocFormat可携式文件格式(PDF)ExportFormatType.Excel到Excel的完整报告ExportFormatType.ExcelRecord只有报表数据到ExcelExportFormatType.HTML40的HTMLExportFormatType.RichText富文本格式(RTF)ExportFormatType.WordForWindows的MS Word中
评论会员:游客 时间:2012/02/06
|迈赫迪吴拉姆:这是不可能的,你需要观众的报告显示
Shrikant Bhongade
评论会员:游客 时间:2012/02/06
其不possiable的。cryatalreoport必须有报表查看器.....................
基索尔Jangid
评论会员:游客 时间:2012/02/06
如果你不想添加水晶报表查看器deisgn时间只需添加的报告观众动态使用后面的代码