I am facing duplicate page in crystal report ,
My Stuff is :
Table Customer : has 1 (one ) row
Table Menu has More then one rows ,
I used the below query to combine Two tables and print
Query:
SELECT a.*,b.* FROM tb_customer a INNER JOIN tb_Menu b ON a.id=b.Qno WHERE Id = 100 and a.id=b.qno
In crsytal Report( visual studio I creat one Dataset inside that i add one datatable and add all the column from Table A and Table B ) ,
and design the crystal report in detail section i fill customer table information and add sub report and fill menus Records(Records Print as my wish) but the problem is if a menu has 5 items means it will 5 copy of pages ( no record duplication , ) Page Duplication hapens , Help me to solve it .. my full code as follows
Dim No As String = Request.QueryString("id")
Dim con As New MySqlConnection(connectionString)
Dim rptDoc As New ReportDocument
Dim ds As New customerdataset
Dim dt As New DataTable
dt.TableName = "Crystal Report Example"
Dim da As New MySqlDataAdapter("SELECT a.*,b.* FROM tb_customer a INNER JOIN tb_Menu b ON a.id=b.Qno WHERE Id='" + No + "' and a.id=b.qno Group by menu ", con)
da.Fill(dt)
ds.Tables(0).Merge(dt)
rptDoc.Load(Server.MapPath("Confirm Order.rpt"))
rptDoc.SetDataSource(ds)
ConfirmOrder.ReportSource = rptDoc
rptDoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, Page.Title)
con.Close()
con.Dispose()
code blocks fixed