- function doPrint() {
- var printurl = "http://localhost:8080/WebReport/ReportServer";
- var p = [];
- if (Vailation()) {
- return;
- }
- var Range1 = $("[name=Range1]").val();
- var Range2 = $("[name=Range2]").val();
- $.ajax({
- type: "POST",
- url: '/Specimen/GetPrintdata',
- data: { Range1: Range1, Range2: Range2, SearchTime: '@ViewBag.Begintime' },
- success: function (data) {
- if (data.length > 0) {
- //var url = BBDJUrl + "[";
- var Params = "";
- var error = "";
- for (var i = 0; i < data.length; i++) {
- //4=已审核 5=已打印 6= 自主打印
- if (data[i].Resultstatus == 4 || data[i].Resultstatus == 5 || data[i].Resultstatus == 6) {
- p.push("{reportlet: 'BBDJ.cpt,YLJGDM:" + Yljgdm + ",DOCTADVISENO:" + data[i].Doctadviseno + ",SAMPLENO:" + data[i].Sampleno + "}");
- //Params += "{reportlet:BBDJ.cpt,YLJGDM:" + Yljgdm + ",DOCTADVISENO:" + data[i].Doctadviseno + ",SAMPLENO:" + data[i].Sampleno + "}";
- } else {
- if (error != "") error += ",";
- error += data[i].Sampleno
- }
- }
- alert("p:"+p);
- //将参数值组成的数组转化为字符串
- var rp = p.join(",");
- //使用FineReport自带的方法cjkEncode进行转码
- var reportlets = FR.cjkEncode("[" + rp + "]");
- var config = {
- url: printurl,
- isPopUp: false,
- data: {
- reportlets: reportlets
- }
- };
- alert("reportlets:" + reportlets);
- alert(config.url+','+config.isPopUp+','+config.data.reportlets);
- FR.doURLPDFPrint(config);
- //判断当时是否有提示信息
- if (error.length > 0 && Params.length > 0) {
- if (confirm("样本号:" + error + "未审核,您还需要打印剩余部分?")) {
- //makeNewWindow(url);
- }
- } else {
- alert("查询出的数据未审核!")
- }
- } else {
- alert("未查询出需要打印的数据!");
- return;
- }
- }
- });
- //获取当前页面选中的参数值,并将值放入数组中
-
- }
复制代码 这是我拼接地址调用doURLPDFPrint去打印的方法,页面可以打开,可是会修改上面配置的8080端口号,变成我.NET项目的端口,找不到页面。这个要怎么解决呢
|