In Excel file, header should print only one for Excel file

Scott_MejaScott_Meja Member Posts: 30
In one report i am exporting records to excel, but the header is printed for each and every record. As per client's requirements, the header should be printed only once in the excel file. I have set the properties of header as PrintOnEveryPage to no and i have written code in Presection of Header as
if boolean variable and (Currreport.pageno=1) then
the other part of coding.

For this line of code , i am still printing the labels of header in the first page in the excel file, but the header labels should be printed only once for the whole excel file. what else coding do i need to add.pls advice

Comments

  • BeliasBelias Member Posts: 2,998
    where are you writing the headers of excel file? Are you using excel buffer?
    If you write excel header in Onaftergetrecord trigger, you'll write the header multiple times.
    the layout you see in the preview does not matter at all with what you get in excel.

    You can print a list of customers in nav and write your name 5000 times in excel, if you want :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • devu_13devu_13 Member Posts: 101
    hi..
    for print the header in excel one time you have to write this code in header presection
    if (exporttoexcel) AND (currreport.pageno = 1) then begin 
    staement......
    end;
    
    
    Devendra Kr. Sharma
    IBIZ Consulting Services,India
  • BeliasBelias Member Posts: 2,998
    Or in onpredatatitem or in onprereport...try to avoid coding under the sections, if possible.
    Personally, i've never userd currreport.pageno instruction to determine if the header have to be printed or not.
    try to find a point where you know that nav processes only one time. (bad english, sorry) :oops:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.