1. <legend id='i2EGr'><style id='i2EGr'><dir id='i2EGr'><q id='i2EGr'></q></dir></style></legend>
  2. <small id='i2EGr'></small><noframes id='i2EGr'>

  3. <tfoot id='i2EGr'></tfoot>

        <bdo id='i2EGr'></bdo><ul id='i2EGr'></ul>
    1. <i id='i2EGr'><tr id='i2EGr'><dt id='i2EGr'><q id='i2EGr'><span id='i2EGr'><b id='i2EGr'><form id='i2EGr'><ins id='i2EGr'></ins><ul id='i2EGr'></ul><sub id='i2EGr'></sub></form><legend id='i2EGr'></legend><bdo id='i2EGr'><pre id='i2EGr'><center id='i2EGr'></center></pre></bdo></b><th id='i2EGr'></th></span></q></dt></tr></i><div id='i2EGr'><tfoot id='i2EGr'></tfoot><dl id='i2EGr'><fieldset id='i2EGr'></fieldset></dl></div>

      如何将水晶报表绑定到手动创建的数据集

      时间:2023-07-10
        <legend id='lUCUY'><style id='lUCUY'><dir id='lUCUY'><q id='lUCUY'></q></dir></style></legend>

        <small id='lUCUY'></small><noframes id='lUCUY'>

        1. <tfoot id='lUCUY'></tfoot>

            <tbody id='lUCUY'></tbody>

          <i id='lUCUY'><tr id='lUCUY'><dt id='lUCUY'><q id='lUCUY'><span id='lUCUY'><b id='lUCUY'><form id='lUCUY'><ins id='lUCUY'></ins><ul id='lUCUY'></ul><sub id='lUCUY'></sub></form><legend id='lUCUY'></legend><bdo id='lUCUY'><pre id='lUCUY'><center id='lUCUY'></center></pre></bdo></b><th id='lUCUY'></th></span></q></dt></tr></i><div id='lUCUY'><tfoot id='lUCUY'></tfoot><dl id='lUCUY'><fieldset id='lUCUY'></fieldset></dl></div>

            • <bdo id='lUCUY'></bdo><ul id='lUCUY'></ul>

                本文介绍了如何将水晶报表绑定到手动创建的数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我不想从代码中创建DataSet并将其设置为水晶报表的数据源.
                如果不需要,我不想在 VS 中创建 DataSet xsd 文件.只是纯代码.

                I wan't to create DataSet from code and set it as data source for crystal report.
                I don't want to create a DataSet xsd file in VS if I don't have to. Just pure code.

                DataSet ds = new DataSet();
                DataTable tbl = new DataTable();
                DataColumn cln = new DataColumn();
                // I fill row, columns, table and add it to ds object
                ...
                

                然后当我需要报告时,我会使用:

                Then when I need report I use:

                myReport.SetDataSource(ds);
                

                这里的问题是我不知道如何绑定这个报告?如何添加字段?
                我有一个文本和二进制数据(图像).

                The problem here is I don't know how to bind this to report? How to add fields?
                I have a text and binary data (image).

                推荐答案

                只有出路.正如罗萨多所建议的那样.一点点解释1. 创建一个 RPT 文件.2. 创建一个包含所需列的 XSD.3. 拖放 rpt 上的列.根据需要对其进行格式化.4. 现在创建连接,使用适配器填充该数据集.5.填充u数据集会自动填充报表列.

                There is only way out. As suggested by rosado. Little bit explained 1. CReate a RPT File. 2. Create a XSD with the desired columns. 3. Drag drop the columns on the rpt. Format it as required. 4. Now create connection, use adapter to fill that dataset. 5. Filling u dataset will automatically fill the report columns.

                下面是我的一个项目的示例代码.

                Below is a sample code from one of mine project.

                Invoice invoice = new Invoice(); // instance of my rpt file
                var ds = new DsBilling();  // DsBilling is mine XSD
                var table2 = ds.Vendor;
                var adapter2 = new VendorTableAdapter();
                adapter2.Fill(table2);                   
                
                var table = ds.Bill;
                var adapter = new BillTableAdapter();
                string name = cboCustReport.Text;
                int month = int.Parse(cboRptFromMonth.SelectedItem.ToString());
                int year = int.Parse(cboReportFromYear.SelectedItem.ToString());
                adapter.Fill(table, name,month,year);
                
                ds.AcceptChanges();
                
                invoice.SetDataSource(ds);
                crystalReportViewer1.ReportSource = invoice;
                crystalReportViewer1.RefreshReport();
                

                这篇关于如何将水晶报表绑定到手动创建的数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:ORM 与 NoSQL API 是多余的吗? 下一篇:IIS 的水晶报表问题 - (bobj 未定义,水晶报表不显示)

                相关文章

                  • <bdo id='RdRKF'></bdo><ul id='RdRKF'></ul>
                  <legend id='RdRKF'><style id='RdRKF'><dir id='RdRKF'><q id='RdRKF'></q></dir></style></legend>
                  <i id='RdRKF'><tr id='RdRKF'><dt id='RdRKF'><q id='RdRKF'><span id='RdRKF'><b id='RdRKF'><form id='RdRKF'><ins id='RdRKF'></ins><ul id='RdRKF'></ul><sub id='RdRKF'></sub></form><legend id='RdRKF'></legend><bdo id='RdRKF'><pre id='RdRKF'><center id='RdRKF'></center></pre></bdo></b><th id='RdRKF'></th></span></q></dt></tr></i><div id='RdRKF'><tfoot id='RdRKF'></tfoot><dl id='RdRKF'><fieldset id='RdRKF'></fieldset></dl></div>
                1. <tfoot id='RdRKF'></tfoot>

                    <small id='RdRKF'></small><noframes id='RdRKF'>