locked
How to display related tables in one crystal report and how to link this report with combobox? RRS feed

  • Question

  • User-1927448428 posted

    Hi! I want to display a crystal report in my vb.net application. Suppose I have tables named student details, student marks, student address, etc... Now if I want to display all these details (fields of all tables) in one crystal report (with page breaks if necessary) then how will I achieve it. I will be providing a combo box in my application that contains list of student names. How can I link this combo box with the cystal report to dynamically display report for different student on selected index change of combo box? Help me friends. An example would be appreciable.

    Thursday, August 19, 2010 1:31 AM

Answers

  • User1224194097 posted

    Create a procedure which takes a student ID as parameter which you will be assigning from front end.

    Write a Query like this

    SELECT A.*,B.*,C.*
      FROM STUDENT A 
               LEFT OUTER JOIN 
               STUDENT_MARKS B ON A.STUDENT_ID=B.STUDENT_ID
               LEFT OUTER JOIN
               STUDENT_ADDRESS C ON A.STUDENT_ID=C.STUDENT_ID           
     WHERE A.STUDENT_ID=@PSTUDENT_ID
    

    That gives student information based on the parameter

    create a new crystal report with datasource as the procedure that you create with aforementioned query.

    In the report Create a group for StudentID and drag marks fields onto details section

    add one more details section and drag address fields onto details section

    you can set options in group expert/section expert (repeat Group header on page and start new page after)

    That should do the job.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 19, 2010 11:39 AM

All replies

  • User1224194097 posted

    Create a procedure which takes a student ID as parameter which you will be assigning from front end.

    Write a Query like this

    SELECT A.*,B.*,C.*
      FROM STUDENT A 
               LEFT OUTER JOIN 
               STUDENT_MARKS B ON A.STUDENT_ID=B.STUDENT_ID
               LEFT OUTER JOIN
               STUDENT_ADDRESS C ON A.STUDENT_ID=C.STUDENT_ID           
     WHERE A.STUDENT_ID=@PSTUDENT_ID
    

    That gives student information based on the parameter

    create a new crystal report with datasource as the procedure that you create with aforementioned query.

    In the report Create a group for StudentID and drag marks fields onto details section

    add one more details section and drag address fields onto details section

    you can set options in group expert/section expert (repeat Group header on page and start new page after)

    That should do the job.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 19, 2010 11:39 AM
  • User-1927448428 posted

    Thanks sansan for replying. Could you please be more precise?

    It would be appreciable if you provide images for creating the crystal report or atleast a sample project that implements the above said concept.

    Sunday, August 22, 2010 3:54 AM