找回密码
 立即注册

QQ登录

只需一步,快速开始

spdrtsoft

金牌服务用户

16

主题

70

帖子

180

积分

金牌服务用户

积分
180

活字格认证微信认证勋章元老葡萄

spdrtsoft
金牌服务用户   /  发表于:2016-7-13 12:41  /   查看:10948  /  回复:27
显示的有问题,数据大概有2页,但是重复显示第一页数据。

代码如下:
    for (var i = 0; i < spread.sheets.length; i++) {
        spread.sheets[i].getColumn(1).width(150);
        spread.sheets[i].getColumn(2).width(150);
        spread.sheets[i].getColumn(3).width(150);
        spread.sheets[i].getColumn(spread.sheets[i].getColumnCount() - 1).width(150);
        var printInfo = spread.sheets[i].printInfo();
        printInfo.showColumnHeader(GcSpread.Sheets.PrintVisibilityType.Hide);
        printInfo.showRowHeader(GcSpread.Sheets.PrintVisibilityType.Hide);
        printInfo.showGridLine(false);
        printInfo.showBorder(false);
        printInfo.orientation(GcSpread.Sheets.PrintPageOrientation.Landscape);
        printInfo.margin({ top: 10, bottom: 0, left: 10, right: 10, header: 0, footer: 0 });
        printInfo.centering(1);
        printInfo.paperSize(new GcSpread.Sheets.PaperSize(1200, 750));
        printInfo.pageOrder(GcSpread.Sheets.PrintPageOrder.OverThenDown);
        spread.sheets[i].printInfo(printInfo);

    }
    spread.print();

27 个回复

倒序浏览
spdrtsoft
金牌服务用户   /  发表于:2016-7-13 12:42:32
沙发
另外最后一行的图片签名
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-7-13 14:05:17
板凳
您好,我用您的代码没有重现出问题,可否将您的页面和数据一起使用spread.toJSON({includeBindingSource:true})导出json后上传。以及提供相关操作代码。
方便我们重现问题
回复 使用道具 举报
spdrtsoft
金牌服务用户   /  发表于:2016-7-14 15:54:35
地板
你有电话吗?
回复 使用道具 举报
spdrtsoft
金牌服务用户   /  发表于:2016-7-14 16:55:09
5#
麻烦看看,这个是模版

ui_PmExpenseNew_sp.ssjson

36.6 KB, 阅读权限: 150, 下载次数: 1

回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-7-14 17:55:25
6#
您好,使用您的模板我添加数据后仍然没有重现问题。可否提供有数据的模板并对有问题的打印预览截图
您是我们的金牌用户可以拨打我们售后电话029-88331988转345
blob178434142.png
blob500166015.png
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-7-15 11:24:27
7#
您好,你页面完全加载完成后 调用 console.log(JSON.stringify(spread.toJSON())) 然后在浏览器开发者模式将导的json文件复制出来,然后上传。
同时将你打印部分代码也发上来。
回复 使用道具 举报
spdrtsoft
金牌服务用户   /  发表于:2016-7-15 13:19:42
8#
附件数据是真实数据请勿外泄。
      function finlPrint() {
            spread.isPaintSuspended(true);
            activeSheet.addColumns(0, 1);
            activeSheet.getColumn(0).width(1);
            activeSheet.deleteColumns(activeSheet.getColumnCount() - 1, 1);
            spread.isPaintSuspended(false);

            //activeSheet.setRowPageBreak(20, true);
            //activeSheet.setColumnPageBreak(5, true);
            var printInfo = activeSheet.printInfo();
            printInfo.showColumnHeader(GcSpread.Sheets.PrintVisibilityType.Hide);
            printInfo.showRowHeader(GcSpread.Sheets.PrintVisibilityType.Hide);
            printInfo.showGridLine(false);
            printInfo.showBorder(false);
            //printInfo.paperSize(new GcSpread.Sheets.PaperSize(GcSpread.Sheets.PaperKind.A4));
            //printInfo.paperSize(new GcSpread.Sheets.PaperSize(1900, 490));
            printInfo.paperSize(new GcSpread.Sheets.PaperSize(1200, 750));

            printInfo.orientation(GcSpread.Sheets.PrintPageOrientation.Landscape);//纵向
            //printInfo.orientation(GcSpread.Sheets.PrintPageOrientation.Portrait);

            printInfo.margin({ top: 0, bottom: 0, left: 10, right: 0, header: 0, footer: 0 });
            printInfo.centering(GcSpread.Sheets.PrintCentering.Landscape);
            printInfo.repeatRowStart(0);//重复打印
            printInfo.repeatRowEnd(1);//重复打印
            //printInfo.footerCenter("&P and &N");//页码
            //printInfo.fitPagesTall(1);
            printInfo.pageOrder(GcSpread.Sheets.PrintPageOrder.Auto);
            activeSheet.printInfo(printInfo);
            spread.print(0);

            activeSheet.deleteColumns(0, 1);

        }

localhost-1468559867466.log

444.01 KB, 阅读权限: 150, 下载次数: 2

回复 使用道具 举报
spdrtsoft
金牌服务用户   /  发表于:2016-7-15 14:46:07
9#
另外模版中设置的是10号字体,打印的时候就变成13号字体了。但是我并没有对打印样式进行修改过。
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-7-15 16:39:57
10#
您好,您的问题我重现出来了,已经反馈产品组,他们会尽快调查问题,并给您反馈。
回复 使用道具 举报
123下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部