翻譯|使用教程|編輯:黃竹雯|2019-04-30 09:58:31.000|閱讀 284 次
概述:TFORMer SDK能夠自動化打印和導出規范報表和標簽。介于各版本的編程接口,TFORMer SDK可輕松地集成到您的應用程序。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
TFORMer能提供專業的打印方案,用于大多數應用程序中,如:報告,標簽,郵件,商業窗體等等。TFORMer能滿足您的標簽應用程序, 條形碼,和其他報表以及窗體打印的需要。
TFORMer SDK能夠自動化打印和導出規范報表和標簽。介于各版本的編程接口,TFORMer SDK可輕松地集成到您的應用程序。
下面我們將向您展示如何以編程方式生成存儲庫并通過TFORMer API打開TFORMer Designer。
注意:不會自動生成xmd文件(基于存儲庫的設計器文件)。您必須使用designer生成一個空的xmd文件(將此文件存儲在.NET項目中的某個位置),然后在創建表單時將其復制到正確的位置(Forms / [ProjectName]子目錄)。
using TECIT.TFORMer; using System.IO; // FileInfo class String repositoryPath = @"C:\temp\test\myRep.tfr"; String projectName = "myProject"; String formName = "myForm"; FileInfo repositoryFile = new FileInfo(repositoryPath); if (!repositoryFile.Exists) { // create new repository (read-only flag = false) Repository newRepository = new Repository(repositoryPath, true, false); // add project Project newProject = newRepository.AddProject(projectName); // add form FormLayout newFormLayout = newProject.AddFormLayout(formName); // set file name newFormLayout.Filename = newFormLayout.Name + ".xmd"; // close and save changes !!! newRepository.Close(true); // TO DO: // add "Forms" sub directory if not exist // add "Forms\myProject" sub directory if not exist // copy empty xmd file to Forms\myProject\ (file name must be like set above) } // if repository exists (with project and form !): // open for editing Repository repository = new Repository(repositoryPath, false, false); // get project Project project = repository.GetProject(projectName); // get form FormLayout formlayout = project.GetFormLayout(formName); // open TFORMer Designer formlayout.Design(@"C:\Program Files\TEC-IT\TFORMer6\Bin\TFORMer.exe", true, true, false, null); //formlayout.Design(null, true, true, false, null);
使用TFORMer SDK創建PDF時,您可能會遇到以下異常:
該文本包含無法使用當前設置或字體打印的Unicode字符。信息:錯誤代碼:0x0000697c
要將缺少的Unicode字符添加到嵌入字體,請轉到TFORMer Designer菜單工具>選項> PDF : Embed Font with “True Type-Subgroups“
如果您的TFORMer SDK項目使用特定的TFORMer.xml配置文件,請設置選項:PDF ... embed-subset-fonts =“1”
要使用Python打印TFORMer報告,可以使用以下腳本作為示例:
from ctypes import * FormFile = "c:/pathto/formfile.tff" DataFile = "c:/pathto/importdata.csv" TF_dll = oledll.LoadLibrary("TFormer60.dll") TF_dll.TFormer_LicenseMe("Your Licensee Name ", 4, 1,"Your Key" ) htform = TF_dll.TFormer_Init(0) rm = TF_dll.TFormer_SetRepositoryName(htform, FormFile) rm = TF_dll.TFormer_ResetData(htform) rm = TF_dll.TFormer_SetTxtDataFile(htform, DataFile, c_char(","), c_char(" ")) rm = TF_dll.TFormer_SetCopies(htform,1) rm = TF_dll.TFormer_SetStartPosition(htform, 1, 0) rm = TF_dll.TFormer_SetPrinter(htform, "", 0) rm = TF_dll.TFormer_PrintForm(htform) print 'finished'
問題在于(.NET API):缺少或無法找到其中一個必需的依賴項。
請確保TFORMer DLL位于其中一個位置。
有兩種可能性:
PS:如果您不使用我們的設置,請確保已安裝Visual Studio運行時庫。
如果安裝程序無法將TFORMer AutoDoc 7.5安裝為系統服務,則可以使用以下命令行通過PowerShell進行安裝。
new-service -Name TECIT.TFORMer.AutoDoc -DisplayName "TFORMer AutoDoc 7.5" -Description "Automatic document generation service utilizing TFORMer SDK 7.5" -BinaryPathName '"C:\Program Files (x86)\TEC-IT\AutoDoc 7.5\AutoDoc.exe" "C:\Program Files (x86)\TEC-IT\AutoDoc 7.5\config.xml"' -StartupType Manual -Credential "domain\user"
以上是TFORMer SDK常見的問答,希望對你有所幫助。如果你在使用的過程中遇到其他困擾,可在下方評論區留言,或進入資源列表查看更多教程。
TFORMer SDK現已加入慧都平臺,在線訂購享獨家優惠!>>立即咨詢購買
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn