I am trying to create a crystal report, however I cannot connect directly to the database. I am required to get all data from a webservice call. I am returning DataTables for each webservice call. Is there any way for me to bind that datatable to the .xsd file for the Crystal Report or is there a better way to get this information into the crystal report.
protected void GenReport_Clicked(object sender, EventArgs e)
{
ReportDocument TestReport = new ReportDocument();
DataSet ds = new DataSet();
DataTable dt = webservice.Get_Admin_Dealers();
ds.Tables.Add(dt);
dt.TableName = "TestReport";
TestReport.Load(Server.MapPath("/TestReport.rpt"));
TestReport.SetDataSource(ds);
ReportViewer.ReportSource = TestReport;
}
the front side looks like
asp:Panel ID="reportPanel" runat="server">
<asp:Button ID="GenReport" runat="server" Text="Generate Report" OnClick="GenReport_Clicked" />
<CR:CrystalReportViewer ID="ReportViewer" runat="server" AutoDataBind="true"></CR:CrystalReportViewer>
</asp:Panel>
See this url: Create a crystal report form arraylist or datatable .