Jump to content
We've recently updated our Privacy Statement, available here ×

Help please: Organization Name in Report?


javalogan

Recommended Posts

 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?

Thanks



Post Edited by javalogan at 04/07/2011 14:57



Post Edited by javalogan at 04/07/2011 15:33
Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

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

  • 3 weeks later...

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/myreport1

You 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

  • 4 weeks later...
  • 3 months later...

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.

Carl



Post Edited by cbarlow3 at 12/14/2011 23:30
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...