Excel buffer: frame and line

wulrixwulrix Member Posts: 2
In Navision 4 SP3, we export sales quote to Excel, using standard Excel Buffer functions.

In fact, we use the same report to print and export the data to Excel, simply by adding code in the Sections of the report.

For example:
RoundLoop, Body (27) - OnPostSection()

IF CurrReport.SHOWOUTPUT THEN BEGIN
RowNo := RowNo + 1;
EnterCell(RowNo,ColumnNo,Description,FALSE,FALSE,FALSE);
END;

We want to extend the Excel buffer functions, so we can also draw lines and create Frames during the export to Excel.

Does anyone know how to draw a frame and a line ?

This might help:
this is the result in VB, after drawing a line in Excel while recording a Macro:
ActiveSheet.Shapes.AddLine(119.25, 58.5, 360.75, 58.5).Select
but we do not find the link with Navision automation servers XlRange, XlWrkSht...


Thanks.
William Ulrix
Dynamics NAV

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    I would recommend a technical upgrade to 5.00 instead.
    David Singleton
  • AlbertvhAlbertvh Member Posts: 516
    Hi William,
    I usually put the app into my report so that I can use these type of functions

    define the following variables
    Name DataType Subtype Length
    App Automation 'Microsoft Excel 11.0 Object Library'.Application
    Book Automation 'Microsoft Excel 11.0 Object Library'.Workbook
    Sheet Automation 'Microsoft Excel 11.0 Object Library'.Worksheet


    in the code I have done the following
    CreateBook;
    
    RowNo := 1;
    ColumnNo := 1;
    Range := GetColumnStr(1) + FORMAT(RowNo);
    Sheet.Range(Range).Select;
    Sheet.Range(Range).Activate;
    Sheet.Shapes.AddPicture(ENVIRON('TEMP') + '\Logo.bmp',1,1,0,0,150,50);
    Sheet.Shapes.AddLine(119.25, 58.5, 360.75, 58.5);
    
    
    CreateBook()
    CLEAR(App);
    CREATE(App);
    App.Visible(FALSE);
    Book := App.Workbooks.Add(-4167);
    
    
    Book.Worksheets.Add;
    Sheet := App.ActiveSheet;
    
    

    This will draw your line but as you can see I don't use the Excel Buffer table. Maybe you could add these function to the excel buffer table :?:

    Albert
Sign In or Register to comment.