问题描述
我在水晶报告中面临重复页面,
我的东西是:
表客户:有1(一)行
表菜单有超过一行,
我使用下面的查询来组合两个表并打印
查询:
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
在crsytal报告中(视觉工作室我创建了一个数据集,我添加了一个数据表并添加了所有列从表A和表B),
并详细设计水晶报告部分i填写客户表信息并添加子报告和填充菜单记录(记录打印a我的愿望)但问题是,如果一个菜单有5个项目意味着它将5页副本(没有记录重复,)页面复制hapens,帮我解决它..我的完整代码如下
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
推荐答案
这篇关于如何解决Crystal Report中的重复页面问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!