Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:
SQL
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
VB
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
Posted
Updated 4-Apr-14 23:29pm
v4

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900