我正在尝试使用BIRT创建一个excel电子表格.电子表格是将两个对象映射在一起的交叉表.根据MySQL数据库中的值,行数和列数是动态的.目前,我有一个PDF输出报告的工作实现.现在,我正在尝试为Excel创建第二版报告.
我复制了报表设计并开始调整它以使用Excel.一切看起来都不错,但只有前3列显示在标题之后.所有行都正确显示.
我尝试过以下方法:
我受到以下方面的限制:
这篇博客文章提到了我的问题:http: //www.spudsoft.co.uk/2011/10/the-spudsoft-birt-excel-emitters/ 但它没有提供除发射器开关之外的解决方案.具体的引用是"文件也有页面布局的问题,我无法解决(特别是广泛的报告将被切断)."
除了一篇博客文章,我的googlefu也让我失望了.任何帮助表示赞赏!谢谢!
主要问题:如何通过 jQuery.ajax()检索带有“ http://www.example.com/index.html#foo ”之类的 url 的内容?
注意:以下适用于脚本,这是我最初要求的:
var script = document.createElement('script');
script.type= 'text/javascript';
script.src= 'http://www.example.com/script.js#foo';
$('head').append(script);
Run Code Online (Sandbox Code Playgroud)
您可以使用此处找到的方法以普通的旧 ajax 方式构建您自己的请求:
var xmlHttp = new XMLHttpRequest();
var url="http://www.example.com/index.html#foo";
xmlHttp.open("GET", url, true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", 0);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.onreadystatechange = function() {
if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
alert(xmlHttp.responseText);
}
}
xmlHttp.send();
Run Code Online (Sandbox Code Playgroud)
然而,这似乎是 jQuery.ajax 应该支持的东西。
至于jQuery,我有以下几点:
$.ajax({
url: 'http://www.example.com/index.html#foo',
cache: true
});
Run Code Online (Sandbox Code Playgroud)
但是,实际发出的请求是“ http://www.example.com/index.html ”。如果我无法控制我正在使用的端点,并且如果“#foo”不在 url 中,它会以完全不同的内容响应,这很糟糕。
基于对 SO 上另一个问题的回答,我尝试了以下操作
$.ajax({
url: 'http://www.example.com/index.html',
cache: true,
data: {
'': '#foo' …Run Code Online (Sandbox Code Playgroud)