javalogan Posted July 4, 2011 Share Posted July 4, 2011 Hi, does anyone know how to display the Organization name in a report? If the structure is (for example):Organizations/Test_Organization If I have a report in the Test_Organization, how can I display the organizations name in the report?ThanksPost Edited by javalogan at 04/07/2011 14:57Post Edited by javalogan at 04/07/2011 15:33 Link to comment Share on other sites More sharing options...
neilelliott Posted July 5, 2011 Share Posted July 5, 2011 You can output the internal orgnanization ID (tenant ID) for the logged in user. You can do this in iReport by selecting the 'Domain Parameters' element and dragging it to the report. You are then presented with a list of default input parameters. Select the ones you're interested ie LoggedInUserTenantId, and these are added to the available parameters seen in the report explorer. Then just drag this onto the report like any other parameter.Unfortunately this is not the company alias nor company name. You could maybe expand on the Jasper classes/Spring configuration to add these to the report, or use the 'LoggedInUserTenantId' as a lookup to get the actual value from a DB table.Hope this is at least a start.Neil Link to comment Share on other sites More sharing options...
javalogan Posted July 6, 2011 Author Share Posted July 6, 2011 Have tried using the domain parameters but as you also said, the tenantid is not the actual name. I'll try add a query in the report as suggested. Thanks Link to comment Share on other sites More sharing options...
javalogan Posted July 26, 2011 Author Share Posted July 26, 2011 This is still not working. It needs to be the organization of of the report and not the organization of the logged in user.Can anyone offer any suggestions? Link to comment Share on other sites More sharing options...
mdahlman Posted July 28, 2011 Share Posted July 28, 2011 I'm not sure this is possible. Reports don't have an organization like users do. Of course the report is located within an org... but the report isn't really "aware" of its location in the repository.On the other hand... reports don't really move around the repository. Following your example, you have this report:Organizations/Test_Organization/myreport1You could hard-code "Test_Organization" in the report. But that's pretty obvious; you probably already thought of that. So I guess that you have reasons for not wanting to do that.Can you describe your general requirement a bit more?Regards,Matt Link to comment Share on other sites More sharing options...
javalogan Posted August 26, 2011 Author Share Posted August 26, 2011 Well, my general requirement is to just get the organization name on the report without hardcoding it, but seems like thats not possible so we're going to try using a scriptlet instead. Will see if that works :) Link to comment Share on other sites More sharing options...
cbarlow3 Posted December 14, 2011 Share Posted December 14, 2011 What are you trying to print on the report? The "organization" name in the sense that the JasperSoft repository uses it, or do you mean the name that the company puts at the top of their letterhead? If the former, I think Matt's answer is correct, and it's useful new information for me, because we usually set up one of our clients with multiple "organizations", each being nearly identical except that they each have a different Data Source (pointing to either the live database or an older backup/test copy), and so the reports and queries in each organization point to the local version of Data Source. After reading Matt's solution (and testing it), I'm now tempted to add the "organization" name to the top of most of my reports so our clients will know for sure whether the report they're looking at (if it was printed or exported) was run in the "live" organization (d0023liv might be our organization name) or in one of their "test" organizations (d0023t00, for example). Our organization names aren't super user-friendly, but I could make them discrete. In fact, instead of at the top, I think I'll put them on the left side of my page footers (the right side has "Page x of y").If you instead mean the company letterhead name, I can still see how that might be useful if either (a) you have it in several reports and you don't want to have to change all those reports if the company name changes, or (b) you use the same reports for multiple companies and would like to not have to modify the code for each. These end up being effectively the same problem. Is it possible that the name you seek is already in the main database you're querying? If so, I think that would be the ideal place to look, as it seems to resolve both the scenarios I mentioned: no customization necesarry as you make copies of the report specification available to multiple customers who use the same schema, and no report modifications necessary if the customer changes their business name, assuming they have ready access to change their own business name within their database in some kind of single row environment table, for example.CarlPost Edited by cbarlow3 at 12/14/2011 23:30 Link to comment Share on other sites More sharing options...
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