Page 1 of 2

converting rows to columns

Posted: Thu Aug 11, 2022 7:10 am
by dmasterplan
Hi,

I have this query result:

Code: Select all

     
     TITLE                   CODE
    --------------------------------
    ABCDE-AA-XXX-PD-001		A
    ABCDE-AA-XXX-PD-001		B
    ABCDE-AA-XXX-PD-001		C
    ABCDE-AA-XXX-PD-001		D
    GBSRH-AF-DXY-PD-001		1
    GBSRH-AF-DXY-PD-001		2
    GBSRH-AF-DXY-PD-001		3
    GBSRH-AF-DXY-PD-001		4
    GBSRH-AF-DXY-PD-001		5
    GBSRH-AF-DXY-PD-001		6
I want to change it to:

Code: Select all

    TITLE                   REVISIONS
    -----------------------------------------------------------
    ABCDE-AA-XXX-PD-001	    A      B      C      D 
    GBSRH-AF-DXY-PD-001     1      2      3      4     5     6
I tried this using PIVOT but I can't produce the output since they have different number of columns.

So, I concluded that this can be done in Stimulsoft without using PIVOT since this one that I want to achieve is a Stimulsoft report.

Thanks much!

Re: converting rows to columns

Posted: Thu Aug 11, 2022 7:42 am
by Lech Kulikowski
Hello,

You can use the Cross-Data component for that task.

Thank you.

Re: converting rows to columns

Posted: Thu Aug 11, 2022 11:51 am
by dmasterplan
Thank you for answering my question.

How can I achieve this?
This is what I did. I created two datasources, 1 master and 1 detail.
Both has title and code. Created a relation, parent and child columns are title.

Data 1 and Data 2.
Data2 is the master and Data1 is the detail.

Datasource2 (Data2)
has CrossHeaderBand1 inside is Data2.title
and CrossDataBand1 inside is Data1.code

CrossDataBand1 is the detail and Data2 is the master.

I have achieved I want but the output is duplicate though my query is DISTINCT (used INTERSECT).

What did I do wrong?

Can you please help me with this.

I have attached my report for you to look at.

Thanks much!

Re: converting rows to columns

Posted: Fri Aug 12, 2022 5:59 am
by dmasterplan
Please help. I am not getting my target output. I am getting duplicates.

Re: converting rows to columns

Posted: Fri Aug 12, 2022 6:58 am
by Lech Kulikowski
Hello,

In the provided sample is created an additional data source ("Data from other Data Source") that contains only grouped data and is used for master databand.

Thank you.

Re: converting rows to columns

Posted: Fri Aug 12, 2022 1:34 pm
by dmasterplan
Thanks for answering.

I actually did group the master datasource BUT I am still getting duplicates.

Please check my screenshots and I will reattach my report file for your review.

Please help as I really need to finish this. My deadline is getting near.

Thanks much!

Re: converting rows to columns

Posted: Fri Aug 12, 2022 2:51 pm
by Lech Kulikowski
Hello,

Please send us your report with test data for analysis.

Thank you.

Re: converting rows to columns

Posted: Fri Aug 12, 2022 3:14 pm
by dmasterplan
Please see attached report file.

Re: converting rows to columns

Posted: Fri Aug 12, 2022 3:59 pm
by dmasterplan
Reattaching report with database.

Please help.

Thanks

Re: converting rows to columns

Posted: Mon Aug 15, 2022 7:11 am
by Lech Kulikowski
Hello,

Please send us test data for your report.

Thank you.