For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > May 2005 > how i put 2 subreports in a report









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how i put 2 subreports in a report
Javier Pérez

2005-05-14, 4:11 pm

Hi everybody,

I need insert 2 subreports in a master report.

the master report name is ReportPlanning_ and the subreports are: Report PlanningaSalidas_ and Report PlanningaEntradas_

At the moment with only one subreport i'm doing this:

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CrystalDecisions.CrystalReports.Engine.SubreportObject mySubReportSalida;

CrystalDecisions.CrystalReports.Engine.ReportDocument mySubReportSalidaDoc = new ReportDocument();

foreach( CrystalDecisions.CrystalReports.Engine.Section mySection in objReportPlanning.ReportDefinition.Sections)

{

foreach( CrystalDecisions.CrystalReports.Engine.ReportObject myReportObjectSalida in mySection.ReportObjects)

{

if (myReportObjectSalida.Kind == CrystalDecisions.Shared.ReportObjectKind.SubreportObject)

{

mySubReportSalida = (CrystalDecisions.CrystalReports.Engine.SubreportObject) myReportObjectSalida;

mySubReportSalidaDoc = mySubReportSalida.OpenSubreport(mySubReportSalida.SubreportName);

//Common.Crystal.LogonToDatabase(mySubReportSalidaDoc.Database.Tables, Usuario, Password);

//Datos.Empresa objEmpresa_ = new Eprila.Datos.Empresa();


mySubReportSalidaDoc.SetDataSource(objAlquilerVehiculo.GetPlanningSalida(fechaDesde).Tables[0]);

//How can i asign diferentes datasource for PlanningaSalidas_ and PlanningaEntradas_???

}

}

}



taning de datasource from a dataset. The problem is that now i need two diferente datasource for two reports.



Anybody know who can i do it???



Thanks for all!

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com