我已将页脚的页面x添加到我的报告中,但PAGE_COUNT似乎不起作用.
也许问题出现是因为我有很多子报告?
我明白了:
Page 1 of 1
Page 2 of 0
Page 3 of 0
Page 4 of 0
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我在我的系统上安装了Cygwin.但是,当我尝试使用gcc命令时,它说:
bash: gcc: command not found
有人能为我提供解决方案吗?
我试图在这个wiki之后将rails 3应用程序与jasper集成:
http://wiki.rubyonrails.org/rails/pages/HowtoIntegrateJasperReports
但似乎很多信息都没有更新,所以很难让它自己工作.我还在ruby-forum上阅读了一个主题:http://www.ruby-forum.com/topic/139453 并解释了一些细节,但仍无法使其正常工作.
我的第一个问题与render_to_string方法有关:当控制器方法运行时,我收到"模板丢失"错误:
这是方法:
def report
@customers = Customer.all
send_doc(render_to_string(:template => report_customers_path, :layout => false), '/pdfs', 'report.jasper', "customers", 'pdf')
end
Run Code Online (Sandbox Code Playgroud)
虽然这看起来很简单但我不明白为什么会这样.不render_to_string与布局=>假 suposed让我行动的字符串结果?我也试过:动作而不是:模板,但它也是一样的.
如果任何对此集成有一定专业知识的人可以提供帮助...先谢谢,André
任何人都可以在java中为我提供一个很好的小例子演示wait()和notify()功能.我试过下面的代码,但它没有显示我的预期.
public class WaitDemo {
int i = 10;
int display() {
System.out.println("Lexmark");
i++;
return i;
}
}
Run Code Online (Sandbox Code Playgroud)
public class ClassDemo1 extends Thread {
private WaitDemo wd = new WaitDemo();
public static void main(String[] args) {
ClassDemo1 cd1 = new ClassDemo1();
ClassDemo1 cd2 = new ClassDemo1();
cd1.setName("Europe");
cd2.setName("America");
cd1.start();
cd2.start();
}
synchronized void display() {
System.out.println("Hello");
notifyAll();
}
public void run() {
synchronized (this) {
try {
{
notify();
System.out.println("The thread is " + currentThread().getName());
wait();
System.out.println("The value is " …Run Code Online (Sandbox Code Playgroud) 在尝试根据元素字符串长度对数组进行排序时,我遇到了编译错误.我有一套开始,
Set<String> arraycat = new HashSet<String>();
//add contents to arraycat
String[] array = arraycat.toArray(new String[0]);
//array looks like this now:
//array=[cat,cataaaa,cataa,cata,cataaa]
Run Code Online (Sandbox Code Playgroud)
我理想的是要排序到
array=[cat,cata,cataa,cataaa,cataaaa]
Run Code Online (Sandbox Code Playgroud)
所以我有一个类型的比较器
class comp implements Comparator {
public int compare(String o1, String o2) {
if (o1.length() > o2.length()) {
return 1;
} else if (o1.length() < o2.length()) {
return -1;
} else {
return 0;
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后我打电话给上课
Collections.sort(array, new comp());
Run Code Online (Sandbox Code Playgroud)
但是,它抛出了两个编译错误:
comp is not abstract and does not override abstract method compare(java.lang.Object,java.lang.Object) in java.util.Comparator
class comp …Run Code Online (Sandbox Code Playgroud) <style name="blueStyle" >
<conditionalStyle>
<conditionExpression><![CDATA[($P{INDIRIZZO}).length()>30 ? Boolean.TRUE : Boolean.FALSE]]></conditionExpression>
<style style="blueStyle" fontSize="3"/>
</conditionalStyle>
</style>
<parameter name="INDIRIZZO" class="java.lang.String"/>
[...]
<textField>
<reportElement x="178" y="94" width="157" height="17"/>
<textElement>
<font fontName="Arial" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{INDIRIZZO}]]></textFieldExpression>
</textField>
Run Code Online (Sandbox Code Playgroud)
当INDIRIZZO长度> 30 时,我想缩小字体大小 ...
但这不起作用....
可以帮助在一个字段中添加多个DB字段值.
假设我有3个DB字段:
Name
Address
Age
Run Code Online (Sandbox Code Playgroud)
我想在同一个字段中显示所有3个字段:
John Peter 28.
Run Code Online (Sandbox Code Playgroud)
我尝试了彼此相邻的3个字段,它确实有效,但是当我包装文本时.看起来很糟糕:
名称
Jo.pe.28
hn te
r
Run Code Online (Sandbox Code Playgroud)
我的要求是在一个文本字段中显示数据,例如:John.Peter.26
我正在使用Jaspersoft Studio开发一些报告.
我有一个应该接受REST查询的Web应用程序,并将它们转换为已编译的报告.
所以我有一些JasperReports罐子包括:
问题是,当我编译我的报告并从Jaspersoft Studio运行时,它运行正常.
但是当我从我的Web应用程序编译并运行它时,它会抛出异常:
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
Source text : CONCATENATE($V{startString}, " - ", $V{endString})
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:244)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:591)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:559)
...
Caused by: net.sf.jasperreports.engine.JRRuntimeException: Function CONCATENATE not found
Run Code Online (Sandbox Code Playgroud)
当我CONCATENATE在报告中更改我的呼叫时,它工作正常.
所以这给我留下了一个解决方案,我错过了一个JasperReports罐子,但是哪个?
首先,我在iReport 5.1.0中创建一个R_D1.jrxml文件.
我执行报告的Java代码如下所示:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashMap;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperFillManager;
public class DbReportFill{
Connection con;
public void generateReport() {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/sentiment","root", "abcd");
System.out.println("Filling report...");
JasperFillManager.fillReportToFile("/home/abcd/report/R_D1.jrxml",new HashMap<String, Object> (), con);
System.out.println("Done!");
con.close();
} catch (JRException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
new DbReportFill().generateReport();
}
}
Run Code Online (Sandbox Code Playgroud)
当我执行该类时,我得到以下异常:
Filling report...
net.sf.jasperreports.engine.JRException: Error loading object from file …Run Code Online (Sandbox Code Playgroud) 我得到了413 Request Entity Too Large错误运行此命令后:
git push -u test1 current-repo --force
Run Code Online (Sandbox Code Playgroud)

这个错误的原因是什么?如何避免这个错误?