Options

EXCEL BUFFER - MULTIWORKSHEETS IN SINGLE WORK BOOK

bharethbhareth Member Posts: 55
edited 2011-05-26 in NAV Three Tier
Hi ,
I have a report with one data item .
After exporting to excel : I want the body section of the report to be exported onto one worksheet wereas the Header ,Group Footer and footer section on the other worksheet .
can anyone advice me how to proceed? :roll:

Thanks,
bhareth .

Comments

  • Options
    deV.chdeV.ch Member Posts: 543
    you could add a new field "Worksheet" to excelbuffer table. Then you enter different values for body and the other sections. Then you just filter on this values and call CreateSheet for each sheet.

    in code:
    ExcelBuf.Setrange(Worksheet,'Sheet1');
    ExcelBuf.CreateSheet('Sheet1',...);
    ExcelBuf.Setrange(Worksheet,'Sheet2');
    ExcelBuf.CreateSheet('Sheet2',...);
    
  • Options
    bharethbhareth Member Posts: 55
    Thanks you very much dev .I have achieved the result.but the results in excel sheet has lot of empty rows due to shifting the data to another sheet.

    is there is anyway to delete the empty rows while exporting the report to excel . =D>

    Thanks,
    bhareth
  • Options
    deV.chdeV.ch Member Posts: 543
    the data should be entered in the row you speciefied in the entry you created. i assume you just count up an integer value "row" and use that one for header, group header, and body. You sould use a row counter for each Sheet.
  • Options
    bharethbhareth Member Posts: 55
    ya dev you are right .i am using the count up of integer value "row" no (row no field in excel buffer ).

    can you pls throw some points or some examples of how to use a row counter for each Sheet. ](*,)
    IF ExportToExcel THEN BEGIN
    
              TempExcelBuffer.SETRANGE(Worksheet,'sheet1');
              TempExcelBuffer.CreateBook;
              TempExcelBuffer.CreateSheet('1','Description',COMPANYNAME,USERID);
              TempExcelBuffer.SETRANGE(Worksheet,'sheet2');
              TempExcelBuffer.AddSheet();
              TempExcelBuffer.CreateSheet('2','Description',COMPANYNAME,USERID);
    
    TempExcelBuffer.GiveUserControl;
    
    END;
    

    Thanks,
    bhareth
  • Options
    deV.chdeV.ch Member Posts: 543
    well you just use 2 integervalues row1 / row2 and at the place you insert your ExcelBuffer Record you either use Row1 or Row2...

    you said you have different sections (body, header, groupHeader) and you need to seperate the output of body and header/groupHeader, to do that count up row1 at body section and row2 at header/groupheader section. for further guidance we need your code from the sections (body,header,...) where you insert the records
  • Options
    bharethbhareth Member Posts: 55
    dev i am using 329 - vendor trail balance report .
    were i am in need to bring( Header, Group Header,Group Footer,Footer) of the report in one sheet and Body in another worksheet .
    can you provide me guidance of how to use integer values. ](*,)

    Thanks,
    Bhareth .
  • Options
    bharethbhareth Member Posts: 55
    Dev I got the result \:D/ \:D/ \:D/ \:D/

    i use integervalues row1 / row2 and do a increment counting of row1 at header/groupheader section and row2 at body section and updated excel buffer table .

    Output is perfect .Many thanks for your guidance . =D> =D> =D>

    Thanks,
    bhareth
  • Options
    HanenHanen Member Posts: 281
    Is there another way to do that? Something like deleting the data and calling the excelbuffer makedata somewhere on sections???
    Any ideas? :cry: :oops:
    Regards

    Hanen TALBI
  • Options
    SogSog Member Posts: 1,023
    Global: currentSheet
    Function: Addsheet(description:text30)
    {
    currentsheet := description;
    currentrow := 0;
    newrow;
    }
    modified function addcolumn to insert currentsheet in the new field worksheet with every insert.
    And copied function createsheet to createmultisheet which I found here on Mibuso.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
Sign In or Register to comment.