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

ktalarico

Members
  • Posts

    77
  • Joined

  • Last visited

  • Days Won

    1

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Posts posted by ktalarico

  1. I solved this issue using this post:  https://community.jaspersoft.com/knowledgebase/how-to/accessing-jsqueryjs-custom-ui-pages-starting-jasperreports-server-v800/

    Starting with JasperReports® Server v8.0.0 the libraries used by JasperReports® Server will not be exposed to the global scope. 

    We are using jquery in the javascript accessed by the CVC.  Therefore, jquery needed to be installed in the scripts directory on the server.  Then needed to add this script tag to decoratorMinimalImports.jsp file:

    <script src="${pageContext.request.contextPath}/scripts/jquery.js"></script>

    • Like 1
  2. We have a CVC that stopped working after installing on Jasper 8.2 server.  The CVC is a Google Map with clustered markers. There is very little feedback to diagnose the condition other than the "Report render error".  Nothing in the logs or developer console.  I have a feeling there may be a missing configuration.  I have installed Chromium on the server and set the chrome path in js.config.properties.  When I try to run it in Studio it fails with net.sf.jasperreports.engine.jrruntimeexception: java.util.concurrent.timeoutexception.  Tried setting the chrome timeout to 2 minutes.  I know it's a not a database timeout because I can fetch the data fairly quickly in the SQL dialog.

    Any thoughts?

    clusteredmap.js main_jrxml

  3. Solution provided by Tibco support:

    Our engineering team investigated this and says that the issue seems to be caused by some strange behavior in require.js.  They say that the issue can be fixed by adding the module name in dashboardHyperlinkHandlerUpdateDashboardParams.js like this: replace define(function(require) {with define("dashboardHyperlinkHandlerUpdateDashboardParams", function(require) {

  4. We are using a custom dashboard hyperlink handler taken from here:  https://community.jaspersoft.com/wiki/how-use-custom-hyperlink-handler-dashboard-tibco-jasperreports-server

    After upgrading to 7.2, we are getting the following error in the browser console and the dashboard fails to load:

    Error: Mismatched anonymous define() module: function(require)

    I have consulted https://requirejs.org/docs/errors.html#mismatch and I feel like I followed the solution but it did not help.

    The problem seems to be related to the order in which javascript modules are being loaded.

    The error does not happen consistently.  I can execute dashboards several times in a row without error before it happens.

    I understand that RequireJS is a JavaScript file and module loader, but I know very little about javascript; so any suggestions for the layperson are welcome.

    The custom handler code is below.

    //define(function(require) {define(["require","jquery", "underscore"], function(require) {    "use strict";     var $ = require("jquery"),        _ = require("underscore");     return {        events: {            click: function(event, linkData) {                if (window.location.href.indexOf("dashboard/viewer") > -1) {                    var hashParts = window.location.hash.split("&"),                        reportUri = hashParts[0],                        params = {};                     for (var i = 1; i < hashParts.length; i++) {                        if (hashParts[i].indexOf("=") > 0) {                            var key = hashParts[i].split("=")[0],                                value = hashParts[i].split("=")[1];                             if (key in params) {                                params[key].push(value);                            } else {                                params[key] = [value];                            }                        }                    }                    location.replace(reportUri + "&" + $.param(_.extend(params, linkData.parameters), true));                }            }        }    }});

     

  5. Due to recent changes in Google Maps API, you now must provide API key with your call to the API.  Keep in mind there are two API: the Javascript API and the Maps Static API (which is need to export Google map to format such as PDF or Excel).  Your key must be valid for both.  I have just recently run into same problem with exporting the map.  I have provided my API key to the call to the Javascript API so my map displays in browser fine but export fails.  I do not know where in Jasper code the call to the Maps Static API is.  I have tried putting key in the jrxml file but was unsuccessful. 

     

    Have you solved your problem as of yet?  If so, I would love to know solution.

  6. FWIW, I know I can create a parameter with an expression that makes an API call to get information about a report unit.  For example, com.jaspersoft.jasperserver.api.engine.jasperreports.util.RepositoryUtil.getThreadRepositoryContext().getReportUnit().getName().  I have searched to no avail for an API call that gets information about a dashboard.

  7. I need a way to determine the resource path of a dashboard from within a jasper report.  I want to use that as a parameter to set the data source of the underlying reports conditionally.  Here is the use case:

    We have multiple tenants in our Jasper server repository.  We have copies of a single dashboard living in each tenant organization.  The dashlets/reports that run inside the dashboard live in the shared "public" area.  This is so that we do not have to deploy each report to multiple organizations.  The data source of the reports is dynamic - we are using organization-level attribute to set the data source.  This works if the user running the dashboard belongs to an organization.  For our internal users, who live at the root level, this does not work because we can of course only set one attribute for the datasource at the root level.  So, if the datasource attribute is set to ABC_CORP on the root organization, and the internal user goes to run the dashboard in the XYZ_CORP organization, the dashboard will run with ABC_CORPs data.  So I need to be able to extract the organization name from the dashboard's URI and store that in a parameter so I can set the datasource accordingly in my jasper report jrxml using the "com.jaspersoft.jrs.data.source" property.  The only thing attached to the organization is the dashboard itself.

  8. The wiki article is for users using JasperReports (JR) library to produce maps in their own application to make the modification.

     

    JaserReports Server (JRS)  6.0 uses optimized script from ....webappsjasperserver-prooptimized-scripts directory.

     

    You will need to modify those script file from the following location:

     

    ....twebappsjasperserver-proscriptsbower_componentsbi-reportsrcbireportjivejrjasperreports-map.js

     

    and optimize the scripts to have the protocol corrected.

     

    For your information, starting in JasperReports Server (JRS) version 5.6, JavaScripts used in JRS have been optimized to improve performance. If making customizations to any JavaScript files, users need to download the optimization tools, optimize the files and restart JasperReports Server. This process is described in JasperReports Server Ultimate Guide 5.6, section 9.2.3 “Customizing JavaScript Files”. Users must regenerate the entire JavaScript in <webapp>/optimized-scripts directory. Before going through this time consuming process, user can test the script in JasperReports Server web UI using the following parameter in the URL:

     

    &_opt=false

     

    This setting will affect all JRS web UIs for the current session and can be set in any web UI page.

  9. index(29).png.c376c14ae15f09992386c898053b3b4d.png

    In the above chart, each column represents a factory.  Sometimes factories serve multiple brands.  For example, ADO can serve Brand A or Brand B.  I want each factory's column to be stacked by Brand.

    I saw this post but it is not quite what I want:

    http://community.jaspersoft.com/wiki/sample-html5-column-stacked-and-grouped-chart

    <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.0.1.final using JasperReports Library version 6.0.0  --><!-- 2016-11-01T12:18:39 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"              xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports                                  http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Factory Output"              pageWidth="750"              pageHeight="550"              orientation="Landscape"              whenNoDataType="NoDataSection" columnWidth="750" leftMargin="0"              rightMargin="0" topMargin="0" bottomMargin="0"              uuid="062bc899-90c7-46f6-90f4-b74e6d88bb20">    <property name="ireport.zoom" value="1.0"/>    <property name="ireport.x" value="0"/>    <property name="ireport.y" value="108"/>    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="staging"/>    <property name="ireport.jasperserver.url" value="http://192.168.6.18:8080/valmarc-system/"/>     <property name="ireport.jasperserver.report.resource"              value="/organizations/Converse_Factories/organizations/Footwear/Dashboards/Dashboard_Resources/Dashboard___Factory_Output_Report_Test_files/Dashboard___Factory_Output_Report_Test_"/>     <property name="ireport.jasperserver.reportUnit"             value="/organizations/Converse_Factories/organizations/Footwear/Dashboards/Dashboard_Resources/Dashboard___Factory_Output_Report_Test"/>    <property name="com.jaspersoft.studio.unit." value="pixel"/>    <property name="ireport.jasperserver.user" value="superuser"/>    <style name="Title" fontName="Arial" fontSize="32" isBold="true" pdfFontName="Times-Bold"/>    <style name="Column header" mode="Opaque" forecolor="#FFFFFF"           backcolor="#517BB2" vAlign="Middle" fontName="Arial" fontSize="10"           isBold="true" isItalic="false">        <box leftPadding="2" rightPadding="2"/>    </style>    <style name="Detail" vAlign="Middle" fontName="Arial" fontSize="12">        <box leftPadding="2" rightPadding="2"/>    </style>    <style name="Row" mode="Transparent" vAlign="Middle" fontSize="12">        <conditionalStyle>            <conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>            <style mode="Opaque" backcolor="#CFD8E7"/>        </conditionalStyle>    </style>    <style name="Footer" forecolor="#000000" backcolor="#FFFFFF">        <box>            <pen lineColor="#CFD8E7"/>            <topPen lineWidth="2.0" lineColor="#CFD8E7"/>            <leftPen lineColor="#CFD8E7"/>            <bottomPen lineColor="#CFD8E7"/>            <rightPen lineColor="#CFD8E7"/>        </box>    </style>    <parameter name="FACTORY_CD" class="java.util.Collection"/>    <parameter name="FACTORY_CD_CSV" class="java.lang.String" isForPrompting="false">        <defaultValueExpression><![CDATA[com.valmarc.jasper.Utils.joinCSV($P{FACTORY_CD})]]></defaultValueExpression>    </parameter>    <parameter name="FACTORY_PO" class="java.lang.String" isForPrompting="false">        <defaultValueExpression><![CDATA[""]]></defaultValueExpression>    </parameter>    <parameter name="LoggedInUserAttribute_factory_cd" class="java.lang.String"/>    <parameter name="LoggedInUserAttribute_brand_id" class="java.lang.String"/>    <parameter name="YEAR_MONTH" class="java.util.Collection">        <parameterDescription><![CDATA[]]></parameterDescription>    </parameter>    <parameter name="YEAR_MONTH_CSV" class="java.lang.String">        <defaultValueExpression><![CDATA[com.valmarc.jasper.Utils.joinCSV($P{YEAR_MONTH})]]></defaultValueExpression>    </parameter>    <parameter name="style" class="java.lang.String">        <defaultValueExpression><![CDATA[""]]></defaultValueExpression>    </parameter>    <parameter name="GAC_END_DATE" class="java.util.Date" isForPrompting="false"/>    <parameter name="GAC_BEGIN_DATE" class="java.util.Date" isForPrompting="false"/>    <parameter name="BRAND_ID" class="java.util.Collection"/>    <parameter name="BRAND_ID_CSV" class="java.lang.String" isForPrompting="false">        <defaultValueExpression><![CDATA[com.valmarc.jasper.Utils.joinCSV($P{BRAND_ID})]]></defaultValueExpression>    </parameter>    <parameter name="COUNTRY_ID" class="java.util.Collection"/>    <parameter name="COUNTRY_ID_CSV" class="java.lang.String">        <defaultValueExpression>            <![CDATA[com.valmarc.jasper.Utils.joinCSV($P{COUNTRY_ID})]]>        </defaultValueExpression>    </parameter>    <parameter name="STYLE_DESC" class="java.lang.String">        <defaultValueExpression><![CDATA[""]]></defaultValueExpression>    </parameter>    <parameter name="YEAR_MONTH_ORIG" class="java.util.Collection">        <defaultValueExpression><![CDATA[""]]></defaultValueExpression>    </parameter>    <queryString language="plsql">        <![CDATA[{call rpt_ft_dashboard_output_chrt                  ($P{ORACLE_REF_CURSOR}, $P{LoggedInUserAttribute_factory_cd},                  $P{LoggedInUserAttribute_brand_id}, $P{FACTORY_CD_CSV},                  $P{BRAND_ID_CSV}, $P{YEAR_MONTH_CSV}, $P{style}, $P{STYLE_DESC},                  $P{FACTORY_PO}, $P{COUNTRY_ID_CSV}, $P{GAC_BEGIN_DATE},                  $P{GAC_END_DATE})}]]>    </queryString>    <field name="BRAND_NAME" class="java.lang.String">        <fieldDescription><![CDATA[]]></fieldDescription>    </field>    <field name="FACTORY_CD" class="java.lang.String">        <fieldDescription><![CDATA[]]></fieldDescription>    </field>    <field name="FACTORY_CD2" class="java.lang.String">        <fieldDescription><![CDATA[]]></fieldDescription>    </field>    <field name="SCAN_DT" class="java.lang.String">        <fieldDescription><![CDATA[]]></fieldDescription>    </field>    <field name="SCAN_COUNT" class="java.math.BigDecimal"/>    <title>        <band height="300" splitType="Stretch">            <property name="local_mesure_unitheight" value="pixel"/>            <property name="com.jaspersoft.studio.unit.height" value="px"/>            <componentElement>               <reportElement stretchType="RelativeToTallestObject"                             x="0" y="35" width="750" height="265"                             uuid="20129c3a-02dd-4684-b7ca-67539c5e009a">                    <property name="local_mesure_unitwidth" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.width" value="px"/>                    <property name="local_mesure_unitheight" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.height" value="px"/>              </reportElement>               <hc:chart xmlns:hc="http://jaspersoft.com/highcharts"                        xsi:schemaLocation="http://jaspersoft.com/highcharts                        http://jaspersoft.com/schema/highcharts.xsd" type="Column"                        evaluationTime="Report">                  <hc:chartSetting name="default">                      <hc:chartProperty name="chart.backgroundColor">                          <hc:propertyExpression><![CDATA["#000000"]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="chart.marginTop">                          <hc:propertyExpression><![CDATA[new Integer(50)]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="chart.spacingLeft">                          <hc:propertyExpression><![CDATA[new Integer(10)]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="chart.spacingRight">                          <hc:propertyExpression><![CDATA[new Integer(10)]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="chart.spacingTop">                          <hc:propertyExpression><![CDATA[new Integer(10)]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="colors">                          <hc:propertyExpression>                              <![CDATA[java.util.Arrays.asList("#C38790","#8CD847","#6D3AC6","#D3BE43","#CA4CC8","#73D78B","#6B6DD2","#DC6E36","#4F2D72","#5E853A","#C14787","#6DC8BA","#C03C48","#A6BFD7","#4C2938","#CAC190","#C590D1","#3D533C","#577BA5","#8A5B33")]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="credits.enabled" value="false"/>                      <hc:chartProperty name="credits.href" value=""/>                      <hc:chartProperty name="credits.text" value=""/>                      <hc:chartProperty name="legend.itemStyle.color">                          <hc:propertyExpression><![CDATA["#FFFFFF"]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="plotOptions.column.pointPadding" value="0"/>                      <hc:chartProperty name="plotOptions.series.connectNulls">                          <hc:propertyExpression><![CDATA[boolean.TRUE]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="plotOptions.series.dataLabels.color">                          <hc:propertyExpression><![CDATA["#FFFFFF"]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="plotOptions.series.dataLabels.enabled">                          <hc:propertyExpression><![CDATA[false]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="title.margin">                          <hc:propertyExpression><![CDATA[new Integer(0)]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="title.style.color" value=""#FFFFFF""/>                      <hc:chartProperty name="title.style.fontSize" value="20px"/>                      <hc:chartProperty name="title.text">                          <hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="title.y">                          <hc:propertyExpression><![CDATA[new Integer(0)]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="tooltip.shared">                          <hc:propertyExpression><![CDATA[boolean.FALSE]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="xAxis.labels.style.color">                          <hc:propertyExpression><![CDATA["#FFFFFF"]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="yAxis.gridLineColor" value=""#000000""/>                      <hc:chartProperty name="yAxis.labels.style.color">                          <hc:propertyExpression><![CDATA["#FFFFFF"]]></hc:propertyExpression>                      </hc:chartProperty>                      <hc:chartProperty name="yAxis.title.text">                          <hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>                      </hc:chartProperty>                  </hc:chartSetting>                  <multiAxisData>                      <multiAxisDataset/>                      <dataAxis axis="Rows">                          <axisLevel name="ScanDate">                              <labelExpression><![CDATA["Factory124Line"]]></labelExpression>                              <axisLevelBucket order="None" class="java.lang.Comparable">                                  <bucketExpression><![CDATA[$F{SCAN_DT}]]></bucketExpression>                              </axisLevelBucket>                          </axisLevel>                      </dataAxis>                      <dataAxis axis="Columns">                          <axisLevel name="Factory">                              <labelExpression><![CDATA[]]></labelExpression>                              <axisLevelBucket order="None" class="java.lang.String">                               <bucketExpression><![CDATA[$F{FACTORY_CD} + " | " + $F{FACTORY_CD2}]]></bucketExpression>                                  <bucketProperty name="Brand"><![CDATA[$F{BRAND_NAME}]]></bucketProperty>                              </axisLevelBucket>                          </axisLevel>                      </dataAxis>                      <multiAxisMeasure name="Scan Count" class="java.lang.Integer" calculation="Nothing">                            <labelExpression><![CDATA[""]]></labelExpression>                            <valueExpression><![CDATA[$F{SCAN_COUNT}]]></valueExpression>                      </multiAxisMeasure>                    </multiAxisData>                    <hc:series name="Scan Count">                        <hc:contributor name="SeriesProperty">                            <hc:contributorProperty name="name" valueType="Bucket" value="Factory"/>                            <hc:contributorProperty name="stack" valueType="Bucket" value="Factory.Brand"/>                        </hc:contributor>                    </hc:series>                </hc:chart>            </componentElement>            <staticText>               <reportElement mode="Opaque" x="0" y="0" width="750"                             height="35" forecolor="#FFFFFF" backcolor="#000000"                             uuid="5eddfe66-a221-4408-800e-5c18aa32d53e">                    <property name="local_mesure_unitwidth" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.width" value="px"/>                    <property name="local_mesure_unitheight" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.height" value="px"/>                </reportElement>                <textElement textAlignment="Center" verticalAlignment="Middle">                    <font fontName="Arial" size="12" pdfFontName="Times-Roman"/>                </textElement>                <text><![CDATA[Factory Scanning Activity By Month]]></text>            </staticText>        </band>    </title>    <noData>        <band height="300">            <property name="local_mesure_unitheight" value="pixel"/>            <property name="com.jaspersoft.studio.unit.height" value="px"/>            <frame>               <reportElement mode="Opaque" x="0" y="35" width="750"                             height="265" backcolor="#000000"                             uuid="a2fa4eea-8711-4c29-aaae-0371c11f3cc0"/>            </frame>            <staticText>              <reportElement mode="Opaque" x="0" y="0" width="750"                             height="35" forecolor="#FFFFFF" backcolor="#000000"                             uuid="76ee818d-2d49-4f8e-b8f4-1f6df4c01d41">                    <property name="local_mesure_unitwidth" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.width" value="px"/>                    <property name="local_mesure_unitheight" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.height" value="px"/>                </reportElement>                <textElement textAlignment="Center" verticalAlignment="Middle">                    <font fontName="Arial" size="12" pdfFontName="Times-Roman"/>                </textElement>                <text><![CDATA[Factory Scanning Activity By Month]]></text>            </staticText>        </band>    </noData></jasperReport>[/code]

    index(29).png.ff6e511275615e2a85628d2dab213e9a.png

  10. I have a row group called question with a bucket expression equal to $F{question} + $F{sort_order}.  I only want to display the text of $F{question}, not $F{sort_order}; so I created a measure called questionmeasure with a value expression equal to $F{question}.  In questionheader, I used questionmeasure in the textfield expression.  It is displaying null.

    Basically, I want to use a measure expression where I would normally use a row group expression.

    Below is jrxml:

    <?xml version="1.0" encoding="UTF-8"?><jasperReportxmlns="http://jasperreports.sourceforge.net/jasperreports"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreportshttp://jasperreports.sourceforge.net/xsd/jasperreport.xsd"name="QuestionnaireResponseSummary" language="groovy" pageWidth="1350"pageHeight="1000" whenNoDataType="NoDataSection" columnWidth="1310"leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"isIgnorePagination="true">    <property name="ireport.zoom" value="1.0"/>    <property name="ireport.x" value="0"/>    <property name="ireport.y" value="0"/>    <property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/>    <style name="Crosstab Data Text" hAlign="Center"/>    <parameter name="START DATE" class="java.util.Date">        <defaultValueExpression><![CDATA[new Date()]]></defaultValueExpression>    </parameter>    <parameter name="END DATE" class="java.util.Date">        <defaultValueExpression><![CDATA[new Date()]]></defaultValueExpression>    </parameter>    <parameter name="KIOSK GROUP" class="java.util.List">        <property name="parameter_type" value="multiselect"/>      <property name="query" value="select distinct name from (selectkg.name from kiosk_group kg union select string_value fromsrv_instance_context_variable_map where property='kioskGroup')t where name not ilike'ZZ%'order by name"/>        <defaultValueExpression><![CDATA[java.util.Arrays.asList(new String[" "])]]></defaultValueExpression>    </parameter>    <parameter name="QUESTIONNAIRE NAME" class="java.lang.String">        <property name="parameter_type" value="select"/>      <property name="query" value="select distinct sd.display_name asdisplayName from srv_survey_definition sd where sd.active = true orderby sd.display_name"/>        <parameterDescription><![CDATA[]]></parameterDescription>        <defaultValueExpression><![CDATA[]]></defaultValueExpression>    </parameter>    <queryString>        <![CDATA[with recursive survey_items(sort_order,kioskgroup,response_id,item_id,item_subclass,question)as (        select        ARRAY[nde.page_indx,itm.survey_item_indx] as sort_order,        sicm.string_value,        resp.id,        itm.id,        itm.subclass,        sltm.language_map_element::text as question        from srv_survey_item itm         join srv_transition_node nde on nde.id = itm.page_id         join srv_survey_definition sd on sd.id = nde.survey_definition_id         join srv_survey_response resp on resp.active_survey_definition_id = sd.id and resp.start_survey_date is not null         join srv_survey_instance ssi on (ssi.survey_response_id = resp.id )         join srv_instance_context_variable_map sicm on (sicm.survey_instance_id = ssi.id and sicm.property like 'kioskGroup')         join srv_language_text slt on slt.id = itm.main_text         join srv_language_text_language_map sltm on sltm.srv_language_text_id = slt.id         where itm.subclass <> 'DESCRIPTIVE_TEXT'       and resp.start_survey_date between to_timestamp($P{STARTDATE},'YYYY-MM-DD') and (to_timestamp($P{END DATE}, 'YYYY-MM-DD') +interval '1 day' )         and resp.start_survey_date is not null       and split_part(sd.survey_name,'_OUTDATED',1) IN (select survey_namefrom srv_survey_definition def where def.display_name = $P{QUESTIONNAIRENAME})         and $X{IN, sicm.string_value,KIOSK GROUP}         and sicm.string_value not ilike 'ZZ%'         and resp.id not in(           select ssr.id           from  srv_survey_response ssr           join srv_survey_instance si1 on ssr.id = si1.survey_response_id           where (si1.exit_type is null and ssr.completed =false))    union        select            sort_order || coalesce(itm.survey_item_indx,0) || coalesce(itm.group_idx,0) || coalesce(itm.group_question_idx,0),            si.kioskgroup,            si.response_id,            itm.id,            itm.subclass,            question ||  E'n' || sltm.language_map_element::text        from            srv_survey_item itm            join survey_items si on itm.item_group_id = si.item_id or itm.question_group_id = si.item_id            join srv_language_text slt on slt.id = itm.main_text            join srv_language_text_language_map sltm on sltm.srv_language_text_id = slt.id),survey_responses as(selectsi.sort_order,si.kioskgroup,si.response_id,si.item_id,si.item_subclass,si.question,case when si.item_subclass='QUESTION_MULTIPLE_CHOICE' then sltm.language_map_element     when si.item_subclass='QUESTION_MATRIX' then sltm.language_map_element || ' : ' || sltm2.language_map_element     when si.item_subclass in ('QUESTION_TEXT','QUESTION_DATE') then 'n/a' end as choice,CASE when si.item_subclass='QUESTION_MULTIPLE_CHOICE' then        (select count(*) from srv_survey_answer ans         join srv_multiple_choice_answer_choice_join mChoice on ans.id = mChoice.matrix_part_answer_id         where ans.question = si.item_id and mChoice.choice_id=slt.id and ans.response_id=si.response_id)     when si.item_subclass='QUESTION_MATRIX' then        (select count(*) from srv_survey_answer ans         join srv_survey_answer_part_answers pa on pa.srv_survey_answer_id = ans.id         join srv_survey_answer partans on pa.part_answers_id = partans.id         join srv_multiple_choice_answer_choice_join mChoice on partans.id = mChoice.matrix_part_answer_id       where ans.question = si.item_id  and mChoice.choice_id=slt2.id andpartans.matrix_part=slt.id and ans.response_id=si.response_id)     when si.item_subclass = 'QUESTION_TEXT' then        (select count(*) from srv_survey_answer ans where ans.question = si.item_id and ans.response_id = si.response_id         and ans.value is not null and ans.value <> '')     when si.item_subclass = 'QUESTION_DATE' then        (select count(*) from srv_survey_answer ans where ans.question = si.item_id and ans.response_id = si.response_id         and ans.date_value is not null)     end as num_chosen,slt.choice_indx as multiple_choice_sort,slt.part_indx as matrix_part_sort,slt2.choice_indx as matrix_choice_sort from survey_items sileft join srv_language_text slt onCASE when si.item_subclass='QUESTION_MULTIPLE_CHOICE' then slt.multiple_choice_question_id = si.item_id      when si.item_subclass='QUESTION_MATRIX' then slt.matrix_question_id = si.item_id endleft join srv_language_text_language_map sltm on sltm.srv_language_text_id = slt.id--This extra join is so we can combine each matrix part with each choiceleft join srv_language_text slt2 on slt.matrix_question_id = slt2.multiple_choice_question_idleft join srv_language_text_language_map sltm2 on slt2.id = sltm2.srv_language_text_idwhere si.item_subclass not in ('SURVEY_ITEM_GROUP','QUESTION_GROUP')order by sort_order, multiple_choice_sort, matrix_part_sort, matrix_choice_sort)selectsort_order,multiple_choice_sort,matrix_part_sort,matrix_choice_sort,question,choice,kioskgroup,count (distinct response_id) as num_responses,sum(num_chosen) as num_chosenfrom survey_responsesgroup by sort_order, multiple_choice_sort, matrix_part_sort, matrix_choice_sort, kioskgroup, question, choiceorder by sort_order, multiple_choice_sort, matrix_part_sort, matrix_choice_sort, kioskgroup]]>    </queryString>    <field name="sort_order" class="java.sql.Array"/>    <field name="multiple_choice_sort" class="java.lang.Integer"/>    <field name="matrix_part_sort" class="java.lang.Integer"/>    <field name="matrix_choice_sort" class="java.lang.Integer"/>    <field name="question" class="java.lang.String"/>    <field name="choice" class="java.lang.String"/>    <field name="kioskgroup" class="java.lang.String"/>    <field name="num_responses" class="java.lang.Long"/>    <field name="num_chosen" class="java.math.BigDecimal"/>    <variable name="PercentAnswered" class="java.lang.Double">      <variableExpression><![CDATA[$F{num_chosen} == 0 ||$F{num_responses} == 0 ? 0 :($F{num_chosen}/$F{num_responses})]]></variableExpression>    </variable>    <background>        <band splitType="Stretch"/>    </background>    <title>        <band height="82">            <staticText>                <reportElement x="0" y="0" width="1276" height="36"/>                <textElement textAlignment="Left" verticalAlignment="Middle">                    <font size="24" isBold="true"/>                </textElement>                <text><![CDATA[Questionnaire Response Summary]]></text>            </staticText>            <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">                <reportElement x="0" y="36" width="1276" height="21"/>                <textElement textAlignment="Left" verticalAlignment="Middle">                    <font size="12"/>                </textElement>              <textFieldExpression class="java.lang.String"><![CDATA["Date: "+ new SimpleDateFormat("MM/dd/yyyy").format($P{START DATE}) + " to " +new SimpleDateFormat("MM/dd/yyyy").format($P{ENDDATE})]]></textFieldExpression>            </textField>            <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">                <reportElement x="0" y="57" width="1260" height="25"/>                <box leftPadding="0" bottomPadding="2"/>                <textElement verticalAlignment="Middle">                    <font size="12"/>                </textElement>              <textFieldExpressionclass="java.lang.String"><![CDATA["Questionnaire Name:"+$P{QUESTIONNAIRE NAME}]]></textFieldExpression>            </textField>        </band>    </title>    <pageFooter>        <band height="20">            <textField pattern="MM/dd/yyyy h.mm a" isBlankWhenNull="true">                <reportElement x="0" y="0" width="1276" height="20"/>                <textElement verticalAlignment="Middle">                    <font size="10"/>                </textElement>              <textFieldExpression class="java.lang.String"><![CDATA[newSimpleDateFormat("MM/dd/yyyy h:mm a").format(newjava.util.Date())]]></textFieldExpression>            </textField>        </band>    </pageFooter>    <summary>        <band height="320" splitType="Stretch">            <staticText>              <reportElement positionType="Float" mode="Transparent" x="0" y="97"width="1276" height="223" backcolor="#FFFFCC"/>                <textElement>                    <font size="10"/>                </textElement>              <text><![CDATA[Report Overview: Provides _______. Reportexcludes all kiosk groups that start with 'ZZ' or 'zz' .Parameters: Start Date, End Date, Kiosk Group, Questionnaire Name.Data DefinitionsKiosk Group: Kiosk group selected in parameters.Questionnaire Name: Name of questionnaire selected in parameters.Question:Answer:Number Chosen out of Total Number of Responses:%Answered:]]></text>            </staticText>            <crosstab>                <reportElement x="0" y="0" width="1310" height="320"/>                <crosstabDataset isDataPreSorted="true"/>                <rowGroup name="question" width="70">                    <bucket>                      <bucketExpressionclass="java.lang.String"><![CDATA[$F{question} +$F{sort_order}]]></bucketExpression>                    </bucket>                    <crosstabRowHeader>                        <cellContents backcolor="#F0F8FF" mode="Opaque">                            <box>                                <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>                            </box>                            <textField isStretchWithOverflow="true">                              <reportElement style="Crosstab Data Text"stretchType="RelativeToTallestObject" x="0" y="0" width="70"height="25"/>                                <textElement/>                              <textFieldExpressionclass="java.lang.String"><![CDATA[$V{questionmeasure}]]></textFieldExpression>                            </textField>                        </cellContents>                    </crosstabRowHeader>                    <crosstabTotalRowHeader>                        <cellContents/>                    </crosstabTotalRowHeader>                </rowGroup>                <rowGroup name="choice" width="100">                    <bucket>                        <bucketExpression class="java.lang.String"><![CDATA[$F{choice}]]></bucketExpression>                    </bucket>                    <crosstabRowHeader>                        <cellContents>                            <textField>                                <reportElement style="Crosstab Data Text" x="0" y="0" width="100" height="25"/>                                <textElement/>                              <textFieldExpressionclass="java.lang.String"><![CDATA[$V{choice}]]></textFieldExpression>                            </textField>                        </cellContents>                    </crosstabRowHeader>                    <crosstabTotalRowHeader>                        <cellContents/>                    </crosstabTotalRowHeader>                </rowGroup>                <columnGroup name="kioskgroup" height="30" totalPosition="End">                    <bucket>                      <bucketExpressionclass="java.lang.String"><![CDATA[$F{kioskgroup}]]></bucketExpression>                    </bucket>                    <crosstabColumnHeader>                        <cellContents backcolor="#F0F8FF" mode="Opaque">                            <box>                                <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>                            </box>                            <textField>                                <reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="30"/>                                <textElement/>                              <textFieldExpressionclass="java.lang.String"><![CDATA[$V{kioskgroup}]]></textFieldExpression>                            </textField>                        </cellContents>                    </crosstabColumnHeader>                    <crosstabTotalColumnHeader>                        <cellContents backcolor="#BFE1FF" mode="Opaque">                            <box>                                <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>                            </box>                            <staticText>                                <reportElement x="0" y="0" width="50" height="30"/>                                <textElement textAlignment="Center" verticalAlignment="Middle"/>                                <text><![CDATA[Total kioskgroup]]></text>                            </staticText>                        </cellContents>                    </crosstabTotalColumnHeader>                </columnGroup>                <measure name="num_chosenMeasure" class="java.math.BigDecimal" calculation="Sum">                    <measureExpression><![CDATA[$F{num_chosen}]]></measureExpression>                </measure>                <measure name="questionmeasure" class="java.lang.String">                    <measureExpression><![CDATA[$F{question}]]></measureExpression>                </measure>                <crosstabCell width="50" height="25">                    <cellContents>                        <box>                            <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>                        </box>                        <textField>                            <reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>                            <textElement/>                          <textFieldExpressionclass="java.math.BigDecimal"><![CDATA[$V{num_chosenMeasure}]]></textFieldExpression>                        </textField>                    </cellContents>                </crosstabCell>                <crosstabCell height="25" rowTotalGroup="question">                    <cellContents backcolor="#BFE1FF" mode="Opaque">                        <box>                            <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>                        </box>                        <textField>                            <reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>                            <textElement/>                          <textFieldExpressionclass="java.math.BigDecimal"><![CDATA[$V{num_chosenMeasure}]]></textFieldExpression>                        </textField>                    </cellContents>                </crosstabCell>                <crosstabCell width="50" columnTotalGroup="kioskgroup">                    <cellContents backcolor="#BFE1FF" mode="Opaque">                        <box>                            <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>                        </box>                        <textField>                            <reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>                            <textElement/>                          <textFieldExpressionclass="java.math.BigDecimal"><![CDATA[$V{num_chosenMeasure}]]></textFieldExpression>                        </textField>                    </cellContents>                </crosstabCell>                <crosstabCell rowTotalGroup="question" columnTotalGroup="kioskgroup">                    <cellContents backcolor="#BFE1FF" mode="Opaque">                        <box>                            <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>                        </box>                        <textField>                            <reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>                            <textElement/>                          <textFieldExpressionclass="java.math.BigDecimal"><![CDATA[$V{num_chosenMeasure}]]></textFieldExpression>                        </textField>                    </cellContents>                </crosstabCell>                <crosstabCell rowTotalGroup="choice">                    <cellContents/>                </crosstabCell>                <crosstabCell rowTotalGroup="choice" columnTotalGroup="kioskgroup">                    <cellContents/>                </crosstabCell>            </crosstab>        </band>    </summary>    <noData>        <band height="406">            <staticText>                <reportElement x="0" y="136" width="1276" height="20"/>                <box>                    <topPen lineWidth="1.0"/>                    <leftPen lineWidth="1.0"/>                    <bottomPen lineWidth="1.0"/>                    <rightPen lineWidth="1.0"/>                </box>                <textElement textAlignment="Center" verticalAlignment="Middle">                    <font size="12" isBold="false"/>                </textElement>                <text><![CDATA[No Records Found]]></text>            </staticText>            <staticText>                <reportElement x="0" y="10" width="1276" height="36"/>                <textElement textAlignment="Left" verticalAlignment="Middle">                    <font size="24" isBold="true"/>                </textElement>                <text><![CDATA[Questionnaire Response Summary]]></text>            </staticText>            <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">                <reportElement x="0" y="46" width="1276" height="20"/>                <textElement textAlignment="Left" verticalAlignment="Middle">                    <font size="12"/>                </textElement>              <textFieldExpression class="java.lang.String"><![CDATA["Date: "+ new SimpleDateFormat("MM/dd/yyyy").format($P{START DATE}) + " to " +new SimpleDateFormat("MM/dd/yyyy").format($P{ENDDATE})]]></textFieldExpression>            </textField>            <staticText>              <reportElement positionType="Float" mode="Transparent" x="0" y="156"width="1276" height="230" backcolor="#FFFFCC"/>                <textElement>                    <font size="10"/>                </textElement>              <text><![CDATA[Report Overview: Provides metrics on initiatedand completed questionnaires. Report excludes all kiosk groups thatstart with 'ZZ' or 'zz'.Parameters: Start Date, End Date, Kiosk Group, Questionnaire Name, Length of Time.Data DefinitionsKiosk Group: Kiosk group selected in parameters.Questionnaire Name: Name of questionnaire selected in parameters.Questionnaires Started: Number of times questionnaire  is started.PatientsStarted: For sign-in survey, number of unique patients who started atleast one questionnaire. For non-sign-in and anonymous survey, number oftimes questionnaire is started.Questionnaires Completed: Number of times Questionnaire is completed.PatientsCompleted: For sign-in survey, number of unique patients who completedat least one questionnaire. For non-sign-in and anonymous survey, numberof times questionnaire is completed.% Completed Questionnaires: Number of completed questionnaires divided by started questionnaires.CompletedQuestionnaires Average Time: For completed questionnaires, total timespent on questionnaires divided by number of completed questionnaires.AbandonedQuestionnaires Average Time: For questionnaires started but notcompleted, total time spent on questionnaires divided by number ofquestionnaires that were started but not completed.AllQuestionnaires Average Time: For all questionnaires that were started,total time spent on questionnaires divided by number of startedquestionnaires.]]></text>            </staticText>            <textField pattern="MM/dd/yyyy h.mm a" isBlankWhenNull="true">                <reportElement x="0" y="386" width="1276" height="20"/>                <textElement verticalAlignment="Middle">                    <font size="10"/>                </textElement>              <textFieldExpression class="java.lang.String"><![CDATA[newSimpleDateFormat("MM/dd/yyyy h:mm a").format(newjava.util.Date())]]></textFieldExpression>            </textField>            <staticText>                <reportElement stretchType="RelativeToBandHeight" x="565" y="66" width="215" height="30"/>                <box bottomPadding="2" rightPadding="2">                    <topPen lineWidth="1.0"/>                    <leftPen lineWidth="1.0"/>                    <bottomPen lineWidth="1.0"/>                    <rightPen lineWidth="1.0"/>                </box>                <textElement textAlignment="Center" verticalAlignment="Bottom">                    <font size="12" isBold="true"/>                </textElement>                <text><![CDATA[Completed]]></text>            </staticText>            <staticText>                <reportElement stretchType="RelativeToBandHeight" x="0" y="66" width="150" height="70"/>                <box leftPadding="2" bottomPadding="2">                    <topPen lineWidth="1.0"/>                    <leftPen lineWidth="1.0"/>                    <bottomPen lineWidth="1.0"/>                    <rightPen lineWidth="1.0"/>                </box>                <textElement textAlignment="Left" verticalAlignment="Bottom">                    <font size="12" isBold="true"/>                </textElement>                <text><![CDATA[Kiosk Group]]></text>            </staticText>            <staticText>                <reportElement x="565" y="96" width="125" height="40"/>                <box bottomPadding="2" rightPadding="2">                    <topPen lineWidth="1.0"/>                    <leftPen lineWidth="1.0"/>                    <bottomPen lineWidth="1.0"/>                    <rightPen lineWidth="1.0"/>                </box>                <textElement textAlignment="Right" verticalAlignment="Bottom">                    <font size="12" isBold="true"/>                </textElement>                <text><![CDATA[Questionnaires]]></text>            </staticText>            <staticText>                <reportElement stretchType="RelativeToBandHeight" x="350" y="66" width="215" height="30"/>                <box bottomPadding="2" rightPadding="2">                    <topPen lineWidth="1.0"/>                    <leftPen lineWidth="1.0"/>                    <bottomPen lineWidth="1.0"/>                    <rightPen lineWidth="1.0"/>                </box>                <textElement textAlignment="Center" verticalAlignment="Bottom">                    <font size="12" isBold="true"/>                </textElement>                <text><![CDATA[started]]></text>            </staticText>            <staticText>                <reportElement stretchType="RelativeToBandHeight" x="150" y="66" width="200" height="70"/>                <box leftPadding="2" bottomPadding="2">                    <topPen lineWidth="1.0"/>                    <leftPen lineWidth="1.0"/>                    <bottomPen lineWidth="1.0"/>                    <rightPen lineWidth="1.0"/>                </box>                <textElement textAlignment="Left" verticalAlignment="Bottom">                    <font size="12" isBold="true"/>                </textElement>                <text><![CDATA[Questionnaire Name]]></text>            </staticText>            <staticText>                <reportElement stretchType="RelativeToBandHeight" x="690" y="96" width="90" height="40"/>                <box bottomPadding="2" rightPadding="2">                    <topPen lineWidth="1.0"/>                    <leftPen lineWidth="1.0"/>                    <bottomPen lineWidth="1.0"/>                    <rightPen lineWidth="1.0"/>                </box>                <textElement textAlignment="Right" verticalAlignment="Bottom">                    <font size="12" isBold="true"/>                </textElement>                <text><![CDATA[Patients]]></text>            </staticText>            <staticText>                <reportElement stretchType="RelativeToBandHeight" x="350" y="96" width="125" height="40"/>                <box bottomPadding="2" rightPadding="2">                    <topPen lineWidth="1.0"/>                    <leftPen lineWidth="1.0"/>                    <bottomPen lineWidth="1.0"/>                    <rightPen lineWidth="1.0"/>                </box>                <textElement textAlignment="Right" verticalAlignment="Bottom">                    <font size="12" isBold="true"/>                </textElement>                <text><![CDATA[Questionnaires]]></text>            </staticText>            <staticText>                <reportElement stretchType="RelativeToBandHeight" x="475" y="96" width="90" height="40"/>                <box bottomPadding="2" rightPadding="2">                    <topPen lineWidth="1.0"/>                    <leftPen lineWidth="1.0"/>                    <bottomPen lineWidth="1.0"/>                    <rightPen lineWidth="1.0"/>                </box>                <textElement textAlignment="Right" verticalAlignment="Bottom">                    <font size="12" isBold="true"/>                </textElement>                <text><![CDATA[Patients]]></text>            </staticText>        </band>    </noData></jasperReport>[/code]
×
×
  • Create New...