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

cschnell

Members
  • Posts

    25
  • Joined

  • Last visited

cschnell's Achievements

Contributor

Contributor (5/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

4

Community Answers

  1. We're using Jasperserver 6.4.2 community version. I'm trying to give access to the anonymous user so that they can run a report from within another program on our server. I have followed the instructions from this question: https://community.jaspersoft.com/questions/847771/anonymous-access-jasperserver-601 Including the changes to the files mentioned in this article: https://community.jaspersoft.com/wiki/allow-anonymous-access-reports When I try to run the report using this URL, I get the below error. http://localserver:8080/jasperserver/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=/reports/Order_Sheet&reportUnit=/reports/Order_Sheet&standAlone=true&j_username=anonymousUser&j_password= Server ErrorError MessageThere was an error on the server. Try again or contact site administrators. Any help would be appreciated.
  2. As helpful as that might be to others, it is not to my application, as I'm trying to recreate forms, not plot graphs, and my company is committed to Jaspersoft, so it would not be my call to make to change. Nor, through looking quickly at ggplot, do I see how it applies to my initial question.
  3. In an effort to make this more clear: I'm trying to automate having a different field to trigger a condition in the current field, but the field names are related. In generic code, I would just do this: if fieldname_Changed ==1 then fieldname background = yellow. I have 100+ textfields I'm displaying in my report. Each of these have a change flag associated with them which are also brought in as indiviual fields in the query. Using the flags that the data had been changed I want to highlight the value in the textfield. I know this can be done with conditional styles and know how to do that on an individual field basis. But I don't want to create 100+ styles. Is there some way to tell the system to use the current expression to check another field? Or is there a way to create a variable for the condition to check the field name, and based on that use the field's flag to set the conditional expression? Basically I want a style's conditional expression something like this where $F{} is the current field's name. I tack on " Changed" to the end to make my flag's name and if that flag is equal to one then the style highlights. But I don't know what to put instead of $F{}. $F{CONCATENATE($F{}," Changed")}==1 So if the field I want to use the style on is $F{CUSTOMER} the expression would become $F{CUSTOMER Changed}==1. Then on the next field that uses the same style would be $F{ADDRESS} the expression would become $F{ADDRESS Changed} == 1 and so on times 100.
  4. Perhaps my wording was wrong. I am trying to change which data source a single report is linking to. Inside the repository, editing the JRXML report, on the page called Link a Data Source to the Report, I have changed the data source (created as you mentioned) from the repository to my development data source and saved. (similar to this page https://community.jaspersoft.com/documentation/jasperreports-server-user-guide/defining-data-source ) While investigating this, however, I found that my input parameter was linked to the production data source. This is why the report didn't appear to be changing. I thought I had it linked to no data source. Once I changed it, it is now working properly. When I run the report, it still shows data from the previous data source.
  5. In Jaspersoft Studio I can swap between my development and production databases easily by changing the data source when doing a preview. I use the same data sources on the server. Months ago I changed all my reports on the server from development to production datasources and they changed over fine. I am trying to change one back to the development data source now. Nothing I do seems to affect it, even changing to a sample data source. I don't get any errors, it simply is only showing me data from my production DB. I tried changing the data source through the repository and while publishing the report. I even restarted the jasperserver. i get the same results. Did I miss something when changing the data source?
  6. Ah, I missed created a group inside the Dataset! Thanks for pointing me in the right direction.
  7. Please elaborate, because as mentioned in my question, I tried using groups but it only put one of the notes per page. I need it at the begining of every new category. There may be ten different categories per page hence 10 notes. So is there a way to do this with groups in a normal table? I'm also not using any sort of total, just listing the values which are normally strings.
  8. I have a table that lists fields from my database with their data and what category they're in. Each category has a note attached to it. I have a query that works fine combining these but I can't seem to get the note to show up for each category. I used column groups, but it only adds one per page, not at the begining of every category. Can this be done in a table? In theory it should look something like this: |Category1 | Note1 | |Category1 | Field1 | Value1 | |Category1 | Field2 | Value2 | |Category2 | Note2 | |Category2 | Field1 | Value1 | |Category2 | Field2 | Value2 | I understand I can use crosstabs to do this, but I can't find a tutorial for working with crosstabs in this mannor. All deal with totals and such. That is much more complex than I need, I just need a simple example of something like this. So how would I do this in a cross tab? Can someone point me to an example?
  9. While I thought I had my parameters mapped, apparently you also need to have the below parameter in the "Parameters Map" expression. $P{REPORT_PARAMETERS_MAP} After I added this, it worked.
  10. I have a table in a sub report. If I preview the subreport, it shows the data in the table. If I run the subreport on the server it does not show the data in the table, but all other data in the subreport is fine. Same if I run a preview of the Master Report. On the other hand, the same table was used straight in a master report and did not show the data. I only have one parameter I'm passing down and I must be passing it okay if the data does show in the one. So what else could be stopping the data from showing?
  11. I'm trying to rebuild a report that used to be written manually in Word. That report had a table in the middle of page 1 that listed multiple orders and then had a break for other data and finally was continued on page 2. Some of the orders are single line some are multi line. So the first page may have 1 or 6 orders depending on how much room they take up. The rest basically overflow onto page 2. My task is to reproduce these reports exactly, but I don't see how to exactly do the "continued" portion of the table. I can basically "split" the tables through the query using limits and offsets. Similarly I can split the table based on the number of rows using an expression, but the extra lines don't go into the next group. However, both solutions are estremely limited because if the first table has one or two multi line entries the others get pushed under the data that is between these two tables and the second table, starting at a specific offset won't pickup those "hidden" entries. I think the biggest problem is because I need to use groups to split the pages to have the rest of the data other than the table. Group 1 Header 1 __________________________ |Table 1 | Order 1 |Price| | | Order 2 |Price| | | 2 Line 2| | | | Order 3 |Price| | | 3 Line 2| | | | Order 4 |Price| __________________________ Other field information half the page (hidden lines 5 and 6 behind these ) Group 2 Header 1 __________________________ |Table 2 | Order 7 |Price| | | Order 8 |Price| | | 8 Line 2| | | | Order 9 |Price| __________________________ Other field information half the page So is there any way to limit a table simply by its height. So basically Table 1 would only have 3 items and table 2 would have 6 in the above case. Or if the orders were only single line the first table would have six and the second only 3?
  12. I have 20+ reports that have the same header with a bit of data from the DB. I created a subreport to handle any changes to that header. I added page numbers to it as well. The page numbers I managed to get working using the variable for MASTER_CURRENT_PAGE and MASTER_TOTAL_PAGES. Individually, these reports work great. For single page reports it shows Page 1 of 1, if the report goes beyond one page it shows Page 2 of 2, etc. I then created a book to collate all of these reports. Because I'm using MASTER_CURRENT_PAGE, I believe the (sub)subreport for the header is using the book's page numbering and not my individual report page numbering. As this isn't a true book and just a collation of reports, I don't want it to be Page 1 of 20, I want it to be Page 1 of 1. Is there some other way to do the page numbering in the header subreport without putting them in each report? I know some people had mixed luck with passing the pagecount between the report and subreport and it's not recommeneded. Better yet, is there a way to reset the master variables after each subreport?
  13. Unfortunately, that's not an issue at this time, as these are new reports I'm still running them only as admin. It is a good point though, and I just double checked, but everything looks fine roles wise.
  14. I have a subreport that I use in the header over multiple reports. It works fine, except, if I make a change to this subreport (the appearance not the data), compile and publish it, it does not update on any of the reports on the server. It works fine in Studio 6.4.3, the changes show up almost immediately, but they do not on the server. The only way I'm able to get them to appear on the server is to republish each report it belongs to and overwrite the resource. This kind of takes away from the point of using a subreport. I could make those changes on individual reports then. It's not just this subreport either, it's all of them I use throughout the reports. I'm currently using the expression "repo:Project Packet Sheet Header.jrxml" I've tried pointing to the .jasper and using a subdir parameter like $P{BASE_DIR} + "Project Packet Sheet Header.jasper". There is no difference. I also don't understand why jaspersoft insists on copying every resource into a sub directory for every report in the repository. This is what I'm thinking is the root cause as these don't seem to be updating properly. I've tried doing a refresh on the files in the Repository Explorer in Studio too and that doesn't seem to do anything. Why does it not just point to the place where the original resides in the repository instead of copying the file? I've searched and read about everything I could find on subreports and all imply this is the correct method and should work. But maybe there's still something wrong in my execution? Page header call to subreport: <pageHeader> <band height="122"> <property name="com.jaspersoft.studio.unit.height" value="inch" /> <frame> <reportElement key="" x="22" y="0" width="549" height="121" uuid="0365d8c0-8d9a-4e2b-b7af-be2a1270fc47" /> <staticText> <reportElement style="SimpleField" x="218" y="1" width="295" height="20" uuid="7fe79de1-f522-4b4f-9fd4-738dc91b311a"> <property name="com.jaspersoft.studio.unit.height" value="px" /> </reportElement> <box> <topPen lineWidth="0.0" /> <leftPen lineWidth="0.0" /> <bottomPen lineWidth="0.0" /> <rightPen lineWidth="0.0" /> </box> <textElement textAlignment="Right" verticalAlignment="Middle"> <font size="16" isBold="true" /> </textElement> <text><![CDATA[ENTIRE ORDER]]></text> </staticText> <subreport> <reportElement x="0" y="8" width="549" height="88" uuid="185cba3a-0013-489c-a6ce-8d148579ab8a" /> <subreportParameter name="Order_ID"> <subreportParameterExpression><![CDATA[$P{Order_ID}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA["repo:Project Packet Sheet Header.jrxml"]]></subreportExpression> </subreport> </frame> </band></pageHeader>[/code] Subreport: <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.4.3.final using JasperReports Library version 6.4.3 --><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="ProjectPacketSheetHeader" pageWidth="550" pageHeight="752" columnWidth="550" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="793253aa-7bb3-42ed-8b7a-0bf8a8625b29"> <property name="ireport.jasperserver.url" value="http://cpreport:8080/jasperserver/"/> <property name="ireport.jasperserver.user" value="jasperadmin"/> <property name="ireport.jasperserver.reportUnit" value="/reports/Project_Packet_Sheet_Header"/> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Order Log"/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <property name="com.jaspersoft.studio.data.sql.SQLQueryDesigner.sash.w1" value="0"/> <property name="com.jaspersoft.studio.data.sql.SQLQueryDesigner.sash.w2" value="1000"/> <property name="com.jaspersoft.studio.unit." value="pixel"/> <property name="com.jaspersoft.studio.unit.pageHeight" value="inch"/> <property name="com.jaspersoft.studio.unit.pageWidth" value="inch"/> <property name="com.jaspersoft.studio.unit.topMargin" value="inch"/> <property name="com.jaspersoft.studio.unit.bottomMargin" value="inch"/> <property name="com.jaspersoft.studio.unit.leftMargin" value="inch"/> <property name="com.jaspersoft.studio.unit.rightMargin" value="inch"/> <property name="net.sf.jasperreports.print.create.bookmarks" value="true"/> <property name="com.jaspersoft.studio.report.description" value=""/> <property name="ireport.jasperserver.report.resource" value="/reports/Project_Packet_Sheet_Header_files/main_jrxml"/> <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/> <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/> <template><![CDATA["repo:ProjectPacket.jrtx"]]></template> <subDataset name="Customer Orders" uuid="2f22f3a6-9ebc-4bff-8fa0-16d586a8b88c"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Order Log"/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <parameter name="Order_ID" class="java.lang.String"/> <queryString> <![CDATA[sELECT order_id,level FROM customer_orderswhere order_id = $P{Order_ID}]]> </queryString> <field name="order_id" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="order_id"/> <property name="com.jaspersoft.studio.field.tree.path" value="customer_orders"/> </field> <field name="level" class="java.lang.Integer"> <property name="com.jaspersoft.studio.field.label" value="level"/> <property name="com.jaspersoft.studio.field.tree.path" value="customer_orders"/> </field> </subDataset> <parameter name="Order_ID" class="java.lang.String"/> <queryString> <![CDATA[sELECT order_id,max( case when field_setup_id = 1634 then order_log_field_values else null end) as 'Job Info - PO Number',max( case when field_setup_id = 450 then order_log_field_values else null end) as 'Job Info - Quote Number',max( case when field_setup_id = 451 then order_log_field_values else null end) as 'Job Info - Sales Person',max( case when field_setup_id = 452 then order_log_field_values else null end) as 'Job Info - Sales Order Number',max( case when field_setup_id = 453 then order_log_field_values else null end) as 'Job Info - Serial Number',max( case when field_setup_id = 1799 then order_log_field_values else null end) as 'Job Info - Order Date',max( case when field_setup_id = 458 then order_log_field_values else null end) as 'Job Info - Duplicate/Similar' FROM order_log_field_setup where order_id = $P{Order_ID}]]> </queryString> <field name="order_id" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="order_id"/> <property name="com.jaspersoft.studio.field.tree.path" value="order_log_field_setup"/> </field> <field name="Job Info - PO Number" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - PO Number"/> </field> <field name="Job Info - Quote Number" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Quote Number"/> </field> <field name="Job Info - Sales Person" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Sales Person"/> </field> <field name="Job Info - Sales Order Number" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Sales Order Number"/> </field> <field name="Job Info - Serial Number" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Serial Number"/> </field> <field name="Job Info - Order Date" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Order Date"/> </field> <field name="Job Info - Duplicate/Similar" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="Job Info - Duplicate/Similar"/> </field> <group name="Group1"> <groupExpression><![CDATA[$F{order_id}]]></groupExpression> </group> <summary> <band height="90"> <componentElement> <reportElement x="51" y="53" width="18" height="18" uuid="07df2046-ce9e-4afd-adde-ad7bcb66e57e"/> <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical"> <datasetRun subDataset="Customer Orders" uuid="2b4342a1-2caf-4210-9a2b-62326e97e256"> <datasetParameter name="Order_ID"> <datasetParameterExpression><![CDATA[$P{Order_ID}]]></datasetParameterExpression> </datasetParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> </datasetRun> <jr:listContents height="18" width="18"> <textField> <reportElement style="SimpleField" x="0" y="0" width="18" height="18" uuid="d7a1698b-8034-4fc2-96de-59724139eb13"/> <box> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement textAlignment="Left"> <font size="12" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{level}]]></textFieldExpression> </textField> </jr:listContents> </jr:list> </componentElement> <staticText> <reportElement style="SimpleField" x="14" y="53" width="39" height="18" uuid="a9809d8e-2670-4d47-9c84-abb5ceb2b848"> <property name="com.jaspersoft.studio.unit.width" value="inch"/> </reportElement> <box> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement textAlignment="Left"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[LEVEL]]></text> </staticText> <image bookmarkLevel="1"> <reportElement x="14" y="0" width="504" height="52" uuid="7e2c0e5d-f88e-48db-8fef-bdca264aeb64"> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> </reportElement> <imageExpression><![CDATA["repo:/images/CP_Logo_Header_Plain"]]></imageExpression> <anchorNameExpression><![CDATA["Order Sheet"]]></anchorNameExpression> </image> <textField evaluationTime="Master"> <reportElement style="SimpleField" x="444" y="32" width="69" height="15" uuid="3314d7b9-1f0d-4bfc-b42b-da435538fc16"> <property name="com.jaspersoft.studio.unit.width" value="px"/> </reportElement> <box> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement textAlignment="Right" verticalAlignment="Bottom"/> <textFieldExpression><![CDATA["Page " + $V{MASTER_CURRENT_PAGE} + " of " + $V{MASTER_TOTAL_PAGES}]]></textFieldExpression> </textField> <staticText> <reportElement style="SalesLabel" mode="Opaque" x="388" y="53" width="63" height="18" backcolor="#F2F2F2" uuid="552f8414-73e0-411a-8e92-72617e8094ac"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement textAlignment="Left" verticalAlignment="Middle"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[REVISION:]]></text> </staticText> <staticText> <reportElement key="" style="SalesLabel" x="0" y="71" width="49" height="18" uuid="2f14731b-33b3-4fba-9e9b-85da8bd4789d"> <property name="com.jaspersoft.studio.unit.height" value="inch"/> <property name="com.jaspersoft.studio.unit.width" value="inch"/> <property name="com.jaspersoft.studio.unit.x" value="inch"/> <property name="com.jaspersoft.studio.unit.y" value="inch"/> </reportElement> <box> <topPen lineWidth="1.5"/> <leftPen lineWidth="1.5"/> <bottomPen lineWidth="1.5"/> </box> <text><![CDATA
  15. It looks like my comment about using raw SQL in the parameter was key. I reread the article I linked and looked for more specfic articles and found it was as simple as putting "@rn1 := if(@pk1=A.order_id, @rn1+1,1) as rowNumber," into the Default Expression of my parameter rn1 and using $P!{rn1} in its place. I kind of wish the documentation on this was a little clearer, but it worked.
×
×
  • Create New...