Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

Subreport fails to appear, at the Main Report

$
0
0

Please help me.


This is the first time, Itried tocreate asubreportinCrystalReport at a Web Page Microsoft Visual Studio 2010.

I use tworeportfiles, consist of:

crInvoice.rpt and crIMEIMobilePhones.rpt

crInvoice.rpt is Main Report

crIMEIMobilePhones.rpt isafilewhichwillmakethe subreport at crInvoice.rpt

 

below, thecodeI use todisplayMainReport andsubreport. There might bea mistake.Pleasecorrected.

strSql = "select NoInvoice,IMEI, Namabarang,1 as Qty, hjual, diskon from tbtemp"
                    myDataAdapter = New MySqlDataAdapter(strSql, myConnection)
                    myDataAdapter.Fill(dsGrosir, "DTKwitansiGrosir")
                    If dsGrosir.Tables("DTKwitansiGrosir").Rows.Count > 0 Then
                        rpt = New crInvoice
                        rpt.SetDataSource(dsGrosir)
                        'below, a query that I use to display Sub Report
                        cmd.CommandText = "select Brand, IMEI from tbtemp"
                        cmd.CommandType = CommandType.Text
                        cmd.Connection = myConnection
                        If cmd.Connection.State = ConnectionState.Closed Then cmd.Connection.Open()
                        myDataAdapter.SelectCommand = cmd
                        myDataAdapter.Fill(ds1, "DTIMEI")
                        If ds1.Tables("DTIMEI").Rows.Count > 0 Then
                            rptSub = New crIMEIMobilePhones
                            rptSub.SetDataSource(ds1)
                        End If
                        CrystalReportViewer1.ReportSource = rpt
                        CrystalReportViewer1.RefreshReport()
                    End If

Thank you.


Viewing all articles
Browse latest Browse all 1507

Trending Articles



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