我使用jasper插件以pdf格式获取报告.我正在尝试使用此示例(http://grails.org/plugin/jasper)获取报告.要获取以下代码使用的pdf格式的特定ID信息.
<div class="buttons">
<g:form>
<g:hiddenField name="id" value="${userManagementInstance?.id}" />
<span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
<span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
</g:form>
</div>
<g:jasperReport jasper="use" format="PDF" name="users">
<input type="hidden" name="id" value="${userManagementInstance?.id}" />
</g:jasperReport>
Run Code Online (Sandbox Code Playgroud)
我在show.gsp页面上使用了上面的代码来获取特定的id报告.
<?xml version="1.0" encoding="UTF-8"?>
<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="report name" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.scriptlethandling" value="0"/>
<property name="ireport.encoding" value="UTF-8"/>
<import value="net.sf.jasperreports.engine.*"/>
<import value="java.util.*"/>
<import value="net.sf.jasperreports.engine.data.*"/>
<style name="pagetitle" isDefault="false" fontName="SansSerif" fontSize="14"/> …Run Code Online (Sandbox Code Playgroud) 我想通过两个领域,其使用动态查找器来搜索status和OpenOn(date).这个查询工作得很好:
render(view:'list', model:[incidentInstanceList:Incident.findAllByStatusIlikeAndOpenOnGreaterThan("closed",new Date()-1,[sort:"id",order:"desc"])])
Run Code Online (Sandbox Code Playgroud)
但是现在我试图通过三个字段搜索动态查找器,即UserId:status和OpenOn(date):
render(view:'list', model:[incidentInstanceList:Incident.findAllByStatusIlikeuserIdIlikeAndOpenOnGreaterThan("closed","${session.user.userId}",new Date()-1,[sort:"id",order:"desc"])])
Run Code Online (Sandbox Code Playgroud)
此查询无法正常运行并显示错误:
No signature of method: app.Incident.findAllByStatusIlikeuserIdIlikeAndOpenOnGreaterThan() is applicable for argument types: (java.lang.String, org.codehaus.groovy.runtime.GStringImpl, java.util.Date, java.util.LinkedHashMap) values: [closed, tt10004, Wed Aug 24 15:12:21 IST 2011, [sort:id, order:desc]] Possible solutions: findAllByStatusIlikeuserIdIlikeAndCreatedOnGreaterThan(java.util.List)
Run Code Online (Sandbox Code Playgroud)
请指导我解决这个问题.
我正在做grails的小项目.我正在尝试在这个项目中添加网络概念,请您指导如何处理它
需求:-
我在我的localhost(http:// localhost:8080/xyz)中运行我的项目.如果另一个人使用相同的localhost访问项目(http://192.168.xx:8080/xyz).通过使用网络概念我应该获得使用相同localhost(IP地址)的特定用户IP地址的详细信息.
目前我正在使用此查询来获取我的系统的IP地址
${request.getScheme()}:${InetAddress.getLocalHost().getHostAddress()}
Run Code Online (Sandbox Code Playgroud)
但我想要在网络中使用这个项目的特定用户的IP地址.
请指导我解决这个问题.