Home General

CSV export: Variable number of columns

edited February 2012 in General
Hi,

To automate an existing workflow with reportbuilder I need to produce a csv
file where each line consists of some fixed columns and some variable number
of columns. Is this possible with RB?
I was thinking of a report with a subreport where the subreport is
generating the variable number of columns.

fixed1, fixed2, fixed3, var1-1, var1-2, var1-3, var2-1, var2-2, var2-3
fixed1, fixed2, fixed3, var1-1, var1-2, var1-3
fixed1, fixed2, fixed3, var1-1, var1-2, var1-3, var2-1, var2-2, var2-3,
var3-1, var3-2, var3-3
fixed1, fixed2, fixed3, var1-1, var1-2, var1-3
fixed1, fixed2, fixed3, var1-1, var1-2, var1-3, var2-1, var2-2, var2-3

Using D2007, RB11.08 and RB14.03

Kind regards,
Jeroen R?ttink

Comments

  • edited February 2012
    Hi Jeroen,

    Your idea should work correctly. In my quick testing I was able to
    alter the number of columns used per iteration of a single subreport
    during generation. I needed to alter the Subreport.Report.Columns
    property inside a TppVariable.OnCalc event to ensure the change only
    occurred once per record. This however may not apply in your case.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2012
    Hi Nico,

    I don't understand how this influences the generation of the csv file.

    Regards,
    Jeroen.


  • edited February 2012
    Sorry, I apparently ignored the CSV implications. No report columns
    needed however your subreport idea is still valid.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2012
    Hi Nico,

    Sorry, but I don't understand.

    My situation:
    Orders and order lines. Each order has 1..n order lines.
    An external program needs a csv file where each line contains the data of 1
    order. Besides order specific fields, the line also must contain 1..5 order
    lines.
    So each line in the csv file doesn't necessarily contain the same number of
    fields.

    In my testing each report band is always exported as a record. E.g. ending
    with CRLF.

    Kind regards,
    Jeroen.



  • edited February 2012
    Hi Jeroen,

    I apologize, I did not understand your initial requirements.

    Yes, the text file device treats each band as a separate line in the
    text file generated. The device is simply not designed to produce a
    horizontal output like you need. One option would be to create a
    TppTextFileDevice descendent that alters the way each band is handled.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.