Dynamically collapse dictionary data sources/variables
-
- Posts: 53
- Joined: Wed Nov 27, 2013 5:24 pm
Dynamically collapse dictionary data sources/variables
Is there a way to programatically collapse, or expand, our data sources or variables on the dictionary?
Re: Dynamically collapse dictionary data sources/variables
Hello,
Unfortunately, it is not possible. Sorry.
Thank you.
Unfortunately, it is not possible. Sorry.
Thank you.
-
- Posts: 53
- Joined: Wed Nov 27, 2013 5:24 pm
Re: Dynamically collapse dictionary data sources/variables
I see, well the reason I wanted to do this is because I've been trying to remove variables from the dictionary programatically when the report is being compiled, like this:
Report.Dictionary.Variables.Remove(Report.Dictionary.Variables("MyVar"))
But I noticed this only worked when the Variables Menu was collapsed, for some reason, is there anything else I could do to accomplish this?
Report.Dictionary.Variables.Remove(Report.Dictionary.Variables("MyVar"))
But I noticed this only worked when the Variables Menu was collapsed, for some reason, is there anything else I could do to accomplish this?
Re: Dynamically collapse dictionary data sources/variables
Hello.
Could you describe your issue more detailed?
Why do you need to remove variables?
Thank you.
Could you describe your issue more detailed?
Why do you need to remove variables?
Thank you.
-
- Posts: 53
- Joined: Wed Nov 27, 2013 5:24 pm
Re: Dynamically collapse dictionary data sources/variables
Say I have a database with 10 tables, each of them is a data source. I have also declared 10 variables into the dictionary.
Now if the user selects Datasource1 from the database, he can use variable1, variable2 and variable3 from the dictionary to filter the data in the data source he selected.
He however doesn't need variables 4 to 10, so it's useless to ask them to him in the parameters tab.
But if the user selects Datasource2 he could use variable1, variable5 and variable6 and so on.
Therefore I'd like to remove those variables the user doesn't need, based on the data source he selected.
I'm really hoping you can help me with this.
Now if the user selects Datasource1 from the database, he can use variable1, variable2 and variable3 from the dictionary to filter the data in the data source he selected.
He however doesn't need variables 4 to 10, so it's useless to ask them to him in the parameters tab.
But if the user selects Datasource2 he could use variable1, variable5 and variable6 and so on.
Therefore I'd like to remove those variables the user doesn't need, based on the data source he selected.
I'm really hoping you can help me with this.

Re: Dynamically collapse dictionary data sources/variables
Hello.
There are 2 methods that could help you:
Using them you could get used Data Sources and Business Objects and remove unnecessary variables.
Thank you.
There are 2 methods that could help you:
Code: Select all
StiBusinessObjectHelper.GetUsedBusinessObjectsNames(StiReport)
StiDataSourceHelper.GetUsedDataSourcesNames(StiReport)
Thank you.
-
- Posts: 53
- Joined: Wed Nov 27, 2013 5:24 pm
Re: Dynamically collapse dictionary data sources/variables
I'm definitely interested in the second option you showed me
I was checking this: http://admin.stimulsoft.com/documentati ... Helper.htm and saw the function GetUsedDataSourcesNames returns a Hasthtable, but I'm not exactly sure how to use it, also I see the function GetUsedDataSourcesNamesList that returns a List of String and I tried using it like this while compiling the report just to see what it returned:
But I'm only getting a blank Message Box, and I can't see anything while debugging either, what am I doing wrong? 
Code: Select all
StiDataSourceHelper.GetUsedDataSourcesNames(StiReport)
Code: Select all
MessageBox.Show(String.Join(",", StiDataSourceHelper.GetUsedDataSourcesNamesList(StiReport).ToArray))

Re: Dynamically collapse dictionary data sources/variables
Hello,
Can you please send us a more detail information about your issue.
Where do you use this code MessageBox.Show(String.Join(",", StiDataSourceHelper.GetUsedDataSourcesNamesList(StiReport).ToArray))
Thank you.
Can you please send us a more detail information about your issue.
Where do you use this code MessageBox.Show(String.Join(",", StiDataSourceHelper.GetUsedDataSourcesNamesList(StiReport).ToArray))
Thank you.
-
- Posts: 53
- Joined: Wed Nov 27, 2013 5:24 pm
Re: Dynamically collapse dictionary data sources/variables
Edited, it works now
Last edited by theregister on Mon Jan 06, 2014 7:29 pm, edited 1 time in total.
-
- Posts: 53
- Joined: Wed Nov 27, 2013 5:24 pm
Re: Dynamically collapse dictionary data sources/variables
Sorry it seems I typed the report name wrong, it's giving me the data now! 
