subreports not working in ASP.NET
Ok, people, here is what I am trying to do, but am not having any luck so far.
I have a stored proc called FI_DIR_COMPILE, this proc has 6 select statements in it.
Each of the select statements are stored in a table in a dataset called dataset1.
The Data in each table has no relation to data in any other table.
I have created a Crystal Report called test.rpt.
I have added a strong typed report class to test.aspx for test.rpt called test1
I have a Crystal Report viewer called CrystalReport1 on test.aspx
In test.rpt I have 6 sub reports, on for each table.
I have the complete dataset1 mapped into test.
Each subreport only has 1 table from test in it.
The issue is I am getting no data in any of the subreports when I view the main report via test.aspx.
Below is the code I am using, Anyone have a clue ????
Begin c# code
public class WebForm7 : System.Web.UI.Page
{
protected System.Data.SqlClient.SqlConnection connection;
protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
protected SPROC.test test1 = null;
private void Page_Load(object sender, System.EventArgs e)
{
SqlCommand command = connection.CreateCommand();
command.CommandText="FI_DIR_COMPILE";
command.CommandType=CommandType.StoredProcedure;
fl_dir dataset1;
try
{
SqlDataAdapter adapter = new SqlDataAdapter(command);
dataset1 = new fl_dir();
adapter.Fill(dataset1, "FI_DIR_COMPILE");
adapter.Fill(dataset1, "NUO60");
adapter.Fill(dataset1, "NUOALL");
adapter.Fill(dataset1, "VEHCLASS");
adapter.Fill(dataset1, "fl_recap");
adapter.Fill(dataset1, "bank_total");
adapter.Fill(dataset1, "bank_lease");
}
finally
{
command.Dispose();
connection.Close();
}
test1.SetDataSource (dataset1);
CrystalReportViewer1.ReportSource = test1;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
test1 = new SPROC.test();
base.OnInit(e);
}
|