Hello Experts,
I have a created a crystal report with a non-linked subreport(different datasource from the main report) in Visual studio 2008. I'm passing a selection formula to the main report and it works fine.
. I have shown the code as below.
The problem is how to pass a selection formula to the subreport?
Also, if the main report is empty it should suppress the main report and display only the subreport.
How to achieve this task? Please advice.
Thank you
Dim StrSelectionUser1 As String
UserNamefromform = Me.Lbl_EmpName1.Text
Datefromform = Now.ToShortDateString
StrSelectionUser1 = "{Telework_Log_Table.USER_NAME} = '" & UserNamefromform & "' And {Telework_Log_Table.DATEVALUE} = #" & Datefromform & "#"
'StrSelectionUser2 = "{Other_Equipment.USER_NAME} = '" & UserNamefromform & "' And {Other_Equipment.DATEVALUE} = #" & Datefromform & "#"
CrystalReportsForm_All.Show()
reportdoc1 = "C:\Users\test\Documents\Visual Studio 2008\Projects\RND\RND\CrystalReport_DirectMS.rpt"
CrystalReportsForm_All.CrystalReportViewer1.ReportSource = reportdoc1
CrystalReportsForm_All.CrystalReportViewer1.SelectionFormula = StrSelectionUser1