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

Directly link to a report


poiana

Recommended Posts

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

So you are asking about 2 things:

 

Anonymous access

Running a report from a URL

 

 

Anonymous access can be achieved by setting the following in applicationContext-security.xml:

 

Code:



<bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter">

<property name="key"><value>foobar</value></property>

<property name="userAttribute"><value>anonymousUser,ROLE_USER</value></property>

</bean>

 

Note the ROLE_USER setting.

 

 

The URL you need to use to run the report should look like:

 

http://localhost/jasperserver?_flowId=viewReportFlow&reportUnit=<URI>&reportUnitParameter1=blah&reportUnitParameter2=blah

 

 

 

 

Sherman

JasperSoft

Post edited by: swood, at: 2007/11/25 18:38

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

well it's not my thread, but I've nearly the same question - so I tried out what Sherman wrote. Here are the results and one more question.

 

 

1st

The first thing the URL: here's an example which is functional:

http://kl0504554:8080/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/klinstu/MD_A2&p_STU_ID=5

 

2nd - the question:

Isn't there another way to call just the PDF-variant?I don't want to see the Jasper-Header (HTML-output) and the icons for allthe Fileformats (Word, Excel,...)

The URL will be build in another application (Oracle-APEX) an I want to call the PDF-Report.

May be a JSP-file it the solution but I do not want to make a jsp-file because I'm not very familiar in JSP.

 

 

3rd

The permission were set "read" for the report-unit. I changed the applicationContext-security.xml but an anonymous User still gets the logon screen. No error messages.

 

Any help is appreciated.

With best regards

Joerg

Link to comment
Share on other sites

Joerg--this may help.

 

2nd - the question:

Isn't there another way to call just the PDF-variant?I don't want to see the Jasper-Header (HTML-output) and the icons for allthe Fileformats (Word, Excel,...)

 

If you want to fill the report and export to PDF every time the link is clicked, your best bet is to use the JasperReports (not JasperServer) documentation. Since I'm not a developer, I can't help you with specifics. I just know it's been done.

 

You could also set up a scheduled job that fills the report and exports it to the JasperServer repository. You then reference the address of the PDF file in the repository, e.g., http://myserver:8080/jasperver/ContentFiles/pdf/my.pdf.

 

When you create the job, click "Overwrite files" (or whatever it says--I forget). To figure out what the URL should be, just pick up its properties once the PDF is output to the repository. This is a decent option if the report is run a lot and the data does not change rapidly. You have lots of scheduling options, even every [x] minutes.

 

Good luck!

Mary

Link to comment
Share on other sites

Mary, thank you for the hint.

I'll try to figure that out in the jasperreport-docum.

 

Unfortunately we need an online creation of a pdf-report based on a url-based parameter so scheduling is not the right way.

 

----------

 

One more info on the 3rd question (rights):

 

If we try to access the report via

"http://kl0504554:8080/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/klinstu/MD_A2&p_STU_ID=19"

as "anonymousUser" we get the following message on screen:

"The user has no access to this page.

Log out"

 

 

Joerg.

Link to comment
Share on other sites

Hello,

got some good news: I managed to access the pdf-Report directly.

I found a paramater called "output". [output=pdf]

Here's a working URL:

http://kl0504554:8080/jasperserver/flow.html?_flowId=viewReportFlow&_eventId_selectReport=&reportUnit=/reports/klinstu/MD_A2&p_STU_ID=8&decorate=no&output=pdf

---

 

So only anonymous login is still a problem.

 

 

Any help, please?

 

Regards

Joerg.

Link to comment
Share on other sites

  • 3 weeks later...

Hope someone can help, I'm new to Jasperserver.

I used the examples above to directly access a

report successfuly, however the report fails with a

MySQL source but works perfectly with an Access

database source. Here's my URL:

 

http://ws02:8080/jasperserver/flow.html?_flowId=viewReportFlow&_eventId_selectReport&reportUnit=/reports/cellsmysql&decorate=no&output=pdf

 

Here's the error:

 

org.springframework.webflow.engine.NoMatchingTransitionException: No transition was matched on the event(s) signaled by the [1] action(s) that executed in this action state 'checkForParams' of flow 'viewReportFlow'; transitions must be defined to handle action result outcomes -- possible flow configuration error? Note: the eventIds signaled were: 'array<String>['error']', while the supported set of transitional criteria for this action state is 'array<TransitionCriteria>[[eventId = 'yes'], [eventId = 'no']]'.

 

I can access both reports successfully direct from the

repository without error, but I need the url option.

 

Has anyone seen this before?

 

Hope you can help thanks

Post edited by: kingsnet, at: 2008/01/06 18:03

Link to comment
Share on other sites

  • 1 year later...

Thank you so much sherman. I was able to login to the report url without having to login... But in the jasper page ont he header it gives "Welcome, anonymousUser !"

Due to <property name="userAttribute"><value>anonymousUser,ROLE_USER</value></property>
 

As the report will be used by Internal folks -- using active directory authencation .. have configured my SSO.. So I need to show in the header the intranet name...

And I want to get the username from the HTTP header... as I have set the login_user name in IIS_Rewrite ... Can you please help me in that ...

 


RewriteEngine on
RewriteCond %{LOGON_USER} HEADQTRS\(.*)
RewriteHeader X-SSO-USER: .* %1

 


 

Link to comment
Share on other sites

  • 2 weeks later...

hi,

i changed the applicationContext-security.xml to :

<bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter">
        <property name="key"><value>foobar</value></property>
        <property name="userAttribute"><value>anonymousUser,ROLE_USER</value></property>
    </bean>

but still i cannot access the report directly. what else do i need to change.  i do have read only rights for role_user and anonymous.

any ideas?

 

 

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