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

kmarchewa

Members
  • Posts

    9
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by kmarchewa

  1. Hello, I am trying to install the WAR CE edition of Jasper Reports Server on a Ubuntu machine running Tomcat 9. The install seemed to go okay; however, whenever I attempt to access myhost.com/jasperserver, I always get a 404 NOT FOUND page. I can load the default/ROOT page of the Tomcat install just fine. The JasperServer WAR appears to be correctly installed under /var/lib/tomcat9/webapps/jasperserver. I have not edited the context.xml file. Looking at the logs, I see the following : 2022-04-14T13:51:06,694 ERROR ContextLoader,main:313 - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'themeSource' defined in ServletContext resource [/WEB-INF/applicationContext-themes.xml]: Cannot resolve reference to bean 'themeCache' while setting bean property 'themeCache'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'themeCache' defined in ServletContext resource [/WEB-INF/applicationContext-themes.xml]: Cannot resolve reference to bean 'unsecureRepositoryService' while setting bean property 'repositoryService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateRepositoryService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accessService' defined in ServletContext resource [/WEB-INF/applicationContext-events-logging.xml]: Cannot resolve reference to bean 'auditSessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditSessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'auditDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditDataSource' defined in ServletContext resource [/WEB-INF/applicationContext-webapp.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Could not create resource instance[/code]From the logs, it seems the underlying issue is with the creation of a dataSource bean? The Postgresql driver is in /usr/share/tomcat9/lib and I have not manually edited any of the relevant .xml or .properties file. Not sure what the issue could be? Any assistance is greatly appreciated.
  2. Hello, I am looking installing Jasper Reports CE using the WAR distribution. I am curious if there is a simple way to specify that I would like to use a specific PostgreSQL schema (I assume it will just use public otherwise)? What all configuration changes might be necessary? Thanks.
  3. Hello, I have some data in a PostgreSQL DB that is encrypted using asymmetric encryption. If I were to store the private key on the same server as the Jasper Reports server instance, would there be anyway to use this private key to decrypt the data in the DB before outputting it into a report? What if the private key requires a password?
  4. Greetings all: I have a group in my report called 'empGroup' as well a a variable that resets on this group. <group name="empGroup"> <groupExpression><![CDATA[$F{last_name} + " " + $F{first_name}]]></groupExpression>[/code]and.. <variable name="EmpTotal" class="java.lang.Integer" resetType="Group" resetGroup="empGroup" calculation="Sum"> <variableExpression><![CDATA[$F{sales_count}]]></variableExpression> </variable>[/code] I also have a report level variables that sums over the same field (sales_count). <variable name="ComboTotal" class="java.lang.Integer" calculation="Sum"> <variableExpression><![CDATA[$F{sales_count}]]></variableExpression> </variable>[/code] I am trying to calculate the employee's 'sales_count' (EmpTotal variable) as a percentage of total/overall sales (ComboTotal): that is: sum of employee's sale_count / sum of report wide sale's count. However, I am encountering an issue due to evaluation times. The text field where this value needs to appear is in the empGroup footer. If I set the evaluation time on text field to the group, the 'ComboTotal' value is "not right" (e,g, it is only the sum of groups that have already been evaluated rather than all records in the reports). <textField evaluationTime="Group"> <reportElement x="300" y="36" width="60" height="18" uuid="56fee283-5d93-44b8-9cd7-d017816f21ef"> <property name="net.sf.jasperreports.export.xls.pattern" value="0.00%"/> </reportElement> <textFieldExpression><![CDATA[new BigDecimal($V{EmpTotal}).divide(new BigDecimal($V{ComboTotal}), 2, RoundingMode.HALF_UP)]]></textFieldExpression> </textField>[/code]However, If I set the evaluation time to "Report", the 'ComboValue' sum appears right, but the group variable (EmpTotal) is not (I assume it holds the value of the last group). Is there any way to force the report wide variable (ComboTotal) to calculate early perhaps or some alternate solution that might work? Thanks.
  5. Hello all, I just set up a Jasper Reports server instance today. I used the install script for Linux rather than the WAR distribution. The server is up and running. I can log in and run reports so that they display in HTML form/on the web UI. However, everytime I try and export a report , rather than performing the export or opening a dialog to confirm options, it simply opens the JasperReports login page in a new tab. Looking at the app logs in WEB-INF, I see two errors reoccuring. The first is related to CSRF tokens. 2020-07-01T12:45:53,305 ERROR CsrfGuard,https-jsse-nio-8444-exec-2:45 - potential cross-site request forgery (CSRF) attack thwarted (user:<anonymous>, ip:x.x.x.x, method:POST, uri:/jasperserver/flow.html/flowFile/daily_sale.pdf, error:required token is missing from the request)2020-07-01T12:48:42,219 ERROR CsrfGuard,https-jsse-nio-8444-exec-8:45 - potential cross-site request forgery (CSRF) attack thwarted (user:<anonymous>, ip:x.x.x.x, method:POST, uri:/jasperserver/flow.html/flowFile/daily_sale.pdf, error:required token is missing from the request)[/code]I understand what CSRF tokens are and why they are necessary to secure this application. What I do not understand is why the CSRF tokens are not being properly sent with the requests. The second repeating error I am seeing in the logs is one I am less familar with 2020-07-01T12:42:21,474 ERROR JNDIResourceProvider,data.domain.com-startStop-1:75 - error closing context javax.naming.OperationNotSupportedException: Context is read only at org.apache.naming.NamingContext.checkWritable(NamingContext.java:963) at org.apache.naming.NamingContext.close(NamingContext.java:758) at com.tonbeller.tbutils.res.JNDIResourceProvider.close(JNDIResourceProvider.java:72) at com.tonbeller.tbutils.res.CompositeResourceProvider.close(CompositeResourceProvider.java:56) at com.tonbeller.tbutils.res.ResourcesFactory.initialize(ResourcesFactory.java:163) at com.tonbeller.tbutils.res.ResourcesFactory.<init>(ResourcesFactory.java:92) at com.tonbeller.tbutils.res.ResourcesFactory.<clinit>(ResourcesFactory.java:89) at com.tonbeller.tbutils.res.ResourcesFactoryContextListener.contextInitialized(ResourcesFactoryContextListener.java:23) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4699) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1859) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)[/code]I used the bundled Tomcat app server and modified the config to use HTTPS. Not sure if the modifications could have contributed to the issue, but posting here in case: <Connector port="8049" protocol="AJP/1.3" redirectPort="8449"/> <Connector protocol="HTTP/1.1" port="8081" redirectPort="8444" /> <Connector protocol="HTTP/1.1" port="8444" keystorePass="pass" keystoreFile="certs/cert.p12" scheme="https" secure="true" SSLEnabled="true" maxThreads="150" sslEnabledProtocols="TLSv1.2,TLSv1.2,TLSv1.3" sslProtocol="TLSv1.2" />[/code]I am seeing some JS warnings in my browser console, but nothing that seems to shine light on the issue (a depreciation warning and" Ignoring get or set of property that has [LenientThis] because the “this” object is incorrect."). Any points would be appreciated. I have spent quite a while looking at logs and double checking my configuration, but see nothing that could explain the issue.
  6. Hello all. I am trying to resolve an issue with a Jasper report I am working on. This report uses an SQL query that returns a result of the form: (col_label VARCHAR, plu_nums varchar[], plu_names varchar[])[/code]To simplify working with these Array values, I have created two variables in Jaspersoft Studio: <variable name="pluLength" class="java.lang.Integer"> <variableExpression><![CDATA[$V{pluArray}.length]]></variableExpression> <initialValueExpression><![CDATA[0]]></initialValueExpression> </variable> <variable name="pluArray" class="java.lang.String[]"> <variableExpression><![CDATA[((String[]) ($F{plu_names}.getArray()))]]></variableExpression> </variable>[/code]My detail band is defined (in part) as: <reportElement x="0" y="0" width="50" height="18" uuid="3a44195d-3306-421e-b898-11350bcca596"/> <textFieldExpression><![CDATA[$V{REPORT_COUNT} == 1 ? "Prop " +$F{plu_names}.getArray() : $V{pluLength} ]]></textFieldExpression> </textField> <textField> <reportElement x="50" y="0" width="50" height="18" uuid="53b9e1cc-2726-4f48-93fc-09f5cdaf597f"/> <textFieldExpression><![CDATA[$V{pluLength} >= 1 ? $V{pluArray}[0] : ""]]></textFieldExpression> </textField> <textField> <reportElement x="100" y="0" width="50" height="18" uuid="dfb393eb-4f75-47d3-a1cc-a90bdc954105"/> <textFieldExpression><![CDATA[$V{pluLength} >= 2 ? $V{pluArray}[1] : ""]]></textFieldExpression> </textField> <textField> <reportElement x="150" y="0" width="50" height="18" uuid="86a485d1-f7ee-4aab-bde9-8c6738349f23"/> <textFieldExpression><![CDATA[$V{pluLength} >= 3 ? $V{pluArray}[2] : ""]]></textFieldExpression> </textField>[/code]It works as expected, except for the first row. The array I am attempting to access is null. I had assumed it might have something to with the variable definition/time of evaluation, so tried using definition of "pluArray" (e.g. the casting of "plu_names" field as a String[]), in place of variable itself, but the result was the same. The "col_label" field is populated correctly in the first row, but not "plu_names" Array variable. To clarify, the field is not null in the SQL result itself. I even changed to order to verify this. When the sort order was change, the record that had a null value for the "plu_names" field was now populated (since it was no longer the first row) , and the "plu_names" field in the "new" first row (with the updated sort order) was null even though it had previously been populated. The issue is not with any particular record from the DB, but always the first row in the report. Any advice would be appreciated.
  7. Greetings all: I have created a report, intended for export to spreadsheet format, that utilizes a supreport in the summary section. When exporting to XLS, I noticed the cells/columns for the main report were merged. After experimenting with the report, I discoved the cause was the subreport. If I removed the summary section/subreport, each field appears in its own column as expected. Additionally, if I export the subreport separately, everything is in its proper column to - no merging. It is only when the two reports are combined that the issue occurs. Example when subreport is included (merged - not what I want, Descr should be in A, PLU in B, Breakfast in C, etc) This is how the summary report appears when exported alongside the main report - also with merged cells and starting in Column B. The base width of each field in both the main and summary reports is identical - 60px. Snippet from main report <band height="56"> <property name="com.jaspersoft.studio.unit.height" value="px"/> <textField> <reportElement style="pageFooter" x="0" y="0" width="60" height="56" uuid="466db352-cb97-40be-a05e-e00d93decf96"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="14" isBold="true"/> </textElement> <textFieldExpression><![CDATA["Summary for " + $F{prop_id}]]></textFieldExpression> </textField> <staticText> <reportElement style="pageFooter" x="60" y="0" width="60" height="14" uuid="3b1efc63-23dd-437c-856f-5bbb48c96baf"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[size]]></text> </staticText>[/code]Snippet from subreport: <group name="PropGroup"> <groupExpression><![CDATA[$F{prop_id}]]></groupExpression> <groupHeader> <band height="48"> <textField> <reportElement style="pageFooter" x="0" y="0" width="60" height="48" uuid="48d5010b-8f9c-49bf-a74d-a95de999335e"> <property name="net.sf.jasperreports.export.xls.sheet.name" value="Summary"/> </reportElement> <textElement textAlignment="Left" verticalAlignment="Middle"> <font size="14" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{prop_id}]]></textFieldExpression> </textField> <staticText> <reportElement style="pageFooter" x="60" y="0" width="60" height="16" uuid="e176b300-abae-4451-8227-29c9f324b8a1"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[sM]]></text> </staticText>[/code]The main report contains groups, and each of one of these groups appears on a separate page (by setting "net.sf.jasperreports.export.xls.break.after.row" to true in the footer). The summary section/subreport also appears on a separate page and is defined as follows: <summary> <band height="231"> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="net.sf.jasperreports.export.xls.sheet.name" value="Summary"/> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/> <subreport> <reportElement x="0" y="0" width="480" height="231" uuid="d98acdcd-f5bb-4ed5-aabe-96e57efd014b"> <property name="net.sf.jasperreports.export.xls.sheet.name" value="Summary"/> </reportElement> <parametersMapExpression><![CDATA[new HashMap($P{REPORT_PARAMETERS_MAP})]]></parametersMapExpression> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA["combo_summary.jasper"]]></subreportExpression> </subreport> </band> </summary>[/code] Both the sub and main report have the same width (520) and same column width (480). Any guidance would be appreciated.
  8. Greetings all. I am building a report from a data set with the following fields: <field name="prop_id" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="prop_id"/> <property name="com.jaspersoft.studio.field.tree.path" value="lunch_vm_transaction_view"/> </field> <field name="business_date" class="java.sql.Date"> <property name="com.jaspersoft.studio.field.label" value="business_date"/> <property name="com.jaspersoft.studio.field.tree.path" value="lunch_vm_transaction_view"/> </field> <field name="transaction_date" class="java.sql.Timestamp"> <property name="com.jaspersoft.studio.field.label" value="transaction_date"/> <property name="com.jaspersoft.studio.field.tree.path" value="lunch_vm_transaction_view"/> </field> <field name="sale_hour" class="java.lang.Integer"> <property name="com.jaspersoft.studio.field.label" value="sale_hour"/> <property name="com.jaspersoft.studio.field.tree.path" value="lunch_vm_transaction_view"/> </field> <field name="sale_minute" class="java.lang.Integer"> <property name="com.jaspersoft.studio.field.label" value="sale_minute"/> <property name="com.jaspersoft.studio.field.tree.path" value="lunch_vm_transaction_view"/> </field> <field name="plunum" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="plunum"/> <property name="com.jaspersoft.studio.field.tree.path" value="lunch_vm_transaction_view"/> </field> <field name="count" class="java.lang.Integer"> <property name="com.jaspersoft.studio.field.label" value="count"/> <property name="com.jaspersoft.studio.field.tree.path" value="lunch_vm_transaction_view"/> </field> <field name="cm_type" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="cm_type"/> <property name="com.jaspersoft.studio.field.tree.path" value="lunch_vm_transaction_view"/> </field> <field name="short_name" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="short_name"/> <property name="com.jaspersoft.studio.field.tree.path" value="lunch_vm_transaction_view"/> </field>[/code]I have created two groups based on the prop_id, and cm_type fields. The data is sorted as follows: <queryString> <![CDATA[sELECT * FROM poll.lunch_vm_transaction_view WHEREbusiness_date >= $P{startDate} AND business_date <= $P{endDate}ORDER BY prop_id, cm_type, sale_hour, sale_minute]]> </queryString>[/code]I am attempting to do some grouping/aggregation based on time of day. As such, I have created five variables - IsBreakfast, IsLunch, IsSnack, IsDinner, IsLate - with definitions such as the following "($F{sale_hour} >= 20) ? true : false". In my Detail band, I have the following: <textField> <reportElement x="642" y="0" width="160" height="14" uuid="224bbfe3-69d5-4bab-91b0-67cfc28e0f03"/> <textFieldExpression><![CDATA[$V{isBreakfast} ? "BRKFST" : $V{isLunch} ? "LNCH" : $V{isSnack} ? "SNCK" : $V{isDinner} ? "DNR" : "LT"]]></textFieldExpression> </textField>[/code]In this field, every record is categorized correctly. The issue comes in the summary footers for the Combo and Property groups. In the Combo group for eample, I have the following footer: <groupFooter> <band height="24"> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.grid.JSSGridBagLayout"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> <staticText> <reportElement x="0" y="0" width="101" height="24" uuid="ba5a2d2c-1a08-4202-89df-54f1c121decd"/> <text><![CDATA[Combo Size Totals:]]></text> </staticText> <textField> <reportElement x="101" y="0" width="101" height="24" uuid="6db92494-65f5-446e-a64d-de169779c131"/> </textField> <textField> <reportElement x="202" y="0" width="100" height="24" uuid="2b406783-9886-4e0d-bc00-ebbcc8124450"/> <textFieldExpression><![CDATA[$V{ComboTotalBreakfast}]]></textFieldExpression> </textField> <textField> <reportElement x="302" y="0" width="100" height="24" uuid="d49cde59-9b9b-406b-a567-52f8e434339b"/> <textFieldExpression><![CDATA[$V{ComboTotalLunch}]]></textFieldExpression> </textField> <textField> <reportElement x="402" y="0" width="100" height="24" uuid="029df21b-a3bf-4e8f-9ca3-a11e3d6e9292"/> <textFieldExpression><![CDATA[$V{ComboTotalSnack}]]></textFieldExpression> </textField> <textField> <reportElement x="502" y="0" width="100" height="24" uuid="4b104ee8-a5aa-4530-ad80-5ff0b23ba9d7"/> <textFieldExpression><![CDATA[$V{ComboTotalDinner}]]></textFieldExpression> </textField> <textField> <reportElement x="602" y="0" width="100" height="24" uuid="9897e000-a667-4644-b522-9c80d79c6b5c"/> <textFieldExpression><![CDATA[$V{ComboTotalLate}]]></textFieldExpression> </textField> <textField> <reportElement x="702" y="0" width="100" height="24" uuid="136021ba-89eb-4b5f-9f39-e429a1ce65e4"/> <textFieldExpression><![CDATA[$V{ComboCount}]]></textFieldExpression> </textField> </band> </groupFooter>[/code]Each of the variables is very simple with; they simply sum up the count field based on the time of day. In example: <variable name="ComboTotalLate" class="java.lang.Integer" resetType="Group" resetGroup="CMTypeGroup" calculation="Sum"> <variableExpression><![CDATA[$V{isLate} ? $F{count} : 0]]></variableExpression> </variable>[/code]However, these "ComboTotal***" variables are not matching up to how the records are classified in the Detail band. Take the following as an example. This is near the end of a combo group. The records are ordered by hour and minute, so the day parts (Lunch, Breakfast, Late, etc) are also sorted accordingly. As you can see in the Detail band, three records are appropriately grouped as "LT/Late". However, in the summary row, only two records (7th columns) are counted as "Late". This is just one example; the issue appears throughout the report. It is not restricted to the "Late" daypart, but can be observed in others. This one was just among the most evident for illustration. I have tried changing the evluation times on the TextFields but the issue persists. Any advice is appreciated.
  9. Greetings: I am attempting to design some reports in Jaspersoft Studio. The end goal is to incorporate the compiled reports into a Java application (using Jasper Reports Library), but I am doing the initial design in Jaspersoft Studio. I have a need to create an Excel export with one tab per group. It works fine EXCEPT in the case when a group spans multiple pages; in such cases, the group is split into multiple tabs. I have referenced https://community.jaspersoft.com/wiki/splitting-excel-output-multiple-tabs and some questions on this community forum but have yet to find a solution. What I have tried: 1. Setting "net.sf.jasperreports.export.xls.break.after.row" equal to true in my group footer and "net.sf.jasperreports.export.xls.one.page.per.sheet" to true. Result: Described above. Some groups take up more than one sheet. 2. Same as (1), but checking Ignore Pagination and setting "net.sf.jasperreports.page.break.no.pagination " to "apply". Result: All groups on one page. 3. Setting "net.sf.jasperreports.export.xls.break.after.row" equal to true in my group footer and "net.sf.jasperreports.export.xls.one.page.per.sheet" to false. Result: All groups on one page. Group definition: <group name="PropertyGroup"> <groupExpression><![CDATA[$F{store}]]></groupExpression> <groupHeader> <band height="25"> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.grid.JSSGridBagLayout"/> <textField> <reportElement mode="Opaque" x="0" y="0" width="555" height="25" uuid="e128eeba-9972-4aaa-94a3-eae4ca1b0f65"> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.layout.grid.x" value="1"/> <property name="com.jaspersoft.layout.grid.y" value="-1"/> <property name="com.jaspersoft.layout.grid.weight.x" value="1.0"/> <property name="com.jaspersoft.layout.grid.weight.y" value="1.0"/> <property name="com.jaspersoft.layout.grid.rowspan" value="1"/> <property name="com.jaspersoft.layout.grid.colspan" value="1"/> <property name="com.jaspersoft.layout.grid.weight.fixed" value="false"/> </reportElement> <textFieldExpression><![CDATA["#" + $F{store}]]></textFieldExpression> </textField> </band> </groupHeader> <groupFooter> <band height="15"> <property name="net.sf.jasperreports.export.xls.break.after.row" value="true"/> </band> </groupFooter> </group>[/code]Any advice would be appreciated. If this is an option that is better performed programmatically through the library that is an option as well. Thanks.
×
×
  • Create New...