Home
Analytics
How to put a multi-line string in report
kubalaml
I am using ClearQuest 7.1.2 and have created a Data Set of type ClearQuest Query Result which returns the records based on a CQ query. ClearQuest has a bug where it returns identical records if you have a multi-line text field in your display. So if I have a record with ID 1 and a Description field of:
Line 1
Line 2
Line 3
The query output in ClearQuest will be:
ID Description
1 Line 1
1 Line 2
1 Line 3
These identical rows get passed to the BIRT report so that I have the same record showing up three times. How does everyone else deal with this issue? I figure I can do either of two things, I just don't know how to do them:
1) Setup some filter on the BIRT side so that it ignores records with identical ID numbers.
2) Modify the ClearQuest query so that it doesn't have a multi-line text field on the Display fields then find some way to still show that field in the BIRT report. From what I have seen, the fields that show up in the Display fields in ClearQuest are the ones that show up in the Output Columns section. There is no way to add a new field to the Output Columns. Also another thing I ran into is that if the multi-line display field is removed from the display in ClearQuest, but was used as a filter criteria for the query, BIRT throws an error saying it can't find that field.
Find more posts tagged with
Comments
johnw
1) Group on ID number, and use an String Aggregation component for your multi-line field so it will display as a single field.
2) dump the table straight into the report design, select the column with the ID, and select suppress duplicates
3) Pass your query result to a scripted data set and combine that way. Do something like have a hidden table in your report to get the original result set, populate a map or array, and use the scripted data set to output the filtered results.
Solution 1 and 2 are going to be your easiest ones, and depending on the requirements of your report, the most appropriate.
kubalaml
Thanks for the help! I started off trying solution 2 because that is the only one that made sense to me (I'm new to this stuff), but when I suppressed duplicates, it still showed all the other rows. It just removed the duplicate field. When I did a little research to see if I was doing this right, I came across this blog post:
http://birtworld.blogspot.com/2010/10/birt-duplicate-rows.html
I used an OnCreate script to create a global variable containing the ID of the previous row then for the row I used a Visibility expression that said if the current ID is equal to the previous ID, hide the row. This isn't the most efficient method but it seems to work.