dstevens_2 Posted February 7, 2018 Share Posted February 7, 2018 HelloI am trying to create a modified version of the "Recently Viewed" report that is on the default Jaspersoft Home Page.My goal is to generate a poor-man's version of a Favorites table, that displays the top 10 report objects (dashboards, ad hocs or reports) that have been viewed over the past 30 days (as opposed to the last 10 viewed with no date-range aggregation).What would be really awesome: Is there a way to access the extant Recently Viewed table on the Home Page, and modify its date ranges?If I must continue down the less preferable path of building a custom table:What i have so far:An enhanced Audit domain that pulls in fields from public_jiResource, public_jiResourceFolder, and public_AuditEventA table in a studio-generated reportThe table displays jiResource.Label, sorted descending by COUNT(jiAuditEvent.ID) for event_date BETWEEN MONTH and DAYA java.lang.String variable that gives a (hard coded) report or adhoc URL depending on if jiAuditEvent.resource_type is AdhocDataView or ReportUnit:<variable name="Var_hyperlink" class="java.lang.String" resetType="Group" resetGroup="Group_ResourceID"> <variableExpression><![CDATA[iF($F{public_jiauditevent.resource_type}.equals("ReportUnit"), "http://ddevrpt:8080/jasperserver-pro/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2FUser_Content%2FDharol%2FDashboards%2FProductionVariance&reportUnit=%2FUser_Content%2FDharol%2FDashboards%2FProductionVariance%2FProduction_Variance_Time_Series&standAlone=true",IF($F{public_jiauditevent.resource_type}.equals("AdhocDataView"), "http://ddevrpt:8080/jasperserver-pro/flow.html?_flowId=adhocFlow&resource=%2Fpublic%2Faudit%2Freports%2FAudit_Report_AdhocDataView&ParentFolderUri=%2Fpublic%2Faudit%2Freports", "D"))]]></variableExpression>[/code]A reference hyperlink using ${Var_hyperlink} that works for my hard-coded URLs: <jr:cell style="Table 3_CH" height="30" rowSpan="1"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <textField hyperlinkType="Reference" hyperlinkTarget="Blank"> <reportElement x="0" y="0" width="100" height="30" uuid="8e0205ca-0254-47c8-80e6-723dea64e5b0"/> <textFieldExpression><![CDATA[$F{Resource_DerivedTable.resourcelabel}]]></textFieldExpression> <hyperlinkReferenceExpression><![CDATA[$V{Var_hyperlink}]]></hyperlinkReferenceExpression> <hyperlinkTooltipExpression><![CDATA[$F{Resource_DerivedTable.description}]]></hyperlinkTooltipExpression> </textField> </jr:cell>[/code]My Question:I don't know how to dynamically construct the URL for the Adhocs/Reports.I have the various resource attributes in my Audit Domain, but don't know a way other than incredibly tedious parsing of the attributes and then compiling them into the URL.Is there some Web Util function I can use?Possibly something like: public static final java.lang.String PROPERTY_REPORT_EXECUTION_PATHI have very little experience with java.My admin is also not super friendly about changing config files, if this is relevant to your proposed solution.Could someone give me the syntax I would use in my $V{var_hyperlink}? What are the inputs of the REPORT_EXECUTION_PATH, if this is a possible solution.Many thanks! Link to comment Share on other sites More sharing options...
elizam Posted February 7, 2018 Share Posted February 7, 2018 In general, I think modifying the home page is really hard. Before you go too far down that route, make sure you can hide the extent Recently Viewed report and replace it with a dummy report. 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