<tfoot id='FX87Q'></tfoot>
        <bdo id='FX87Q'></bdo><ul id='FX87Q'></ul>

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

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

        如何在水晶报表中向子报表发送参数

        How to send parameters to Subreport in Crystal Reports(如何在水晶报表中向子报表发送参数)
          <tbody id='CnSH9'></tbody>

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

              <bdo id='CnSH9'></bdo><ul id='CnSH9'></ul>

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

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

                  问题描述

                  使用 VS 2008.

                  Using VS 2008.

                  我有两个存储过程,一个用于获取主报告的数据,另一个用于获取子报告的数据,并且两个 SP 都使用相同的参数 QuoteID.

                  I have two stored procedures, one used to get data for the main report and other for Sub report and both the SP's use the same parameter QuoteID.

                  我已使用 ReportDocument 向主报告发送参数.但我不知道如何向 SubReport 发送参数.

                  I have send parameter to main report using ReportDocument. But I am not aware how to send parameters to SubReport.

                  我使用报告文档的 setparameter 方法尝试了许多不同的方法,该方法也将子报告名称作为参数.但它没有.

                  I tried many diff ways using the reportdocument's setparameter method which also takes subreport name as argument.But it didn't.

                  下面是我用过的代码

                      string Type = gvQuotationDetails.Rows[QuoteIndex].Cells["Type"].EditedFormattedValue.ToString();
                  
                      FilePath = ConfigurationManager.AppSettings["EMP_IMG_PATH"].ToString() + "\" + ValQuoteID.ToString() + ".pdf";
                  
                      DeleteExistingFile(FilePath);
                  
                      try
                      {
                          AccountsPayableMaster objAPM = new AccountsPayableMaster();
                          QuotationReport obj = new QuotationReport();
                          objReportDocument.Load(Application.StartupPath + @"
                  ptQuotationReport.rpt");
                          obj.crysQuotationReport.LogOnInfo = objAPM.ConnectionDetails("SD_SalesOrderReport;1");
                          obj.crysQuotationReport.LogOnInfo = objAPM.ConnectionDetails("SD_GetBatchReportDetails;1");
                          obj.crysQuotationReport.ReportSource = objReportDocument;
                          objReportDocument.SetParameterValue("@QuoteID", ValQuoteID);
                          objReportDocument.SetParameterValue("Type", Type);
                          //objReportDocument.Subreports[Application.StartupPath + @"BatchSubReport.rpt"].SetParameterValue("@QuoteID", ValQuoteID);
                          //objReportDocument.Subreports["BatchReport.rpt"].SetParameterValue("@QuoteID", ValQuoteID);           
                  
                          string[] Print = objAPM.GetPrintDetails();
                  
                          SetPrintParameters(objReportDocument, Print);
                  
                          obj.Show();
                  
                          objReportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, FilePath);
                      }
                  
                      catch (Exception ex)
                      {
                          MessageBox.Show(ex.Message); 
                      } 
                  

                  向子报表发送参数

                  //objReportDocument.Subreports[Application.StartupPath + @"BatchSubReport.rpt"].SetParameterValue("@QuoteID", ValQuoteID);
                  
                  //objReportDocument.Subreports["BatchReport.rpt"].SetParameterValue("@QuoteID", ValQuoteID);              
                  
                  ////objReportDocument.SetParameterValue("@QuoteID", ValQuoteID,"BatchReport.rpt);
                  

                  没有任何效果.我已经为此浪费了两天时间.[SD_SalesOrderReport;1] 主 SP 和 [SD_GetBatchReportDetails;1] 子报表 SP.

                  nothing worked.I have already wasted two days on this. [SD_SalesOrderReport;1] main SP and [SD_GetBatchReportDetails;1] subreport SP.

                  如果有人可以为此提供解决方案,那就太好了.如果设计中有一些更改,请分享图片.谢谢.

                  It would be great if someone can provide a solution for this.If there are some changes to be made in designed please share images.Thank you.

                  推荐答案

                  经过多次尝试,我终于解决了.也许这对其他人有帮助.我在Main和SubReport中使用了相同的参数Name,使用下面的代码来设置它的参数

                  Finally after lot of trails, I have solved it.May be this will be helpful to others.I have used the same parameter Name for Main and SubReport, used below code to set its parameter

                  objReportDocument.SetParameterValue("@QuoteID", ValQuoteID,objReportDocument.Subreports[0].Name.ToString());
                  

                  这篇关于如何在水晶报表中向子报表发送参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
                  Parameter count mismatch with Invoke?(参数计数与调用不匹配?)
                  How to store delegates in a List(如何将代表存储在列表中)
                  How delegates work (in the background)?(代表如何工作(在后台)?)
                  C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)
                  Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)
                  • <bdo id='RKmv0'></bdo><ul id='RKmv0'></ul>

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

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