Link to home
Create AccountLog in
Avatar of Sailee Govekar
Sailee GovekarFlag for India

asked on

Displaying only first row for the 2nd Stored procedure

I have two stored procedures in one report. My main stored procedure is procSSFTP_RPT_WorkAndRestDailyReport and 2nd stored procedure name is procSSFTP_RPT_GetCrewComments.

I want to display "Seafarer name" from my 1st stored procedure and "comments" from 2nd stored procedure.

I have multiple rows for the comments against the single seafarer name.

Instead of showing multiple rows of comments for single "seafarer name", I want to display one comment per "seafarer name".

Attached is the report for your reference

https://drive.google.com/open?id=1nb_DOgTVjFD1d-YdRR8jUX2omN5yO8KV
Avatar of Raghavendra Hullur
Raghavendra Hullur
Flag of India image

Hi,
The details can be restricted to display only once for each Seafarer name and single comment (I think this will be the comment from the first record for each Seafarer) by displaying the details under Group header section by creating a group on seafarer name. But, you also have other details like Department and Rank. Will those also be constrained to a single row display for each Seafarer?
Or you just want to display all the records for each Seafarer name and display only the comment from first record for each Seafarer name?
Avatar of Sailee Govekar

ASKER

We need to display top comment for each seafarer. Department and Rank will be single row.

Only the concern is with One seafarer and one comment.
Something like in attached report will do. But, when you say top comment for each seafarer name, is it the first comment or is it something associate with some value? If so, you may have to change the details accordingly. Currently, in the modified report, first comment for each seafarer will be displayed.
Report1.rpt
No.. its not specific. The very first comment.

and if the comment is NULL then also the seafarer name should be displayed
https://drive.google.com/open?id=12lSyQ7GszWc70wP0edmKm-yPd8BuEie-

I have multiple seafarer names. if I delete the comments then all the seafarer names are displayed.

If I add comments field then only on record is displayed. Which is wrong.

There will be list of seafarer
That must be something to do with the link you have created between those 2 stored procs. Try changing the join from inner join to left outer or right outer join based on the data availability. You can use the report I shared (retain the comment field in the report) and check after changing the link join type.
Changing joins won't bring the correct data
SOLUTION
Avatar of Raghavendra Hullur
Raghavendra Hullur
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
It worked after changing the Joins.
Earlier we were facing some problems with the Joins so couldn't do it. But now introduced some relations to handle in Stored procedure.