How to Create Table In Excel Using ExcelBuffer

selece28selece28 Member Posts: 316
Hi All,
I've just read the post and example of using excel buffer to export report to excel.
But now i have a question, what if my report have table or lines.
How to draw table or lines to the exported excel using excel buffer.
Can we do that?

Regards,
Steven
______________

Regards,
Steven

Comments

  • Igor_BeeoneIgor_Beeone Member Posts: 80
    Hello,
    you can't export much formatting things using Excel Buffer table. Instead You can program yours own Excel export function with specific formatting/tables and so on.
    Also you can try export report as HTML file and redesign it to excel.
    Br,
    Igor Beeone
  • selece28selece28 Member Posts: 316
    Hi Igor,
    I think cannot Export as HTML and import as Excel then re-design.
    My client want the exported Excel look the same as on Nav Report.
    I think if the excel buffer cant do that, can i just add function on excel buffer table to draw the lines?

    Could you give some code example, how to draw table lines on excel?
    ______________

    Regards,
    Steven
  • Igor_BeeoneIgor_Beeone Member Posts: 80
    If You would look at 370 table you will see there such line:
    XlWrkSht.Range(xlColID + xlRowID).Borders.LineStyle := XlLineStyleNone;
    
    Where Cell Border is defined as blank.
    You can add additional field in Excel Buffer (omg:)) "Border Line Style" with possible next options:
    OptionName IntegerRepresentation
    xlContinuous 1
    xlDash -4115
    xlDashDot 4
    xlDashDotDot 5
    xlDot -4118
    xlDouble -4119
    xlSlantDashDot 13
    xlLineStyleNone -4142
    ---
    And make a case usage in the code changing above code:
    Write new function: SetBorderStyle (or whatever)where case clause must be programmed to return proper integer, and then change above code lin:
    XlWrkSht.Range(xlColID + xlRowID).Borders.LineStyle := SetBorderStyle;
    

    Example here as usually: http://igor.beeone.googlepages.com/BorderExample.zip
  • selece28selece28 Member Posts: 316
    Hello Igor,

    Thanks for your example. I just want to know, what is your object version?
    I'm Using Nav 4 SP3, i'm afraid if i import your example will cause an error.


    Thanks
    ______________

    Regards,
    Steven
  • selece28selece28 Member Posts: 316
    Hello Igor,

    Thanks for your example. I just want to know, what is your object version?
    I'm Using Nav 4 SP3, i'm afraid if i import your example will cause an error.


    Thanks
    ______________

    Regards,
    Steven
  • Igor_BeeoneIgor_Beeone Member Posts: 80
    Hello,
    It's 4.0 SP3 there, you can see the version in Versions List in object designer.
    But there is also additional programming for alignment post on MiBuSo.
    So there is three ways:
    1) import to a fresh database and take the functionality you need including it to Your DB :)
    2) create ExcelBuffer Ext. table (you will need to change number/name of the table, and after importing compile it, and make every report based on this table)
    3) Just replace the table if you trust the object you've downloaded.
    Make a choice.
    Firstly check on a fresh database if the functionality fits your needs.
    Br,
    Igor Beeone
  • SavatageSavatage Member Posts: 7,142
  • selece28selece28 Member Posts: 316
    Yep its very useful.

    Thanks Igor Beeone :)
    ______________

    Regards,
    Steven
Sign In or Register to comment.