Export to Excel

myanilkumarmyanilkumar Member Posts: 108
Hi all,

I am using standard Navision Export to Excel functionality to get output data to excel file.

When i export data is there any way i can fix the width of the cells. Because after exporting the columns are lapsing on each other.

I need to click on each colomn to enlarge the width. Please let me know on this.


Regards,
Anil

Comments

  • jannestigjannestig Member Posts: 1,000
    Doesn't this depend on the way you have setup your export template?
  • myanilkumarmyanilkumar Member Posts: 108
    I didnt setup any export template. I am adding rows & coloumns at run time dynamically.

    Is there any way to fix coloumn width during creation. Please let me know.

    Thanks,
    Anil
  • SavatageSavatage Member Posts: 7,142
    edited 2009-05-15
    I need to click on each colomn to enlarge the width. Please let me know on this.
    FYI
    click the top left corner box between A & 1 (it's blank)
    This will select the entire sheet.

    Place cursor between A & B (you'll get a double arrow) <-|->
    now double click -all columns should expand to the columns widest value.
    viola!
  • gvolkovgvolkov Member Posts: 196
    I need to click on each colomn to enlarge the width. Please let me know on this.

    I prefer using Excel Automation for exporting data into Excel. It requires some coding, but its not much more code than using built in function. With excel automation, all you need to do is.

    ExcelSheet.Range('A:Q').Columns.AutoFit;
    
    Microsoft Certified Technology Specialist
    Microsoft Certified Business Management Solutions Professional
    Microsoft Certified Business Management Solutions Specialist

    http://www.navisiontech.com
  • rsaritzkyrsaritzky Member Posts: 469
    gvolkov wrote:
    With excel automation, all you need to do is.
    ExcelSheet.Range('A:Q').Columns.AutoFit;
    

    Where did you go to learn about all the automation functions? Is there a document from Microsoft that explains what each of the functions do?
    Ron
  • gvolkovgvolkov Member Posts: 196
    MSDN has a lot of what you're looking for. just search for excel functions. Anything you do in excel can be automated. A good trick to get the commands you need is simply record a macro in in excel, and view the code. Then translate the VB code into CSIDE (this can be tricky too), and there you go.
    Microsoft Certified Technology Specialist
    Microsoft Certified Business Management Solutions Professional
    Microsoft Certified Business Management Solutions Specialist

    http://www.navisiontech.com
  • DenSterDenSter Member Posts: 8,304
    Another good way to figure out what the automation commands are is to open the macro recorder in Excel, and do what you want to do. Then when you're done, you stop the macro recorder, and everything that you did should show up in VBA code in one of the code modules in the macro VBA editor. Those VBA commands are part of the Excel object model, which is all available through the Excel automation server, which you can program with in C/AL code.
  • gvolkovgvolkov Member Posts: 196
    open the macro recorder in Excel, and do what you want to do. Then when you're done, you stop the macro recorder, and everything that you did should show up in VBA code

    I thought i said the same thing... :whistle:
    Microsoft Certified Technology Specialist
    Microsoft Certified Business Management Solutions Professional
    Microsoft Certified Business Management Solutions Specialist

    http://www.navisiontech.com
  • DenSterDenSter Member Posts: 8,304
    gvolkov wrote:
    I thought i said the same thing... :whistle:
    Strange... I could have sworn that when I replied to this all that you said was:
    gvolkov wrote:
    MSDN has a lot of what you're looking for. just search for excel functions.
    Did you add the macro recorder stuff to your post later? :-k
  • canadian_baconcanadian_bacon Member Posts: 91
    You can control this by editing the default Excel stylesheet. Go to form 690, export the default Excel stylesheet, open up the xslt file in Notepad, make your changes and import back in via form 690.
  • gvolkovgvolkov Member Posts: 196
    You can control this by editing the default Excel stylesheet.

    Canadianbacon, this is great tip. Especially for the percentages that export with 10 decimals from NAV. I will give this a try. Can you have different styles for different Accout Schedules? I made my soolution format the exported Account Schedules with automated macros.
    Microsoft Certified Technology Specialist
    Microsoft Certified Business Management Solutions Professional
    Microsoft Certified Business Management Solutions Specialist

    http://www.navisiontech.com
  • gvolkovgvolkov Member Posts: 196
    Did you add the macro recorder stuff to your post later?
    

    didnt make any adjustments to my post. 8) Its cool, no worries.
    Microsoft Certified Technology Specialist
    Microsoft Certified Business Management Solutions Professional
    Microsoft Certified Business Management Solutions Specialist

    http://www.navisiontech.com
Sign In or Register to comment.