部分加入Crystal Report [英] Partial Join In Crystal Report
问题描述
希望你们都做得很好,
我在水晶报告中遇到问题
Roll# =从Record_Roll_Number表中查看Std_Roll_Number字段的前10个字符
即Std_Roll_Number = 1212121212-00000-00000
学生姓名 =将上述Roll#字段的信息链接到Record_Student表,拉出Student_FullName字段。
即在我的Record_Student表中,它有一列Short_Roll_number,其中包含此格式的值1212121212
现在我想在水晶报告中加入这两张表,以获得与学生全名相关的理想结果。
我没有找到如何加入这两个领域的方法,或者如何获得学生的名字。
这是我数据表的结构
Record_Roll_Number包含以下栏目
Std_Roll_Number ----------- Previous_Degree ------ Group_Name ---- --- Joining_Date ------- Old_Roll_No
1212121212-00000-00000 ----入学-------- IT ----------- --- 1-1-2012 ----------- 13141552
和表Record_Student包含以下栏目
Short_Roll_number -------- Student_FullName ------- Std_FatherName ---------城市--- ---- Phone_Number
1212121212 ------------ ABCDEFGH ---------------- GHIJKLMN ------ ------ XYZ ----------- 1010101010
这是表结构,测试值以及
Hi,
Hope you all are doing well,
I am facing a problem in crystal report
"Roll # = from the Record_Roll_Number table look at the first 10 characters of the Std_Roll_Number field
i.e Std_Roll_Number = 1212121212-00000-00000
Student Name = link the information found for the Roll # field above to the Record_Student table and pull the Student_FullName field."
i.e in my "Record_Student" table it has a column "Short_Roll_number" which contain the value in this format "1212121212"
now i want to join these two table in crystal report, to get my desired result related to student full name.
I am not finding a way how to join these two fields, or how to get student name.
This is the structure of my data table
Record_Roll_Number contain the following column
Std_Roll_Number-----------Previous_Degree------Group_Name-------Joining_Date-------Old_Roll_No
1212121212-00000-00000----Matriculation--------IT--------------1-1-2012-----------13141552
and table "Record_Student" contain the following column
Short_Roll_number--------Student_FullName-------Std_FatherName---------City-------Phone_Number
1212121212------------ABCDEFGH----------------GHIJKLMN------------XYZ-----------1010101010
this is the table structure, and the test value as well
推荐答案
考虑这种最佳方式
创建一列Std_Roll_Number
Record_Student
或
创建一列表格中的Short_Roll_number
Record_Roll_Number
存储a在表格中存储数据时的适当值(在附加列上)。
完成上述任何操作后,您可以加入查询和表格中的表格。生成所需的输出。
Crystal报表要求列具有匹配的列数据类型(当您在报表设计器中建立关系时)。
除此之外,你还可以通过这种方式获得额外的好处。
编辑
-------- -------
Consider this best way
creating a columnStd_Roll_Number
in the tableRecord_Student
OR
creating a columnShort_Roll_number
in the tableRecord_Roll_Number
Store appropriate values(on additional column) when you store data in tables.
After done any of the above, you could join the tables in query & generate desired output.
Crystal reports requires the tables with matching datatypes of columns(When you do relationship in reports designer).
Besides you'll get additional benefits from this way.
EDIT
---------------
这是一个简单的方法,我不喜欢实现这个方法,我想简单地应用水晶报告中的连接,这是我客户的要求,所以请帮我用水晶报告来执行此操作。
This is a simple way, i don't like to implement this method, i want to apply simply a join from crystal report, it is the requirement from my client, so help me to perform this using crystal reports.
你不喜欢简单的方法?无论如何,我会给你另一个选择。
您是否在报告中使用数据库连接?如果是,那么就这样走吧。
来自SQL查询的C#Crystal Reports [ ^ ]
通过这种方式,您需要对查询进行更改,如下所示。使用此查询绑定一个数据表&另一个带有其他查询的数据表。
You don't like the simple way? Anyway I'll give you an another option.
Are you using Database connection for your reports? IF yes then go with this way.
C# Crystal Reports from SQL Query[^]
In this way you need to do changes in query like below. Bind one datatable using this query & another datatable with other query.
SELECT LEFT(Std_Roll_Number,10) Std_Roll_Number, other fields FROM Record_Student
如果您的报告没有使用数据库,那么就这样使用。
没有数据库的C#Crystal Reports [ ^ ]
同样的方式(在sql查询方式之上),你需要用提取的<$ c $绑定一个数据表c> Std_Roll_Number 。
就是这样。
If your reports not using database then go with this way.
C# Crystal Reports without database[^]
Same way(above sql query way), you need to bind one datatable with extracted Std_Roll_Number
.
That's it.
我解决了我的问题自己,
只需应用Link-Sub报告的概念。
Std_Roll_Number和Short_Roll_编号并获取学生姓名
I solved my problem Own self,
Simply apply the concept of Link-Sub Report.
the "Std_Roll_Number" and "Short_Roll_number" and fetch the Student Name
这篇关于部分加入Crystal Report的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!