logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
j.torres@tewis.com  
#1 Posted : Saturday, May 18, 2019 7:05:21 PM(UTC)
j.torres@tewis.com

Rank: Member

Groups: Registered
Joined: 4/7/2019(UTC)
Posts: 24
Man
Spain

Thanks: 7 times
Hello. Is it possible to get the following result using the pivot feature built in Seal Report?
Original table:
ColYearMonth|Earns|Budget
2019-01. |... |...
2019-02. |... |...
2019-03. |... |...
...

Target:
|2019-01|2019-02|2019-03
Earns |.......|.......|......
Budget|.......|.......|......

Dots....means any value.

I've tried putting ColYearMonth column as Column and both Earns and Budget in Data Elements but the table I get is:
2019-01 |2019-02. |2019-03
Earns. |Budget |Earns. |Budget. |Earns. |Budget
...... |....... |....... |........|........|......

Thanks in advanced.
epf  
#2 Posted : Monday, May 20, 2019 6:07:03 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
If you select your Data table view, there is an option to invert Row/Column presentation:
It is the property 'Options: Invert data table'.
It should do what you want.
j.torres@tewis.com  
#3 Posted : Monday, May 20, 2019 7:00:53 AM(UTC)
j.torres@tewis.com

Rank: Member

Groups: Registered
Joined: 4/7/2019(UTC)
Posts: 24
Man
Spain

Thanks: 7 times
Thanks for your quick reply. I've check it but it doesn't work. I've disabled server pagination option, as indicated by the invert option. In fact, I've modified the datatable template to force the inversion:

reportModel.InvertDataTables();
/*
if (view.GetBoolValue("invert_data_tables") && modelView.GetBoolValue("show_data_tables") && !report.ExecutionView.GetBoolValue(Parameter.ServerPaginationParameter))
{
reportModel.InvertDataTables();
}*/

But it doesn't work either.

...Uploaded: Strange...If I add some field as page element, it seems to start working. To get the table I need I've to put the ColYearMonth as Row, not as Column and invert the DataTable. But I've not add any field as page element, the table is not inverted. May be is a bug?



Thanks in advance.

Edited by user Monday, May 20, 2019 8:07:56 AM(UTC)  | Reason: Not specified

epf  
#4 Posted : Monday, May 20, 2019 8:18:02 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Yes it is a bug (number 138),
to fix it just change the template like this:

Code:
    if (view.GetBoolValue("invert_data_tables") && modelView.GetBoolValue("show_data_tables") && !report.ExecutionView.GetBoolValue(Parameter.ServerPaginationParameter))
    {
        reportModel.InvertDataTables();
    }
    ResultTable table = page.DataTable;


to assign the table variable after InvertDataTables()...
it will be fixed in 5.0

Edited by user Monday, May 20, 2019 8:19:48 AM(UTC)  | Reason: Not specified

thanks 1 user thanked epf for this useful post.
j.torres@tewis.com on 5/20/2019(UTC)
j.torres@tewis.com  
#5 Posted : Monday, May 20, 2019 8:42:51 AM(UTC)
j.torres@tewis.com

Rank: Member

Groups: Registered
Joined: 4/7/2019(UTC)
Posts: 24
Man
Spain

Thanks: 7 times
Working!! Thanks so much. It's awesome.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.