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

Send the user to a specific report after login


jacobhorbulyk

Recommended Posts

Hi all,

Is it possible for a user to be redirected to a specific report after login as opposed to entering their login credentials and then being redirected to the repository by default?  Is this a feature that is avaialbe in the professional versions or is it just something that has yet to be concieved?

Thanks

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

There's no simple way to achieve this.

The commercial version of JasperReports Server shows an example of redirecting based on the user's role. The same technique would work equally well in the community edition.

The key thing that is needed to redirect each user would be the concept of persisted user preferences. We'll surely see this feature added someday, but it's not there today.

That said, you could certainly get it working today... but it will take some work. The profile attributes are already there. So you could populate that attribute with something and then grab that value and use it to figure out where to direct the user on login. It won't be trivial.

Regards,
Matt

Link to comment
Share on other sites

 I already did that by modifying the jasper-servlet.xml file. The launched report is a report listing the /reports tree and showing to the user only the reports he is authorized to launch.

I already posted about that somewhere in this forum one or two years ago. 

Link to comment
Share on other sites

 So I change the line in the jasperserver-servlet.xml file to:

 

<value>ROLE_USER|redirect:/flow.html?_flowId=viewReportFlow&reportUnit=/Two_Tables</value>

 

and then upon restarting jasper server I get the following error:

 

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 122 in XML document from ServletContext resource [/WEB-INF/jasperserver-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The reference to entity "reportUnit" must end with the ';' delimiter.Any suggestions?

Link to comment
Share on other sites

 The post I was referencing is :

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=45792

In fact, I "clone" the viewReportFlow and I set the report to be launched at the beginning.

In the jasperserver 4 release, it is the same basic principle but there are some changes in the files to be cloned and the way to do that.

Swood said that my method was "cumbersome". It is probably true, but it works fine since one or two years. I think there are other ways to do the same thing in a more clever manner but I am not a guru of spring.

Gaby

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...