0

我使用 stimulsoft 获取报告。首先我设计了一个带有stilleport1 名称的报告。但我单击报告显示按钮,我的报告显示为空。为什么?我的代码是:

private void radButton1_Click(object sender, EventArgs e)
    {


           // stiReport1.RegData("query", query);
           // stiReport2.RegBusinessObject("PUBS", "pub_info", query);
            //stiReport2.RegData("pub_info", query);
          //  stiReport2.RegReportDataSources() = query;
           // stiReport2.Dictionary.Databases.Add(query);
           // stiReport2.Render();
            StiReport st = GetReport();
            st.Show();

    }

private StiReport GetReport()
    {
        StiReport report = new StiReport();
        if (File.Exists("D:\\stiReport1"))
        {
            report.Load("D:\\stiReport1");
        }
        PUBSEntities db = new PUBSEntities();
        var query = (from p in db.pub_info
                         select p).ToList();
        db.Dispose();
      //  report.RegBusinessObject("PUBS", "pub_info", query);

        report.RegData("mypub",query);
        return report;
    }
4

1 回答 1

0

尝试使用下一个代码:

  if (File.Exists("D:\\stiReport1.mrt"))
    {
        report.Load("D:\\stiReport1.mrt");
    }
于 2013-02-07T13:54:14.090 回答