Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Change data source location at template runtime - nope
b2tech
OK here is my issue. (using ver. 3.7)
I have all my Data Sources, Data Sets, Report Parameters, Report Items (ie. charts, tables etc.) inside of a library. I construct all report template designs on the fly (with the DE) using user input. All data feeding into the templates came from one hard-coded directory space that was originally contained in one Data Source residing in the library. The report items are thus all tied back to the library Data Sets and then this library Data Source.
Here is the problem:
If I try to use a parameter (coded inside library data source) to pass in a dynamic directory path from the Property Binding / Home Folder area it gets -ignored-. OK, I think I read something about this not being designed to do this. Note: I also get the same result with code that is located in the beforeOpen script of a datasource:
ie.
folder = reportContext.getParameterValue("csvDir");
this.setExtensionProperty("HOME",folder);
So I modified my template (as a quick test) to now have all NON library Data Sources and all NON library Data Sets and all NON library Report Parameters. I then ran my template under the Report Designer and it worked. (huh?) The location of the directory to get the CSV files DID change on the fly. (dynamically changing the name of the actual file to retrieve WITHIN a directory has never been a problem. ie. qry = this.queryText; this.queryText = qry.replace( "t-blk1.csv", params["txtblk_fname_id"] + "t-blk1.csv"); -- this works great)
Now if I then locate this template under runtime/Tomcat - you again get a no-go. The data directory location resorts back to original Data Source path and my passed in parameter is ignored. I did notice that in the case of a dynamic directory shift for the data source -working- in the report designer, the parameter being passed in HAD to come from outside and not from a "properties file" being read in at the template "initialize" stage.
Any ideas what I am doing wrong.
-- Bill
Find more posts tagged with
Comments
JasonW
Bill,
Did you get this worked out? Does the path for the parameter have any spaces in it?
Jason