找回密码
 立即注册

QQ登录

只需一步,快速开始

chya24

注册会员

2

主题

7

帖子

41

积分

注册会员

积分
41
最新发帖
chya24
注册会员   /  发表于:2018-12-3 16:19  /   查看:3478  /  回复:6
1.代码报“The TXTextControl object must have been completely loaded to use this method”或者“Server not ready”这样的错误,都是什么问题

6 个回复

倒序浏览
chya24
注册会员   /  发表于:2018-12-3 16:31:39
沙发
private TXTextControl.DocumentServer.MailMerge mailMerge1;
        private TXTextControl.ServerTextControl serverTextControl1;
        private System.ComponentModel.IContainer components;

        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.mailMerge1 = new TXTextControl.DocumentServer.MailMerge(this.components);
            this.serverTextControl1 = new TXTextControl.ServerTextControl();
            this.mailMerge1.ReportDataSourceConfig = "";
            this.mailMerge1.TextComponent = this.serverTextControl1;
            this.serverTextControl1.SpellChecker = null;

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            InitializeComponent();
            TextControl1.LoadText(Server.MapPath("/documents/hlxx.docx"),
                TXTextControl.Web.StreamType.WordprocessingML);
            byte[] data;
            TextControl1.SaveText(out data,
                TXTextControl.Web.BinaryStreamType.InternalUnicodeFormat);

            // load the template into the MailMerge reporting engine
            mailMerge1.LoadTemplateFromMemory(data,
                TXTextControl.DocumentServer.FileFormat.InternalUnicodeFormat);

            DataTable dt = new DataTable();
            dt.Columns.Add("s_hospital_no");
            dt.Rows.Add("20156666");
            // merge the template
            mailMerge1.Merge(dt);

            // save the resulting document to a byte array
            mailMerge1.SaveDocumentToMemory(out data,
                TXTextControl.BinaryStreamType.InternalUnicodeFormat, null);

            // load the document back into the Web editor
            TextControl1.LoadText(data,
                TXTextControl.Web.BinaryStreamType.InternalUnicodeFormat);
        }

页面加载的时候执行这个会报“Server not ready”,我想实现的功能:页面加载的时候将邮件合并后的数据展示出来
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-12-4 09:17:22
板凳
您好,如果是您自己写的项目代码,请将项目压缩一下发上来,目前我这边没法重现问题
回复 使用道具 举报
chya24
注册会员   /  发表于:2018-12-5 16:29:26
地板
哪里可以下载TXTextControl.Web.MVC.dll,需要的版本是Text Control 26.0
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-12-6 10:21:43
5#
开发包中没有这个动态库的,你是哪里提示需要这个dll
回复 使用道具 举报
chya24
注册会员   /  发表于:2018-12-21 10:48:59
6#
本帖最后由 chya24 于 2018-12-21 17:09 编辑

https://github.com/TextControl/
这个网站下载的实例,基本都是mvc的,需要相关的dll,现没有找到26.0版本的dll

回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-12-21 18:22:03
7#
明白了,这个问题我会和厂商来确认,看看这dll从哪里来的
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部