create a report with character mode just like report builder - Forum - Community Groups - Progress Community

create a report with character mode just like report builder

 Forum

create a report with character mode just like report builder

  • Hi people, now I have a big problem... I need create a report with many items (thats not is the problem), on a format documents...

    I want to know if exist the way to create this report on .doc o .xls...

    this report isn't a 'normal' report because this report look just like a report made it with report builder, but a work with character mode...

    exist this way to create this report?

    Thanks a lot.

  • You can use Excel COM automation or Microsoft.Office.Interop.Excel namespace to generate your report.

  • Please, can you tell me if this COM exist inside of Progress OpenEdge character mode, and tell me how can use this COM in my report?

    Thanks a lot.

  • I'm not so sure about that. If your character client runs on Windows, you can try. I'm not seeing a documentation about COM automation only available in GUI.

    hExcel, hWorkSheet are COM-HANDLE.

    Here are fundamental parts;

    CREATE "excel.application" hExcel NO-ERROR.

    hWorkSheet = hExcel:Sheets:Item(1).

    hWorkSheet:Range("A:1"):Text = "SomeText".

  • thanks man... I see it to, but just works with GUI system...  I try with another idea, If works I comment my solution...

    IF WORKS!!!!...

  • It seems to work on Character Client running on Windows OS.

    NOTE: This process requires installing Microsoft Office.

  • COM certainly works in the Windows Character client as well.

    Here are a few sample bits: http://www.oehive.org/node/555

    On other platforms you may want to look into Alon Blichs "Word and Excel Utils". He basically directly creates xlsx files from the ABL.

    http://www.oehive.org/node/2096

    You can download a trial - but the Word and Excel Utils are a commercial product.

  • Check out http://www.oehive.org/project/libooxml ... that will work on any platform, including Unix servers.

    Consulting in Model-Based Development, Transformation, and Object-Oriented Best Practice  http://www.cintegrity.com

  • This is promising. I have some questions.

    Does it support importing xlsx document on UNIX?

    Can I assume that if using OpenOffice in UNIX, I also need the X-Windows or KDE Desktop installed?

    If I'm not going to view documents in UNIX just generate document, are there any other requirements aside from the r-code?

  • It supports only XLSX (no XLS) and requires no openoffice unless you want to convert docx to pdf or somesuch. If you're just generating documents, like we are on centOS Linux, you just need to add the libraries to your propath.

    We are paid users for the libooxml, but you can definitely test for free. To give you a headstart here's my template for generating XLSX from tt:

    {slibooxml/slibxlsx.i}

    {slib/slibos.i}

    /* {slib/sliberr.i} -- sliberr is more for GUI - I disable error handling as these are all automated routines */

    def var filename# as char no-undo.

    assign

    filename# = "./output/xx.xlsx".

    os-delete value (filename#) no-error.

    /* generate your tt here */

    run xlsx_createTemplate(

    input "stXlsx", /* stream */

    input "./excel/replace_basic.xlsx", /* blank file */

    input temp-table tt:handle, /* dataset handle or temp-table handle or query handle or buffer handle */

    input "", /* buffer can-do list */

    input "" ). /* field can-do list */

    run xlsx_replaceLongRange(

    input "stXlsx",

    input temp-table tt:handle,

    input "",

    input "",

    input "" ).

    run xlsx_save(

    input "stXlsx",

    input filename# ).

  • Can you also use the library to load and read XLSX file for import?

  • no. I still use a couple of activex routines I use for that. And it's strictly windows-based.

    AFAIK you cannot import XLSX or DOCX into ABL from *nix.

  • I do it...

    I found an example... that's not my solution, but maybe can help anyone

    http://knowledgebase.progress.com/articles/Article/P189645

    this works only in GUI...

    I work with this in the past... and works...

    I will read this info... thanks a lot

  • I can't found the solution for this problem and the converters I can't use them... please help.

  • I do it... I create the report in PDF, I use text2pdf.p to create this report.

    I create the report in .txt in this way.

    v_dir  as char.

    v_dir = '/home/user_name/reports/report01.txt'.

    output to value(v_dir)

    find first custom_tb where custom_tb.id_cte = '58247'

                                   and custom_tb.status_cte = 'a'

                                 no-lock no-error.

    if available custom_tb then do:

      put unformatted

        custom_tb.id_cte  '|' skip

        custom_tb.name   '|' skip

        custom_tb.addrs   '|' skip

        custom_tb            '|' skip.

        for each sales where sales.id_cte = custom.id_cte

                                 and sales.date_sale >= 01/01/12

                                 and sales.date_sale <= today

                              no-lock:

           put unformatted

             sales.date_sale     '|' skip

             sales.id_prod        '|'  skip

             sales.price_sale    '|'  skip.

        end.

    end.

    output close.

    2nd. replace de '|' with ^ ^,later, I put this report on a format "txt", and transform this txt to .doc

    3th. I use the text2pdf.p to create the report in PDF.

      you need configure the way to view the report, paper size, rectangles, lines or bar, type of character, etc. an put this reprt in this way with ext. *.cfg, example doc.cfg

       RUN text2pdf.p (INPUT "document.cfg",

                               INPUT "report",
                               INPUT "SALES LIST",
                               INPUT "V_DIR",
                               INPUT "/HOME/USER_NAME/REPORT/custlist.pdf").

    To download ‘ttf2pt1’ go to the following link:
    http://ttf2pt1.sourceforge.net/

    I PUT THE DOC FOR TEXT2PDF

    text2pdfdocumentation.pdf