当前位置:编程学习 > C#/ASP.NET >>

水晶报表连接数据库

在DataSet1.xsd里面可以预览出数据,但是在数据专家里就没有数据,预览不出数据,运行程序的时候就出登陆界面,请大家帮忙解决 --------------------编程问答-------------------- 给报表指定数据源了吗 --------------------编程问答--------------------
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width: 800px">
            <tr>
                <td style="width: 800px">
                    <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"
                        Height="790px" ReportSourceID="CrystalReportSource1" Width="1275px" DisplayGroupTree="False" HasPrintButton="True" HasToggleGroupTreeButton="False" />
                    <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="CryPatientOutInfo.rpt"></Report>
</CR:CrystalReportSource>
                </td>
            </tr>
            <tr>
                <td style="width: 800px; text-align: center;">
                    <asp:Button ID="btnPrint" runat="server" OnClick="btnPrint_Click" Text="打印" Width="111px" Visible ="false" />
                    <asp:Button ID="btnExport" runat="server" OnClick="btnExport_Click" Text="导出" Width="111px"  Visible ="false" />
                    <asp:Button ID="btnExportExcel" runat="server" OnClick="btnExportExcel_Click" Text="导出Excel" Width="111px"/>
                </td>
            </tr>
        </table>
    
    </div>
    </form>
</body>


this.CrystalReportSource1.ReportDocument.SetDataSource(dtSource);



或者代码中加载报表
然后指定数据一样, --------------------编程问答-------------------- 指定了,我已经折腾好了。同样感谢你。
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,