Jump to content

Error saving report after a filter is added


cbarlow3

Recommended Posts

I normally write reports using iReport, but I also have to be able to support clients who write reports using a Topic directly within JasperReports Server.  One of the Topics (which joins together information from our LOAN table and a few related tables) I created has a strange problem: if I create a report and even add a filter from a normal field like "Loan Open Date", I can save it and run it just fine.  But I have two fields that any time I try to add them as a filter, I am unable to save the report.  Instead, I get the error "You do not have permission to write to this location.  Please choose another folder, or contact your system administrator."  The really strange thing is that I have another topic which is nearly identical, except that the main table I am looking at is our SHARE table (a "share" in credit union parlace is like a checking account, savings account, certificate of deposit, etc.).  That topic works just fine, even when I add one of these two filters that is causing problems in the LOANS topic.

Aside from the fact that the error message doesn't seem to have anything to do with the change I'm making (how does adding a specific filter have anything to do with writing to a location?), I also can't figure out why writing a report from the Loans topic is having a problem, while writing one from the Shares topic is not.  The two relevant sections of the jrxml that have to do with one of these fields that is a problem to filter from is as follows:

  CASE
    WHEN LOAN.CLOSE_DATE IS NULL THEN 'No'
    ELSE 'Yes'
  END AS LOAN_CLOSED_FLAG,

...

    <field name="LOAN_CLOSED_FLAG" class="java.lang.String">
        <property name="adhoc.display" value="Loan Closed Flag"/>
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>

I've attached copies of the Share topic jrxml file (which works) and the Loan topic jrxml file (which works until I try to add either the Loan Closed Flag or the Loan Charged Off Flag as a filter, after which I can't save the report based on that topic anymore.

Any ideas???

Carl

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

An excellent suggestion, but the results were very frustrating.  I cut out the bands that I wasn't really using, and I cut out all the fields in the SQL query except for the first two and the two that seemed to be causing trouble, and everything worked fine.  Okay, so maybe I go the other way:  add sections at a time until I get it to break?  I had added all but one field back and it was still working fine.  I figured maybe I had somehow deleted a typo and not re-introduced it, so I was hopeful when I added the last field back...and it broke.  I didn't see anything wrong with the last field I added (which was payment frequency), but I took it back out, determined that if it worked again, I would at least send this version of the topic to my client to use until I could figure it out.  Except now that version didn't work.  A few more hours of that kind of testing drove me a little crazy.  This morning I built the topic up from scratch:  started with the letter template in iReport, deleted unused fields, used the SQL query but none of the jrxml from the old version of my topic, and didn't add any <property name="adhoc.display" value="easier to read field name"/> tags to my <field> containers, and...it worked.  At least in my test environment.  So I've sent this version up to the client for testing.

Of course, what any of these changes have to do with the strange error message, I'm still no closer to understanding.  My next thought is that maybe the value for property "adhoc.display" has a maximum number of characters or has a restriction that the value must be unique (sensible) within the first x characters (not quite as intuitive).  Again, why that would only be a problem when you add a specific field as filter, and why it would manifest itself as some kind of security/privileges error associated with saving the report specification, I'm sure I don't know.  If I can get a really short version to fail, I'll post it.  And of course, if I get any closer to a solution, I'll post that as well.

Carl

Link to comment
Share on other sites

Hi !

Do you use MySQL5.5 with an old version of Jasperserver like 3.7 ?

I've just the same problem... and the problem is that "maxValue" is now a reserved word in MySQL 5.5 !!!!

So, some request must be modified in Jasper to be run in MySQL 5.5.

 

For the problem you have, the file is :

\jasperserver-pro.war\WEB-INF\lib\jasperserver-repository-hibernate-3.7.0.jar\com\jaspersoft\jasperserver\api\metadata\common\service\impl\hibernate\persistent\


File “RepoDataType.hmb.xml” to modify like this :

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

                <joined-subclass                                       name="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoDataType"                                              extends="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoResource"

                                           table="JIDataType">
 

                               <key column="id"/>
                               <property name="type"/>
                               <property name="maxLength"/>
                               <property name="decimals"/>
                               <property name="regularExpr"/>
                               <property name="minValue" type="serializable"/>
                               <property name="maxValue" column="[maxValue]" type="serializable"/>
                               <property name="strictMin"/>
                               <property name="strictMax"/>

                </joined-subclass>

</hibernate-mapping>

Hope it will help you !

(i found the solution with help of "jasperserver.log" stored in "jasperserver-pro/WEB-INF/logs" --> very helpful !)

 

Link to comment
Share on other sites

Interesting.  Actually, I'm using DB2 9.7, but I believe it's a keyword in DB2 SQL as well (not specifically for SELECT, but...).  I'll have to look into this when I get a chance in the next few days.  And that's a good tip about the JasperServer log.  I never look there.

Carl

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...