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

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

      <legend id='xjokK'><style id='xjokK'><dir id='xjokK'><q id='xjokK'></q></dir></style></legend>

    2. <tfoot id='xjokK'></tfoot>
      • <bdo id='xjokK'></bdo><ul id='xjokK'></ul>

        如何在c#win form app中设置子水晶报表的数据源

        时间:2023-07-10
      1. <small id='xTJ7Z'></small><noframes id='xTJ7Z'>

          <legend id='xTJ7Z'><style id='xTJ7Z'><dir id='xTJ7Z'><q id='xTJ7Z'></q></dir></style></legend>

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

                <tfoot id='xTJ7Z'></tfoot>
                  <tbody id='xTJ7Z'></tbody>

                  本文介绍了如何在c#win form app中设置子水晶报表的数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用此代码在主报表中加载主报表和子报表.主报告是空白的,只包含子报告.

                  I am using this code to load a main report and a subreport inside the main report. The main report is a blank one and just contains subreport.

                  这是我的代码:

                  MySqlConnection cnn;
                  string connectionString = null;
                  string sql = null;
                  
                  connectionString = "Server = BC; Database = mydb1; Uid = root; Pwd = abc123;";
                  cnn = new MySqlConnection(connectionString);
                  cnn.Open();
                  
                  sql = "SELECT * from mytable1 ";
                  MySqlDataAdapter dscmd = new MySqlDataAdapter(sql, cnn);
                  DataSet1 ds = new DataSet1();
                  dscmd.Fill(ds, "Imagetest");
                  cnn.Close();
                  
                  ReportDocument cryRpt = new ReportDocument();
                  cryRpt.Load("C:/Subreport.rpt");
                  cryRpt.SetDataSource(ds.Tables[1]);
                  
                  crystalReportViewer1.ReportSource = "C:/MainReport.rpt";
                  crystalReportViewer1.Refresh();
                  

                  当我运行应用程序时,我只看到带有空白子报告的主报告.

                  When I run the application I just see main report with blank subreport.

                  推荐答案

                  ReportDocument cryRpt = new ReportDocument();
                  cryRpt.Load("C:/MainReport.rpt");
                  cryRpt.DataSourceConnections.Clear();
                  cryRpt.SetDataSource(ds.Tables[0]);
                  cryRpt.Subreports[0].DataSourceConnections.Clear();
                  cryRpt.Subreports[0].SetDataSource(ds.Tables[0]);
                  crystalReportViewer1.ReportSource = cryRpt;
                  crystalReportViewer1.Refresh();
                  

                  这篇关于如何在c#win form app中设置子水晶报表的数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 c# 在连续纸上打印 下一篇:抑制列并删除水晶报表中的空格

                  相关文章

                1. <legend id='qtisR'><style id='qtisR'><dir id='qtisR'><q id='qtisR'></q></dir></style></legend>

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

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

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