C#
Interface iA{}
Class A{}
Class B:A{}
Class B:iA{}
Java
Interface iA{}
Class A{}
Class B extends A{}
Class B implement iA{}
C#
Interface iA{}
Class A{}
Class B:A{}
Class B:iA{}
Java
Interface iA{}
Class A{}
Class B extends A{}
Class B implement iA{}
1. Sub report in c#
private void button1_Click(object sender, EventArgs e)
{
sql = "select * from Employee";
DataTable dt = du.get_DataTable(sql);
frm_report_viewer frm = new frm_report_viewer();
CrystalReport1 cry = new CrystalReport1();
cry.Subreports["cry_sub_rpt1"].DataSourceConnections.Clear();
sql = "select * from Item_Mas order by Item_Name ";
DataTable dt2 = du.get_DataTable(sql);
cry.Subreports["cry_sub_rpt1"].SetDataSource(dt2);
cry.SetDataSource(dt);
frm.crystalReportViewer1.ReportSource = cry;
frm.Show();
}
2. Sub report in vb.Net
Public Function G_Sale_Invoice_Print_copy(ByVal lbTrCode As Label, ByVal ca_cr As String, ByVal dt_sale As DateTimePicker)
Dim mas = "", det = ""
sql = " SELECT '" + ca_cr + "'stt,'" + med_Mename + "'med_Mename,'" + med_Meaddress_det + "' med_Meaddress,'Contact:" + med_Contactno + " "
sql += ", Email:" + med_Email + "'med_Contactno" + vbNewLine
Dim dt = DataTable(sql)
If (dt.Rows.Count < 1) Then
MsgBox("Data Not available.")
Return ""
End If
Dim frm As New frm_report_sale
Dim cry = New rpt_sale
If (g_print_permission = "WSP") Then
sql = " declare @date datetime = '" + Format(dt_sale.Value, "dd-MMM-yyyy") + "' "
sql += " select Tax,Amt"
sql += " ,Amt_real"
sql += " ,VAT"
sql += " ,convert(numeric(18,2),(((Amt_real*VAT)/(100)))) VAT_AMT"
sql += " ,SAT"
sql += " ,convert(numeric(18,2),(((Amt_real*SAT)/(100)))) SAT_AMT from("
sql += " select t.IGST Tax,t.CGST VAT,t.SGST SAT,isnull(sum(d.T_Price),0)Amt "
sql += " ,convert(numeric(18,2),((isnull(sum(d.T_Price),0)*100)/(100+t.IGST)))Amt_real "
sql += " from v_Sales_Mas m "
sql += " join v_Sales_Det d on m.Scode=d.Scode "
sql += " join items i on d.icode=i.icode"
sql += " right join Tax_Master t on t.Taxno=i.Tax and @date between t.sdate and t.edate and m.Scode='" + lbTrCode.Text + "'"
sql += " where @date between t.sdate and t.edate "
sql += " and t.IGST<>0 "
sql += " group by t.CGST,t.SGST,t.IGST"
sql += " ) as a"
Dim dt3 = DataTable(sql)
cry.Subreports("cry_vat_sat").DataSourceConnections.Clear()
cry.Subreports("cry_vat_sat").SetDataSource(dt3)
End If
If (facility_Apply_Freight_Charge_On_Sale() = True) Then
If (g_print_permission = "WSP_NM_NT") Then
sql = "select * from sales_det_c where scode='" & lbTrCode.Text & "'"
Dim dt3 = DataTable(sql)
cry.Subreports("rpt_sale_freight_only").DataSourceConnections.Clear()
cry.Subreports("rpt_sale_freight_only").SetDataSource(dt3)
Else
MsgBox("Please use freiht report")
End If
End If
cry.SetDataSource(dt)
g_cry = cry
If (facility_direct_prn() = True) Then
Try
cry.PrintToPrinter(1, False, 0, 0)
one_time_printed("printed", lbTrCode.Text)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
frm.CrystalReportViewer1.ReportSource = cry
frm.ShowDialog()
one_time_printed(frm.printed, lbTrCode.Text)
End If
End Function
(Expression<Func<T, bool>> filter)