Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

crystal report subreport in visual basic

Dear Expert,
I can't add subreport into crystal report template in visual basic. Do you have any example of subreport in visual basic using crystal report. The code is as follows:
   
Dim rpt As New rptProfile, f As New frmReport, rs As New ADODB.Recordset, rptFather As New rptFather
   sSQL = "SELECT PersNo, Rank,  NameEnglish, NameBangla, Picture, Decoration, ArmsSvc, " _
   & "Unit, Station, Course,CommissionDate, AntiDate,RetDateByAge,  RetDateByService, " _
   & "PresentRankDate, GcNoAcademy, ApptAcademy, BirthDate, BirthPlaceDist, " _
   & "BirthPlaceCountry, Hieght, Weight, BloodGP, MedCat, IDMk, Religion, Ethnic, PassportNo, " _
   & "IssueDate, IssuePlace, ContactNoTel, ContactNoMobile, Email, PresentHouseNo, PresentRdNo, " _
   & "PresentSecNo, PresentVill, PresentPo, PresentUzThana, PresentDist, PermanentHouseNo, " _
   & "PermanentRdNo, PermanentSecNo, PermanentVill, PermanentPo, PermanentUzThana, " _
   & "PermanentDist, TINNo, DetailsSyInfo, Piculiarity, Others, Remarks " _
   & "FROM PersonalInformation Where PersNo = '" & cboPersNo.Text & "-" & txtPersNo & "'"
   Set rs = Cn.Execute(sSQL)
   If rs.EOF Then
       MsgBox "No Records to display in the report...", vbInformation
       Exit Sub
   End If
   
   Screen.MousePointer = vbHourglass
   rpt.Database.Tables(1).SetDataSource rs
   
   sSQL = "SELECT r.Fullname,b.BirthDate,b.AppxAge, b.BirthPlace,b.Nationality,b.Religion," _
   & "b.PermanentHouseNo,b.PermanentRoadNo,b.PermanentSec,b.PermanentVill,b.PermanentPo,b.PermanentUzThana," _
   & "b.PermanentDist,r.PresentHouseNo,r.PresentRoadNo,r.PresentSec,r.PresentVill," _
   & "r.PresentPo,r.PresentUzThana,r.PresentDist,b.HigestEduQua,s.LastOccupation," _
   & "b.PoliticalParty,b.politicalAppt,s.PersNo,s.LastDept,s.Rank,b.DependancyOnOffice " _
   & "from RelativeBiography b, RelativeInfo r,RelativeService s " _
   & "WHERE r.Rel_id *= b.Rel_id AND r.Rel_id *= s.Rel_id AND r.EmpPersNo = '" & cboPersNo.Text & "-" & txtPersNo & "'"
   Set rs = Nothing
   Set rs = New ADODB.Recordset
   Set rs = Cn.Execute(sSQL)
   rptFather.Database.Tables(1).SetDataSource rs
   f.CRV.ReportSource = rpt
   f.CRV.ViewReport
   f.WindowState = vbMaximized
   Screen.MousePointer = vbDefault
   f.Show 1
0
raju1
Asked:
raju1
1 Solution
 
mlmccCommented:
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now