Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am facing Problem in Crystal report help me Gold hearted

I need to print information from Two tables
1.Customer Tables
2.Menu Tables,

in Visual studio i create new dataset , in designer view i add one datable and combine Two table when i load the Report its work nicely ,the problem is if a menu has 10 rows means the report will print 10 times , how to avoid it, i search all the forums , but couldn't solve the problem ( no duplication in Records , only in Pages )

This is my code...
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.q<big></big>no 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()
Posted
Comments
Master Vinu 28-Mar-14 5:14am    
Hi ,
have y get double record??
Member 10529245 30-Mar-14 21:31pm    
Not Double Records , I got the Out put Perfectly but if a menu has 5 records , the Entire report will print 5 times... ( how to Solve it )
Master Vinu 31-Mar-14 2:02am    
In query its group by menu..so plesae check in sql with query record which shown 5 times print . and check the record...??
Member 10529245 31-Mar-14 3:07am    
when i execute the above Query ( customer table has one row , menu table has 5 rows) the out put is 4 rows ( but if i remove Group by menu it will print 5 rows)

VIP
1.Apple juice
2.Orange Juice
3.Pizza ( large)
4.Pepsi -2ltr ( i want the Out put like that ) help me .. ( sheikanas24@gmail.com) is my email id
Member 10529245 31-Mar-14 4:27am    
That Solution also not work,
can you drop me your mail ( i will send briefly what i did) that's easy for you to understand my problem ( if possible drop your mobile number )

1 solution

VB
Go to the Section Expert > Select the Details Section > Paging tab > click the formula button beside 'End of Section' under 'New Page After' and use this code:

PageNumber = 0 AND
RecordNumber = 5
 
Share this answer
 
v2

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