Jump to content
Changes to the Jaspersoft community edition download ×
  • How to open AdHoc view (v. 4.7 and higher) in AdHoc View designer and fix the possible problems related to this solution


    akonkin
    • Features: Ad Hoc Version: v4.7 Product: JasperReports® Server

    Opening an Ad Hoc View via a URL

    In this article we will try to open an Ad Hoc View, via a URL, in Ad Hoc Designer.  We will also discuss some problems that could arise during the implementation of this solution, try to explain their source and how to fix them.

    As we know the Ad Hoc feature of JasperReports Server was significantly changed since v4.7. In this article we will use the sample Ad Hoc View that is supplied with each version of the software distribution:  /public/audit/reports/Audit_Report_AdhocDataView.

    To open this Ad Hoc View that is stored in the /public folder in Ad Hoc View desiger as superuser we should use the following URL:

    http://localhost:8080/jasperserver-pro/flow.html?_flowId=adhocFlow&resource=%2Fpublic%2Faudit%2Freports%2FAudit_Report_AdhocDataView&ParentFolderUri=%2Fpublic%2Faudit%2Freports&j_username=superuser&j_password=superuser

    This part of the scenario works fine.

    If we try to open, with this approach, an Ad Hoc report or report Unit that is not an Ad Hoc View, we should get the error that I quote below:

    The selected report is not an Ad Hoc report. Regular report units are not supported.

    The message informs us that we opened a resource of an incorrect type with a feature that the server doesn’t know how to process. That is also clear.

    In the last part of this article I would like to discuss an additional reason of appearance of the error message that I mention above, its explanation and approach that could allow you to fix it.

    Below I quote the url that caused it:

    http://localhost:8080/jasperserver-pro/flow.html?_flowId=adhocFlow&resource=%2Forganizations%2Forg1%2Forganizations%2ForgDemo%2Fadhoc%2FAd_Hoc_View&theme=embed&j_username=demouser|orgDemo&j_password=demo

    Form this URL we see that:

    • our Ad Hoc View is stored in the folder (from the superuser point of view, an absolute path):  /organizations/org1/organizations/orgDemo/adhoc/Ad_Hoc_View

    • this folder belongs to the sub-organization:  organization_1->org1->orgDemo.

    in the url were used the credentials of the user that belongs to this sub-organization

    Let's discuss this situation in the context of the initial conditions that I listed above:

    We have the structure of sub-organizations:  organization_1->org1->orgDemo. We also have a user that belongs to orgDemo.

    Each organization has built-in accounts so, in my explanation, I will use jasperadmin account from orgDemo.

    Let's try to log in under jasperadmin account to orgDemo and check the path to the adhoc folder and Ad Hoc View that is stored in it. In my environment it is:  /adhoc_1/Audit_Report_AdhocDataView.

    This is because the structure of all the folders starting from organization_1 are not visible for a user in the sub-organization. In orgDemo you should be able to see the path: /adhoc/Audit_Report_AdhocDataView.

    I have successfully executed this Ad Hoc View, Audit_Report_AdhocDataView, in this folder via the URL string. This view should also be present in your environment in the folder /public/audit/reports/Audit_Report_AdhocDataView.

    Below I quote the URL string that should be used in case of sub-organizations and a user that belongs to this sub-organization:

    http://localhost:8080/jasperserver-pro/flow.html?_flowId=adhocFlow&resource=%2Fadhoc_1%2FAudit_Report_AdhocDataView&ParentFolderUri=%2Fadhoc_1%2F&j_username=jasperadmin|organization_1&j_password=jasperadmin


    Conclusion:

    The error that I describe above was caused by the fact that the full path to the resource (this is visible only to superuser) was used in the sub-organization instead of the path that is visible to the users in this sub-organization.

    In the context of the sub-organization please use the path to the resource that is visible to the users inside this sub-organization.

    To detect the path inside sub-organization you can login as its user and right click on the resource and then select

    Properties item from the context menu.

    The full path to resource inside suborganization should be shown.

     


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...