开发工具我们选用目前主流的VS2013。需要安装开发包CRforVS_13_17.exe。这里我提供一个下载地址,方便大家下载安装。
http://scn.sap.com/docs/DOC-7824
首先新建一个asp.net项目,然后新建Crystal Reports文件。
我们新建一个空白报表。然后我们就可以在这张空白报表中设计我们想要的东西了右键数据库字段,选择数据库专家。在弹出的对话框中,创建新连接,选择我们的access数据库。然后就可以在右边的数据库的字段列表中选择相应显示的字段,拖动到右边的设计器相应位置(删除掉页眉部分重复的字符串文本框)。
但是由于照片信息存放的是图片的二进制数据,直接拖动后在设计器中是可以显示的,但是网页不能正常显示,这时候需要注意设置一下Web.config。添加如下节点:
[html] view plain copy
<httpHandlers>
<add path="CrystalImageHandler.aspx" verb="GET" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpH