field title on dataport

aldarionaldarion Member Posts: 24
hi everybody,

I want to export some data on a csv file that is not so complicated and it's done. But I want to add the name of the field I have exported so that when I put it on an exel sheet I can put easily a filter.
Is that possible with a dataport or must I create a report and use the function save as HTML?

thanks

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Your first dataitem needs to be one for table Integer. Set a filter so that only one record gets exported. In the dataport field list, write something like this (where you normally write the name of the field):
    recCust.FIELDCAPTION("No.")
    for every field you are exporting.

    This way, Navision retrieves the fieldnames from your table, and exports one line with the name of the fields.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • aldarionaldarion Member Posts: 24
    Thank you very much. It worked fine
  • DenSterDenSter Member Posts: 8,304
    Luc, You are the man! 8)

    We've been doing this kind of stuff with reports and programming file.WRITE commands. Running into problems with overflow of variables and stuff like that. This is SO much easier. This is really a very useful tip, you should post it in the tips and tricks forum.
  • WarrenLiuWarrenLiu Member Posts: 14
    DenSter wrote:
    Luc, You are the man! 8)

    We've been doing this kind of stuff with reports and programming file.WRITE commands. Running into problems with overflow of variables and stuff like that. This is SO much easier. This is really a very useful tip, you should post it in the tips and tricks forum.

    Hi Daniel

    I am new to the Navision programming. I've prepared a dataport to export Item card to a csv file. But my user requested to have the field name to be put on the first row. I found this post in the mibuso site. Could you please send me and samples code or inform me where I can get a sample code? Thanks.
    Warren
  • kikkomankikkoman Member Posts: 57
    this is the link provided on mibuso.com home page>how to (link)

    http://www.mibuso.com/howtoinfo.asp?FileID=8&Type=howto

    very useful....b/c i had to use this before!
  • WarrenLiuWarrenLiu Member Posts: 14
    kikkoman wrote:
    this is the link provided on mibuso.com home page>how to (link)

    http://www.mibuso.com/howtoinfo.asp?FileID=8&Type=howto

    very useful....b/c i had to use this before!

    Thank you very much for this great tip, it works fine.
    Warren
  • erugalathaerugalatha Member Posts: 120
    Is it possible to output a field caption that is NOT the heading from the record?

    i.e. I want to create my own headings for the columns but your method only allows for output of the names of fields that actually exist in the table.

    Thanks
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Sure, just use 'Your Caption' instead of Item.FIELDCAPTION("No.") in the dataport Field list.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • erugalathaerugalatha Member Posts: 120
    Thanks for your help
  • erugalathaerugalatha Member Posts: 120
    Just one more issue I am running into with this. After the field headings are output a blank line is output also - how would I stop this blank line from being output?

    On my Integer Data Item I have the following in the DataItemTableView property:
    SORTING(Number) WHERE(Number=CONST(1))

    Thanks
  • KowaKowa Member Posts: 918
    erugalatha wrote:
    Just one more issue I am running into with this. After the field headings are output a blank line is output also - how would I stop this blank line from being output?
    Thanks
    In the dataport properties the default value for the DataItemSeparator is <<NewLine><NewLine>>.
    Change this to: <NewLine>.
    Kai Kowalewski
  • Guilherme_NunesGuilherme_Nunes Member Posts: 1
    Hi.

    I was looking for information about this, and found this old post.

    I've used one of the solutions in this thread, but i first started to try using the CaptionML in the properties of the Dataport fields.

    In code i couldn't get that caption through FIELDCAPTION, that only returned me the CaptionML of the field in the table.
    This is not urgent, but it's a question that fly's in my head. Is it possible to use CaptionML of the dataport field?

    Thanks.
Sign In or Register to comment.