zoukankan      html  css  js  c++  java
  • 导出csv文件

    static void NJ_MF_CheckProShape(Args _args)
    {
        NJ_Search_Inventory                 NJ_Search_Inventory;
        #AviFiles
        str                                 s,tempStr;
        int                                 i,RecCount;
        container                           c,conFilter = ["Excel Files(*.csv)", "*.csv"];
        SysOperationProgress                simpleProgress;
        TextBuffer                          textBuffer  = new TextBuffer();
        FileIoPermission                    perm;
        counter                             Lines;

        ;

        s = Winapi::getSaveFileName(0, conFilter, "","Save File", "", "");
        if (s)
        {
            select count(RecId) from NJ_Search_Inventory  where NJ_Search_Inventory.ACT_ProdShapeID == "";
            RecCount = NJ_Search_Inventory.RecId;
            simpleProgress = SysOperationProgress::newGeneral(#aviUpdate, 'Exporting...', RecCount);
            simpleProgress.setCaption("Data Export");
            simpleProgress.setAnimation(#AviFormLetter);
            startlengthyoperation();

            try
            {
                perm = new FileIoPermission(s, "w");
                perm.assert();
                textBuffer.appendText("tagBl,");
                textBuffer.appendText("BatchId,");
                textBuffer.appendText("ItemId,");
                textBuffer.appendText("Category,");
                textBuffer.appendText("ProductShape,");
                textBuffer.appendText("\n");

                while select NJ_Search_Inventory order by TagBl where NJ_Search_Inventory.ACT_ProdShapeID == ""
                {
                    //if (StrLen())

                    textBuffer.appendText(strReplace(strfmt("%1,",NJ_Search_Inventory.tagBL),"\n"," "));
                    textBuffer.appendText(strfmt("%1,",NJ_Search_Inventory.InventBatchId));
                    textBuffer.appendText(strfmt("%1,",NJ_Search_Inventory.ItemId));
                    textBuffer.appendText(strfmt("%1,",NJ_Search_Inventory.ACT_ItemCategoryId));
                    textBuffer.appendText(strfmt("%1,",NJ_Search_Inventory.ACT_ProdShapeID));
                    textBuffer.appendText("\n");

                    simpleProgress.incCount();
                    simpleprogress.setText(strfmt("Task: %1/%2", i,RecCount));
                    i++;
                }

                Lines = textBuffer.numLines();
                try
                {
                    if (textBuffer.toFile(s))
                        info(strfmt("记录导出到文件 %1.共导出了 %2 行记录.",s,Lines-1));
                }
                catch ( Exception::Error )
                {
                    error ("Generated file error.");
                }
                CodeAccessPermission::revertAssert();
                }

            catch (Exception::Deadlock)
            {
                retry;
            }
        }
    }

  • 相关阅读:
    CrossApp alpha 0.1.10 发布,跨平台移动应用开发引擎
    CrossApp 0.1.8 发布,跨平台移动应用开发引擎
    CrossApp 0.1.6 发布,跨平台移动应用开发引擎
    【开源访谈】CrossApp作者栗元峰访谈实录
    CrossApp 0.1.5 发布,跨平台移动应用开发引擎
    java第一 ++--
    MySQL数据库
    JQ方法实用案例///鼠标移动到div和修改ipt中弹窗、CSS鼠标变小手、JQ获取元素属性、JQ选择器
    轮播图!!!!
    查找列表框、下拉菜单控件、对表格元素/表单控件进行增删改操作、创建元素并且复制节点与删除、 对表格操作、通用性和标准的事件监听方法(点击后弹窗效果以及去掉效果)
  • 原文地址:https://www.cnblogs.com/perock/p/2297217.html
Copyright © 2011-2022 走看看