Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
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
Posted
Updated 11-Dec-13 23:43pm
v2
Comments
thatraja 12-Dec-13 2:38am    
Include the table structures in your question
prince_rumeel 12-Dec-13 2:55am    
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
thatraja 12-Dec-13 5:07am    
Include this in your question(there we could see formatted), Edit your question & update
prince_rumeel 12-Dec-13 5:43am    
Done

Consider this best way
creating a column Std_Roll_Number in the table Record_Student
OR
creating a column Short_Roll_number in the table Record_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
---------------
Quote:
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.

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.
SQL
SELECT LEFT(Std_Roll_Number,10) Std_Roll_Number, other fields FROM Record_Student

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.
 
Share this answer
 
v2
Comments
prince_rumeel 12-Dec-13 6:27am    
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.
thatraja 12-Dec-13 8:48am    
Check updated answer
thatraja 12-Dec-13 12:14pm    
Did you check updated answer?
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
 
Share this answer
 

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