CSV Export Tab

Return to Contents  Previous page  Next page

On the CSV Export tab you can specify what data you want to export.  You can export data in controls on the report or you can export fields from files, local variables, etc. as "columns"  The export is done immediately following the PRINT statement. 

 

CSV_Export_Tab

 

You can specify the separator character in the "CSV Separator" entry field.  It defaults to a comma.  Note that this is a single character only.

 

To add export fields, simply click the [Insert] button and it will take you to the insert/update form, which changes slightly if you select to use a "Control on Report" or "Column in a table".

 

CSV_Export_Fields_Control

 

CSV_Export_Fields_Column

 

For local, module or global variables you have to provide the header and field format.  For controls the header is taken from the dictionary for that field and the format is taken from the report.  For columns, the header and format for are taken from the dictionary.  The header defaults to the "Column Heading" for the column in the dictionary.

 

CSV_HeaderFromDCT

 

You can then add the "CSV Save Button" control template on the Previewer window and you are all set!  Yep, that is all there is to setting this up!

 

 

 

Below is an example of the generated code

 

ThisReport.TakeRecord PROCEDURE

ReturnValue          BYTE,AUTO

! Start of "Process Method Data Section"

! [Priority 3500]

SkipDetails BYTE

! [Priority 8500]

 

! End of "Process Method Data Section"

CODE

! Start of "Process Method Executable Code Section"

! [Priority 500]

! Activity for each processed record (PRINT)

! [Priority 1001]

!!

! Parent Call

ReturnValue = PARENT.TakeRecord()

! [Priority 5500]

PRINT(RPT:Detail)

! ProcessManager.TakeRecord (6000) Icetips Previewer, ABC

If Not ITCSVExport.GetFieldsAdded()

   SetTarget(Report)

     ! Start of "Icetips Previewer:  CSV Before INIT"

     ! [Priority 5000]

    

     ! End of "Icetips Previewer:  CSV Before INIT"

   ITCSVExport.Init(Report)

     ! Start of "Icetips Previewer:  CSV After INIT"

     ! [Priority 5000]

     Loc:PDFFileName = 'C:\temp\test.pdf'     

     ! End of "Icetips Previewer:  CSV After INIT"

   ITCSVExport.AddControl(?CUS:Name, 'Name', '@s60')

   ITCSVExport.AddControl(?CUS:FirstName, 'First Name', '@s30')

   ITCSVExport.AddControl(?CUS:LastName, 'Last Name', '@s30')

   ITCSVExport.AddField(CUS:FirstName, 'First Name', '@s30')

   ITCSVExport.AddField(CUS:LastName, 'Last Name', '@s30')

   ITCSVExport.AddField(Loc:PDFFileName, 'PDFFileName', '@S255')

   ITCSVExport.SetFieldsAdded(True)

     ! Start of "Icetips Previewer:  CSV After Registering"

     ! [Priority 5000]

    

     ! End of "Icetips Previewer:  CSV After Registering"

   SetTarget()

End

SetTarget(Report)

! Start of "Icetips Previewer:  CSV Before TakeRecord"

! [Priority 5000]

! End of "Icetips Previewer:  CSV Before TakeRecord"

ITCSVExport.TakeRecord()

! Start of "Icetips Previewer:  CSV After TakeRecord"

! [Priority 5000]

! End of "Icetips Previewer:  CSV After TakeRecord"

SetTarget()

! [Priority 8000]

! End of "Process Method Executable Code Section"

RETURN ReturnValue

 

 

 

 



Direct link to this page: http://www.icetips.com/manuals/previewer/csv_export_tab.htm