Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

How to pass a data set to a subreport when the main report run a query and have other subreports running querys?

$
0
0

Regards,

I currently have a main report with query, I have one subreport that receives a DataSet and other subreports running querys.

I have identified, how to set DataSet a subreport: 

CryRpt ReportDocument = 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.DataBind ();

How to load the main report(run query ODBC) and the reports run query ODBC:

CrVisor.DisplayGroupTree = false;
CrVisor.HasExportButton = true;
CrVisor.HasToggleGroupTreeButton = false;
CrVisor.HasViewList = false;
CrVisor.HasCrystalLogo = false;
CrVisor.EnableToolTips = false;
CrVisor.HasDrillUpButton = false;
CrVisor.EnableDrillDown = false;
CrVisor.HasZoomFactorList = false;
CrVisor.SeparatePages = false;

rd.Load (Server.MapPath ("~ / Reportes/123.rpt"));
rd.ReportOptions.EnableSaveDataWithReport = false;
rd.SetParameterValue ("pTitulo" "Chulin");
rd.SetParameterValue ("pIndDespliegueFirma", 1);
rd.SetParameterValue ("pIndDespliegueFirmaJunDir", 1);
rd.SetParameterValue ("pCompania", 1);
rd.SetParameterValue ("pDocumento", 11251);
rd.SetParameterValue ("pEmpresa", 1);
rd.SetParameterValue ("Powner", "owner");

rd.SetDatabaseLogon ("xxx", "xxx", ConfigurationManager.AppSettings ["XXX"], "");
this.CrVisor.ReportSource = rd;
CrVisor.DataBind ();


But at the time of joining the two ways to load the reports because I have problems passing the main report data set to lose that data and subreports running querys stop working since varibales receive the query from the main report.

What is the correct way to work with a major report that runs a query, running querys subreports and subreport that receives a data set?

I await your response, thanks in advance.

Crystal reports version: 10.0.0.533
Visual Studio 2008 - C # - framework 3.0

Data Base - Oracle 11g - 12g


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>