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
gaurav11  
#1 Posted : Wednesday, April 19, 2017 2:16:23 PM(UTC)
gaurav11

Rank: Newbie

Groups: Registered
Joined: 3/17/2017(UTC)
Posts: 6
Man
India
Location: India

Thanks: 4 times
Was thanked: 1 time(s) in 1 post(s)
How to pass multiple restriction from parent report to sub report
I.e If we want to get sub report of a specific month based on the auto generated month column of date column than how to do it?
epf  
#2 Posted : Thursday, April 20, 2017 1:31:37 PM(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)
In a sub-report, you can defined several restrictions but set the property: 'Prompt as execution',
then it is better that all the restrictions should normally come from the same table definition...
Using Sub-Report may require particular context, you have really to test them in real condition.
Good luck.
thanks 2 users thanked epf for this useful post.
gaurav11 on 4/21/2017(UTC), netpacket on 12/3/2018(UTC)
netpacket  
#3 Posted : Monday, December 3, 2018 7:01:52 AM(UTC)
netpacket

Rank: Advanced Member

Groups: Registered
Joined: 12/3/2018(UTC)
Posts: 33
Man
Switzerland

Thanks: 13 times
Hi epf,
I have a Main report which uses tables 'WO' & 'WOLabor' and contains restriction on both tables(WO.Type & WOLabor.WorkDate).Then there is a subreport which has (WO.Type & WOLabor.WorkDate) as "Promp at Execution". The subreport is applied to WOLabor.WorkDate and in server manager it prompts that "1" restriction is added !!! It seems only restrictions that are on the same table as the subreport column are applied.So when I click the WOLabor.WorkDate column in my main report , the subreport is executed with only WOLabor.WorkDate restriction and WO.Type values are not sent to the subreport . Is there anyway to pass restrictions on other table than the subreport column to it?
Thanks

Edited by user Monday, December 3, 2018 7:17:07 AM(UTC)  | Reason: Not specified

epf  
#4 Posted : Monday, December 3, 2018 12:18:33 PM(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,when you add a sub-reports from the Server Manager, it takes only the restrictions from the parent table.
However you might edit directly the XML (.scfx) file by adding the restrictions guid got from your sub-report (*.srex)
<Restrictions>
<string>d937c8fc-64a6-415f-a77f-d3d1914e406d</string>
<string>20ed0b7a-87dd-4aaa-8d48-feab848e396b</string>
</Restrictions>
As it is a list of string. It seems to work.
The guid is got from
<MetaColumnGUID>20ed0b7a-87dd-4aaa-8d48-feab848e396b</MetaColumnGUID>

This should be enhanced...

Otherwise, I would recommend to create a view above that makes the join and to create a key column with your date and type...if it fits your requirement.
thanks 1 user thanked epf for this useful post.
netpacket on 12/4/2018(UTC)
netpacket  
#5 Posted : Sunday, December 9, 2018 8:21:08 AM(UTC)
netpacket

Rank: Advanced Member

Groups: Registered
Joined: 12/3/2018(UTC)
Posts: 33
Man
Switzerland

Thanks: 13 times
Thanks epf, works fine now.
there is just a liitle problem, if I have a restriction in my main report that has multiple values e.g "WO.ShopID IN ('FSSC1','FSSC2')", Only the First value (FSSC1) is passed to the subreport.Any solution for that?
Thanks Again.
epf  
#6 Posted : Monday, December 10, 2018 8:15:20 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)
Normally, you call a sub-report from a cell which has a single value, so for me it is not possible to pass multiple values for the same column in a sub-report context, can you explain more your problem ?
netpacket  
#7 Posted : Tuesday, December 18, 2018 5:11:43 AM(UTC)
netpacket

Rank: Advanced Member

Groups: Registered
Joined: 12/3/2018(UTC)
Posts: 33
Man
Switzerland

Thanks: 13 times
Suppose that we have a table called 'WO' and the columns are 'WOID,ShopID,Month'. I have a report that shows me how many 'WOID's are in each 'Month'. The restriction in this report is "WO.ShopID IN ('FSSC1','FSSC2')". The sub-report is based on the 'Month' column. So I'm actually calling the sub-report from a cell which has a single value too. But the problem is that I need the restriction (WO.ShopID IN ('FSSC1','FSSC2')) to be passed to the sub-report too. But only the first value(FSSC1) is passed.
epf  
#8 Posted : Wednesday, December 19, 2018 11:46:42 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)
I have to check this case...if it it incorrect, the fix would be for the next release...
thanks 1 user thanked epf for this useful post.
netpacket on 12/25/2018(UTC)
netpacket  
#9 Posted : Monday, January 14, 2019 8:44:19 AM(UTC)
netpacket

Rank: Advanced Member

Groups: Registered
Joined: 12/3/2018(UTC)
Posts: 33
Man
Switzerland

Thanks: 13 times
Originally Posted by: epf Go to Quoted Post
I have to check this case...if it it incorrect, the fix would be for the next release...


Hi epf,
Did you get any chance to check that?
Thanks

epf  
#10 Posted : Monday, January 14, 2019 10:22:06 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)
well, it is in the TODO list, but we actually give the priority to sponsored features...so no planning so far.
Sorry.
Alex Keil  
#11 Posted : Thursday, March 21, 2019 3:39:09 AM(UTC)
Alex Keil

Rank: Newbie

Groups: Registered
Joined: 2/1/2019(UTC)
Posts: 4
Australia

Not sure if you've already solved this, but with a bit of customization you can do this (in the 'Final Script' section
They way i ended up doing it was to total re-draw the report HTML, then add a custom link to the cells in question.

It requires getting the MetaGUID of the columns in the sub-report (open the report file with a text editor to see this).

Don't setup the reports as a sub-report like you normally would

On the cell you want

// create a new link
NavigationLink link = new NavigationLink();

// this is the main part
string hrefString = "rpa=%25SEALREPOSITORY%25%5cSubReports%5c" + <subReportName> + "&dis=" + <value of the cell where sub-report starts> + "";

Then you need to add each restriction and value to the end of the URL with &res=<the METAID of the field in the subreport>&val = <the values you are passing in>
you will also need a counter as its &res1=something&val=something&res2=somethingelse&val=somethingelse&res3... etc


Then at the end do this
link.Href = hrefString;
link.Text = "<name you want to see in the popup";
<cell you want the link on>.Links.Add(link);

hope it works for you

netpacket  
#12 Posted : Wednesday, April 10, 2019 5:21:45 AM(UTC)
netpacket

Rank: Advanced Member

Groups: Registered
Joined: 12/3/2018(UTC)
Posts: 33
Man
Switzerland

Thanks: 13 times
Originally Posted by: Alex Keil Go to Quoted Post
Not sure if you've already solved this, but with a bit of customization you can do this (in the 'Final Script' section
They way i ended up doing it was to total re-draw the report HTML, then add a custom link to the cells in question.

It requires getting the MetaGUID of the columns in the sub-report (open the report file with a text editor to see this).

Don't setup the reports as a sub-report like you normally would

On the cell you want

// create a new link
NavigationLink link = new NavigationLink();

// this is the main part
string hrefString = "rpa=%25SEALREPOSITORY%25%5cSubReports%5c" + <subReportName> + "&dis=" + <value of the cell where sub-report starts> + "";

Then you need to add each restriction and value to the end of the URL with &res=<the METAID of the field in the subreport>&val = <the values you are passing in>
you will also need a counter as its &res1=something&val=something&res2=somethingelse&val=somethingelse&res3... etc


Then at the end do this
link.Href = hrefString;
link.Text = "<name you want to see in the popup";
<cell you want the link on>.Links.Add(link);

hope it works for you



Hi Alex,I'll check out your solution
Thanks man
epf  
#13 Posted : Thursday, April 11, 2019 12:25:41 PM(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)
I am glad to see that you may control everything in the final script...

I made a small modification for the incoming 5.0, sub-reports may contain restrictions from columns coming from other tables,
I hope it will be enough for your needs.
If you make a sample with Northwind (reports + data source), I can check it.
thanks 1 user thanked epf for this useful post.
netpacket on 4/13/2019(UTC)
netpacket  
#14 Posted : Saturday, April 13, 2019 6:34:48 AM(UTC)
netpacket

Rank: Advanced Member

Groups: Registered
Joined: 12/3/2018(UTC)
Posts: 33
Man
Switzerland

Thanks: 13 times
Originally Posted by: Alex Keil Go to Quoted Post
Not sure if you've already solved this, but with a bit of customization you can do this (in the 'Final Script' section
They way i ended up doing it was to total re-draw the report HTML, then add a custom link to the cells in question.

It requires getting the MetaGUID of the columns in the sub-report (open the report file with a text editor to see this).

Don't setup the reports as a sub-report like you normally would

On the cell you want

// create a new link
NavigationLink link = new NavigationLink();

// this is the main part
string hrefString = "rpa=%25SEALREPOSITORY%25%5cSubReports%5c" + <subReportName> + "&dis=" + <value of the cell where sub-report starts> + "";

Then you need to add each restriction and value to the end of the URL with &res=<the METAID of the field in the subreport>&val = <the values you are passing in>
you will also need a counter as its &res1=something&val=something&res2=somethingelse&val=somethingelse&res3... etc


Then at the end do this
link.Href = hrefString;
link.Text = "<name you want to see in the popup";
<cell you want the link on>.Links.Add(link);

hope it works for you



Hi Alex,
I Couldn't get it working.
Could you please make a sample with Northwind?
And by the way does this solution work with restriction that are prompted and the user select a combination of them? Or is it just a fixed set of restriction sent to the subreport?
Thanks
Users browsing this topic
Guest (6)
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.