C# winFom 发送DataTable到stimulsoft报表

C# winFom Send DataTable to stimulsoft report

我想显示未连接到任何数据库的数据 table 记录 在刺激报告中。我尝试了这行代码,但报告页面是空的 我能做什么?

        factorDT.TableName = "factorDT";
        factorDataSet.Tables.Add("factorDT");

        factorDT.Columns.Add("PCode", typeof(int));
        factorDT.Columns.Add("Title", typeof(string));
        factorDT.Columns.Add("UnitPrice", typeof(int));
        factorDT.Columns.Add("Count", typeof(int));
        factorDT.Columns.Add("TotPrice", typeof(int));

        private void simpleButton1_Click(object sender, EventArgs e)
        {
         stiReport1.RegData("factorDataSet",factorDataSet);
         stiReport1.Dictionary.Synchronize();
         stiReport1.Compile();
         stiReport1.Show(true);
        }

我通过将数据 table 保存到 XML 文件并将其加载到我的 StiReport

来解决这个问题