saha.nabajyoti Posted April 27, 2015 Posted April 27, 2015 Hi Jasper Gurus,In jasper server 5.2,we have created a folder(suppose FOLDER 1) and deployed few reports in that folder with datasource(suppose DATASOURCE 1) for each reports.Now we copied all the reports and pasted it in a different folder(suppose FOLDER 2).All the reports of FOLDER 2 are attached with same datasource(DATASOURCE 1)which the reports of FOLDER 1 are using.Now if we create another datasource(suppose DATASOURCE 2) and want to attach each reports of FOLDER 2 to connect DATASOURCE 2instead of DTASOURCE 1 ,we have to manually edit each reports of FOLDER 2 and attach the new datsource i.e DATASOURCE 2.This whole process is very hectic and time consuming too. Is there any simple way so that we can change the datasource easily without editing each reports of FOLDER 2 individually.Please suggest.We need the solution urgently.
srang Posted April 27, 2015 Posted April 27, 2015 I've had the same problem and I've come up with a less time consuming way but its not much easier, so it really depends on how many reports you need to change the datasource for. What I do when I need to change the datasource for a large number of reports is I'll change the datasource for just one report and then export the folder to .zip (if you don't change one of the datasources it won't be included in the zip and then you can't import the update), then use grep -rl <old_datasource_path> and make sure my regex is good then pipe that into xargs sed -i 's:<old_datsource>:<new_datasource>:g' and then rezip the whole thing back up and then import it back into the server. so those steps again are:1) make one of the reports in your folder point to your new datasource2) export your report folder3) run : 'mkdir test && unzip export.zip -d test && cd test' from your downloads folder4) then run: 'grep -rl 'old_datasource_name' | xargs sed -i 's:old_datasource_name:new_datasource_name:g'5) zip -r foo.zip ./*6) Import foo.zip into my server
hozawa Posted April 28, 2015 Posted April 28, 2015 Just put the datasource in the same folder as the report and copy and paste the parent folder.
saha.nabajyoti Posted April 28, 2015 Author Posted April 28, 2015 Thanks a lot Srang.I know your method will work but as you know,it is also very hectic process and client will not agree with this solution.Anyway thanks a lot for yourhelp.
srang Posted April 28, 2015 Posted April 28, 2015 Another option you might want to try is use organization/tenant/user attributes to dynamically determine the host of your datasource and have all of your reports point to a single datasource object. To get this to work across organizations would be to have the datasource in a public folder and restrict access to execute/read.
saha.nabajyoti Posted April 28, 2015 Author Posted April 28, 2015 Hozawa,you have given a wonderful solution ,no doubt...........It worked like a charm........Thanks a lot man.....Cheers .:)
cekebui Posted February 9, 2022 Posted February 9, 2022 Hi, I have found an easier way. Put the datasource in 'report' folder, NOT in 'data source' folder. In Folder 1, before export, point the datasource to desired new databaseFrom Folder 1, export. In Folder 2, import.You will find that all reports in Folder 2 now pointing to the new databaseChange the datasource in Folder 1, pointing back to its original database Hope you can try and give me feedback.(Basically I created this steps based on Hazawa's hint)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now