asp.net中的水晶报表记录问题 [英] Crystal report record problem in asp.net

查看:69
本文介绍了asp.net中的水晶报表记录问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在asp.net中从事采购订单项目,因为我需要水晶报表.

我正在研究水晶报表的推送过程.

出现的问题是当我触发查询并将其绑定到Crystal报表时,尽管记录仅是数据集中的一条,但它在Crystal报表中出现了两次.


数据集中的数据是这样的:
货号No PurchaseOrderNumber项目
1个PO/MA/2147菜肴

但在水晶报表中,其显示如下:

货号No PurchaseOrderNumber项目
1个PO/MA/2147菜肴
2个PO/MA/2147菜肴

请帮助我解决该问题,我真的很坚持..


提前谢谢.

克鲁纳尔·潘查尔

[从OP更新]

Hello everyone,

I am working on project of purchase order in asp.net , in that i want crystal reports.

I am working on crystal reports push process.

the problem arising is when i fire the query and bind it to the crystal report, though the record is only one in the dataset it is coming twice in crystal report.

i.e
the data in data set is like this:
Sr.No PurchaseOrderNumber Item
1 PO/MA/2147 Dishes

but in crystal report it is displayed like this:

Sr.No PurchaseOrderNumber Item
1 PO/MA/2147 Dishes
2 PO/MA/2147 Dishes

Please help me out how to solve this, i m really stuck up..


Thanks in advance.

Krunal Panchal

[Update from OP]

protected void btnSubmit_Click(object sender, EventArgs e) 
{ 
   try 
   { 
      cn.Open(); 
      cmd = new SqlCommand("select Distinct Username.Password,UserTasks from User_Master,UserTasks where   
         User_Master.Id=UserTasks.UserId and User_Master.UserId=''" + txtUerid.Text.ToString() + "'' ", cn); 
      da = new SqlDataAdapter(cmd); 
      ds = new DataSet(); 
      da.Fill(ds); 
      ReportDocument rep = new ReportDocument(); 
      string reportPath = Convert.ToString (Server.MapPath("~/CrystalReport1.rpt")); 
      rep.Load(reportPath); 
      rep.SetDataSource(ds.Tables[0]); 
      CrystalReportViewer1.ReportSource=rep; 
   } 
   catch { } 
   finally 
   { 
      cn.Close(); 
   } 
}


这是我的功能,用于将数据绑定到Crystal报表..请帮帮我..


This is my function for binding data to crystal report.. Please help me out..

推荐答案

请发布代码段并进行详细说明.
起初,这可能是您在查询中使用的联接问题.如果您使用的是SQL Server,请尝试使用Distinct KeyWord
Please post snipets of your code and query for more elaboration.
At first it may be problem of joins you are using in your query. Try Distinct KeyWord if you are using SQL server


在这里

重复项
水晶报告:删除重复的值 [处理重复记录或表格通货膨胀" [对Crystal Reports中的重复记录"进行故障排除 [ ^ ]


如何在Crystal Reports中使用分组 [
Here you go

Duplicates
Crystal Reports: Remove Duplicate Values[^]
Dealing with duplicate records or "table inflation"[^]
Troubleshooting "Duplicate Records" in Crystal Reports[^]

Group
How to Use Grouping in Crystal Reports[^]


这篇关于asp.net中的水晶报表记录问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆