PowerBuilder Dw2document

2025-12-10 0 413

Powerbuilder Datawindow to Document(Xlsx, Docx, …?)

This Project is .NET project that implement Converter Powerbuilder Datawindow to MS-Office document and so on
This project inspired from Appeon\’s Dw2Doc example Project

Why Re-construct Architecture?

  • We want use in production environment
  • but appeon\’s original repository has multiple csproj and complex user-object structure
  • SO, to simplifying distribution and manaing and avoiding dll collision from other modules, Single Integrated DLL is better choice

Introduce

  • We use Virtual Grid Idea to convert datawindow to other format, this is appeon\’s idea
  • this project target .net8 and .net6 and .net481 for compatability among powerbuilder versions
  • We use Polysharp to comaptability among dotnet versions
  • We use NPOI to handle Office Open XML
  • We use ILRepack to bundling dll

Acknowledgements

  1. Appeon\’s primary idea repository encourage our challenge
  2. NPOI
  3. ILRepack
  4. Dotnet Foundation and Microsoft
  5. PolySharp

NOTICE

This project is a substantial refactoring and extension of Appeon\’s Dw2Doc example project (MIT License).

Major changes include:

  • Migration from .NET 6 to .NET 8
  • Merging multiple projects into a single DLL
  • Upgrading NPOI and adding PolySharp for compatibility with .NET 481
  • Architectural and codebase restructuring for production use

Original project: https://g*i*thub.com*/Appeon/PowerBuilder-Dw2Doc-Example

Setup Instructions

Building the .NET Library

  1. Build the yuseok.kim.dw2docs project with dotnet publish:
    dotnet publish PowerBuilder-Dw2document.slnx -r windows -f <your target>
    

    (Possible target : net481, net6.0-windows, net8.0-windows)

PowerBuilder Setup

  1. Import the PowerBuilder object (dw_exporter.sru) into your PowerBuilder application:

    • Open your PowerBuilder application
    • Right-click on your target library in the System Tree
    • Select \”Import\”
    • Navigate to the location of dw_exporter.sru
    • Click Open
  2. Add the .NET assembly reference to your PowerBuilder project:

    • Open your PowerBuilder project
    • Select Project → Project Properties
    • Go to \”.NET Assemblies\” tab
    • Click \”Add\”
    • Browse to the location of yuseok.kim.dw2docs.dll
      • dll will be located on
        {repository_root}\\bin{target_framewokrs}
      • example
        • C:\\Source\\PowerBuilder-Dw2document\\bin\\net481\\yuseok.kim.dw2docs.dll
    • Select the assembly and click \”Open\”
    • Click \”OK\” to save the project properties
  3. Make sure the .NET assembly is accessible:

    • The yuseok.kim.dw2docs.dll file should be in your application\’s path
    • Either place it in a known system location or in your application\’s directory

Usage

// Create and initialize the exporter
dw_exporter lnv_exporter
lnv_exporter = CREATE dw_exporter
if not lnv_exporter.of_initialize() then
    MessageBox(\"Error\", \"Failed to initialize DataWindow exporter\")
    return
end if

// Export a DataWindow to Excel
string ls_xlsx_path = \"C:\\Reports\\MyReport.xlsx\"
string ls_result
ls_result = lnv_exporter.of_export_to_excel(dw_1, ls_xlsx_path, \"MySheet\")

// Export a DataWindow to Word
string ls_docx_path = \"C:\\Reports\\MyReport.docx\"
ls_result = lnv_exporter.of_export_to_word(dw_1, ls_docx_path)

// Don\'t forget to destroy the object when done
DESTROY lnv_exporter

Troubleshooting

If you encounter issues with the PowerBuilder/.NET integration:

our dll\’s defalut setting is create log file into C:\\temp
if you encounter issue, you can check C:\\temp\\Dw2Doc_ExcelError.log

  1. Verify the .NET assembly is properly built and accessible
  2. Check that the assembly is added to your PowerBuilder project
  3. Make sure the class name in of_initialize() matches exactly the one in the .NET code
  4. Check PowerBuilder\’s System Error log for .NET-related errors
  5. Try using the PowerBuilder .NET Assembly Browser to verify the assembly is loaded correctly
  6. If you get \”Class not found\” errors, make sure the namespace and class name match exactly
  7. For \”Method not found\” errors, check parameter types and counts in both PowerBuilder and .NET

下载源码

通过命令行克隆项目:

git clone https://github.com/yuseok-kim-edushare/PowerBuilder-Dw2document.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 编程相关 PowerBuilder Dw2document https://www.zuozi.net/33203.html

pokemon
上一篇: pokemon
Chinese BERT wwm
下一篇: Chinese BERT wwm
常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务