Crystal 报告子报告创建 link 以排列 ID

Crystal Report Subreport create link to array with IDs

我在 crystal 个报告中创建了一个子报告。我可以 link 带有公式字段、参数或数据库字段的子报表,但我不能 link 它到列表或 ID 数组。

这里的问题是应该为数组中存在的每个 ID 创建子报表,而不是只为一个 ID 创建子报表。我尝试添加更多字段,每个字段都包含数组中的 ID,但这不起作用,

有人可以帮助我吗?这对我的工作非常重要。

谢谢!

不要创建 ID 数组,而是使用 ID 创建一个组并将子报告放在组页脚中,这将强制为每个 ID 创建子报告

只要按照这个..你就会完成你的工作。我有一个像你这样的项目,我遵循这个..只需点击这个 link http://www.c-sharpcorner.com/UploadFile/manishkdwivedi/create-a-report-using-crystal-report-in-visual-studio-2010/

public 部分 class _默认值:System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

    SqlConnection connection = new SqlConnection("Server=myserver;uid=sa;pwd=nothing;Database=MyDB;");

    SqlCommand command = new SqlCommand("Select top 10 * From Customers", connection);

    SqlDataAdapter adapter = new SqlDataAdapter(command);

    //Customer _Customer = new Customer();

    DataSet dataset = new DataSet();

    adapter.Fill(dataset, "Customer");

    ReportDocument CustomerReport = new ReportDocument();

    CustomerReport.Load(Server.MapPath("CustomerReport.rpt"));

    CustomerReport.SetDataSource(dataset.Tables["Customer"]);

    CrystalReportViewer1.ReportSource = CustomerReport;

    CrystalReportViewer1.DataBind();

}

}