Excel buffer already exists Error in Export to excel

chandrurecchandrurec Member Posts: 560
Dear all,

when I try to export to excel, I am getting a error named "Excel Buffer already Exists.Row no = 1 and Column No = 1 "

This error I am not gettinh all the times only when i try to export to excel without giving any filter for item no(i.e when i try to export all the items).

what may be the reason for this error.

Is anybody has any idea please let me know.

This is urgent issue

Thanks in advance.

Regards,
chandru.

Comments

  • kapamaroukapamarou Member Posts: 1,152
    Either wrong fill of Rows and Columns or the table has not been declared as Temp and there are entries in it.
  • chandrurecchandrurec Member Posts: 560
    Hi Kapamarou,

    I have set the temp property to yes for the excel buffer record variable but still i am getting the error.

    the other reason u have mentined wrong specificaiton of rows and columns can u explain me in detail ?

    Thanks in advance

    Regards,
    chandru.
  • kapamaroukapamarou Member Posts: 1,152
    When you insert a line you must specify the RowNo and ColumnNo fields. They make up the primary key. If in your code you don't increment them right, you'll get the error. Debug your code to see when the error occurs and figure out were you must increment those fields.
  • chandrurecchandrurec Member Posts: 560
    Hi Kapamarou,

    I cannot able to trace out where the the bug actually lies.

    can u do me a favour?

    please tell me your mail id so that i will forward the report object to ur mail so that u can do the changes and send me back the object so that i will look at the object and try to understand.

    Thanks in advance,

    Regards,
    chandru.
  • DenSterDenSter Member Posts: 8,307
    Don't you have a senior that you can ask for help?
  • chandrurecchandrurec Member Posts: 560
    Hi Denster,

    I asked my seniors but even they cannot able to resolve this issue and thats why I am asking Denster.

    Regards,
    chandru.
  • ara3nara3n Member Posts: 9,256
    Please post your code so we can see what you are doing wrong.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DenSterDenSter Member Posts: 8,307
    chandrurec wrote:
    I asked my seniors but even they cannot able to resolve this issue
    Seriously? None of the seniors knows how to debug a simple error?
  • astalavistaastalavista Member Posts: 26
    Thanks for this thread! I also encountered that error but after reading this thread I have changed the temporary property to yes.. Thank you!:)
  • knolvskyknolvsky Member Posts: 10
    i'm still got the problem :(
  • ssinglassingla Member Posts: 2,973
    DenSter wrote:
    chandrurec wrote:
    I asked my seniors but even they cannot able to resolve this issue
    Seriously? None of the seniors knows how to debug a simple error?

    Isn't this the right time to look for change of job?
    CA Sandeep Singla
    http://ssdynamics.co.in
  • sunnyksunnyk Member Posts: 280
    HI,
    R u incrementing your Row/Column after certain condition?
    Can you please drop us the code that you have written for Export to Excel thing.
  • ayushman40ayushman40 Member Posts: 2
    hi experts,
    am also getting the same error , am dropping u the code ,please help me..



    DateFilter := GETFILTER("Date Filter");
    {Window.OPEN(
    Text005 +
    '@\');
    Window.UPDATE(0,1);
    }
    RowNo := 1;
    ColumnNo := 1;

    Job - OnAfterGetRecord()

    EnterCell(RowNo,ColumnNo,Job."No.",TRUE,FALSE,'');
    EnterCell(RowNo,ColumnNo,Job."Global Dimension 1 Filter",TRUE,FALSE,'');
    EnterCell(RowNo,ColumnNo,Job."Global Dimension 2 Code",TRUE,FALSE,'');
    EnterCell(RowNo,ColumnNo,Job."Description 2",TRUE,FALSE,'');
    EnterCell(RowNo,ColumnNo,Job."Bill-to Customer No.",TRUE,FALSE,'');
    RowNo := RowNo + 1;
    ColumnNo := ColumnNo +1;

    Job - OnPostDataItem()

    EnterCell(RowNo : Integer;ColumnNo : Integer;CellValue : Text[250];Bold : Boolean;UnderLine : Boolean;NumberFormat : Text[30])
    ExcelBuf.INIT;
    ExcelBuf.VALIDATE("Row No.",RowNo);
    ExcelBuf.VALIDATE("Column No.",ColumnNo);
    ExcelBuf."Cell Value as Text" := CellValue;
    ExcelBuf.Formula := '';
    ExcelBuf.Bold := Bold;
    ExcelBuf.Underline := UnderLine;
    ExcelBuf.NumberFormat := NumberFormat;
    ExcelBuf.INSERT;

    CreateExcelbook()
    ExcelBuf.CreateBook;
    ExcelBuf.CreateSheet(
    ExcelBuf.GetExcelReference(10),
    Text005,
    COMPANYNAME,USERID);
    ExcelBuf.GiveUserControl;
    [-o<
  • kapamaroukapamarou Member Posts: 1,152
    Every call to EnterCell performs an insert.

    Increment RowNo every time you need to change the line.
    Increment ColumnNo every time you need to change the column.
    EnterCell(RowNo,ColumnNo,Job."No.",TRUE,FALSE,'');
    ColumnNo := ColumnNo +1;
    EnterCell(RowNo,ColumnNo,Job."Global Dimension 1 Filter",TRUE,FALSE,'');
    ColumnNo := ColumnNo +1;
    EnterCell(RowNo,ColumnNo,Job."Global Dimension 2 Code",TRUE,FALSE,'');
    ColumnNo := ColumnNo +1;
    EnterCell(RowNo,ColumnNo,Job."Description 2",TRUE,FALSE,'');
    ColumnNo := ColumnNo +1;
    EnterCell(RowNo,ColumnNo,Job."Bill-to Customer No.",TRUE,FALSE,'');
    
  • ayushman40ayushman40 Member Posts: 2
    Thank you kapamarou ,its working =D>
  • neellotusneellotus Member Posts: 18
    Dear all,

    I am try to export to excel, but I am getting an error "Excel Buffer already Exists. Identification fields and values: Row no = '1' and Column No = '1'

    I have also tried to set Temporary to Yes of Excel Buffer. Then Report running without any error but export to excel not working.


    what is the reason for this.

    Is anybody has any idea please let me know.


    Thanks in advance.

    Below is my report code:-

    On Excise Entry Date Item:-

    EnterCell(RowNo : Integer;ColumnNo : Integer;CellValue : Text[250];Bold : Boolean;UnderLine : Boolean)
    TempExcelBuffer2.INIT;
    TempExcelBuffer2.VALIDATE("Row No.",RowNo);
    TempExcelBuffer2.VALIDATE("Column No.",ColumnNo);
    TempExcelBuffer2."Cell Value as Text" := CellValue;
    TempExcelBuffer2.Formula := '';
    TempExcelBuffer2.Bold := Bold;
    TempExcelBuffer2.Underline := UnderLine;
    TempExcelBuffer2.INSERT;

    MakeExcelDataHeader()
    RowNo+=1;
    EnterCell(RowNo,2,'Document No.',TRUE,FALSE);
    EnterCell(RowNo,3,'Posting Date',TRUE,FALSE);
    EnterCell(RowNo,4,'Sell-to/Buy-from No.',TRUE,FALSE);
    EnterCell(RowNo,5,'Item No.',TRUE,FALSE);
    EnterCell(RowNo,6,'Quantity',TRUE,FALSE);
    EnterCell(RowNo,7,'Amount',TRUE,FALSE);
    EnterCell(RowNo,8,'BED %',TRUE,FALSE);
    EnterCell(RowNo,9,'PurchInvLine."Assessable Value"',TRUE,FALSE);
    EnterCell(RowNo,10,'BED Amount',TRUE,FALSE);
    EnterCell(RowNo,11,'BCD Amount',TRUE,FALSE);
    EnterCell(RowNo,12,'ADC VAT Amount',TRUE,FALSE);
    EnterCell(RowNo,13,'eCess Amount',TRUE,FALSE);
    EnterCell(RowNo,14,'SHE Cess Amount',TRUE,FALSE);
    EnterCell(RowNo,15,'Custom eCess Amount',TRUE,FALSE);
    EnterCell(RowNo,16,'Custom SHECess Amount',TRUE,FALSE);



    On Excise Entry Body Section :-

    Excise Entry, Body (2) - OnPreSection()
    IF "Export To Excel" THEN BEGIN
    RowNo += 1;

    EnterCell(RowNo,2,FORMAT("Document No."),FALSE,FALSE);
    EnterCell(RowNo,3,FORMAT("Posting Date"),FALSE,FALSE);
    EnterCell(RowNo,4,FORMAT("Sell-to/Buy-from No."),FALSE,FALSE);
    EnterCell(RowNo,5,FORMAT("Item No."),FALSE,FALSE);
    EnterCell(RowNo,6,FORMAT(Quantity),FALSE,FALSE);
    EnterCell(RowNo,7,FORMAT(Amount),FALSE,FALSE);
    EnterCell(RowNo,8,FORMAT("BED %"),FALSE,FALSE);
    EnterCell(RowNo,9,FORMAT(PurchInvLine."Assessable Value"),FALSE,FALSE);
    EnterCell(RowNo,10,FORMAT("BED Amount"),FALSE,FALSE);
    EnterCell(RowNo,11,FORMAT("BCD Amount"),FALSE,FALSE);
    EnterCell(RowNo,12,FORMAT("ADC VAT Amount"),FALSE,FALSE);
    EnterCell(RowNo,13,FORMAT("eCess Amount"),FALSE,FALSE);
    EnterCell(RowNo,14,FORMAT("SHE Cess Amount"),FALSE,FALSE);
    EnterCell(RowNo,15,FORMAT("Custom eCess Amount"),FALSE,FALSE);
    EnterCell(RowNo,16,FORMAT("Custom SHECess Amount"),FALSE,FALSE);

    END;

    Excise Entry, Body (2) - OnPostSection()

    EnterCell(RowNo : Integer;ColumnNo : Integer;CellValue : Text[250];Bold : Boolean;UnderLine : Boolean)
    TempExcelBuffer2.INIT;
    TempExcelBuffer2.VALIDATE("Row No.",RowNo);
    TempExcelBuffer2.VALIDATE("Column No.",ColumnNo);
    TempExcelBuffer2."Cell Value as Text" := CellValue;
    TempExcelBuffer2.Formula := '';
    TempExcelBuffer2.Bold := Bold;
    TempExcelBuffer2.Underline := UnderLine;
    TempExcelBuffer2.INSERT;

    MakeExcelDataHeader()
    RowNo+=1;
    EnterCell(RowNo,2,'Document No.',TRUE,FALSE);
    EnterCell(RowNo,3,'Posting Date',TRUE,FALSE);
    EnterCell(RowNo,4,'Sell-to/Buy-from No.',TRUE,FALSE);
    EnterCell(RowNo,5,'Item No.',TRUE,FALSE);
    EnterCell(RowNo,6,'Quantity',TRUE,FALSE);
    EnterCell(RowNo,7,'Amount',TRUE,FALSE);
    EnterCell(RowNo,8,'BED %',TRUE,FALSE);
    EnterCell(RowNo,9,'PurchInvLine."Assessable Value"',TRUE,FALSE);
    EnterCell(RowNo,10,'BED Amount',TRUE,FALSE);
    EnterCell(RowNo,11,'BCD Amount',TRUE,FALSE);
    EnterCell(RowNo,12,'ADC VAT Amount',TRUE,FALSE);
    EnterCell(RowNo,13,'eCess Amount',TRUE,FALSE);
    EnterCell(RowNo,14,'SHE Cess Amount',TRUE,FALSE);
    EnterCell(RowNo,15,'Custom eCess Amount',TRUE,FALSE);
    EnterCell(RowNo,16,'Custom SHECess Amount',TRUE,FALSE);

    Regards,
    Neel
  • dansdans Member Posts: 148
    where did you put the code to increase the column no ?
    Microsoft Certified IT Professional for Microsoft Dynamics NAV

    Just a happy frood who knows where his towel is
  • neellotusneellotus Member Posts: 18
    Dear Dans,

    I already tried with increase of column no and i was mentioned column no at the below or RowNo.

    Thanx

    neel
  • ara3nara3n Member Posts: 9,256
    Turn on the debugger and see where it stops. Then look at call-stack to see where you are calling it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.