public class CsvDataLoadOptions
extends java.lang.Object
To learn more, visit the LINQ Reporting Engine documentation article.
Remarks:
An instance of this class can be passed into constructors of CsvDataSource.
Examples:
Shows how to use CSV as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - CSV data destination (Java).docx");
CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.setDelimiter(';');
loadOptions.setCommentChar('$');
loadOptions.hasHeaders(true);
loadOptions.setQuoteChar('"');
CsvDataSource dataSource = new CsvDataSource(getMyDir() + "List of people.csv", loadOptions);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.CsvDataString.docx");
| Constructor and Description |
|---|
CsvDataLoadOptions()
Initializes a new instance of this class with default options.
|
CsvDataLoadOptions(boolean hasHeaders)
Initializes a new instance of this class with specifying whether CSV data contains column names at the first line.
|
| Modifier and Type | Method and Description |
|---|---|
char |
getCommentChar()
Gets the character that is used to comment lines of CSV data.
|
char |
getDelimiter()
Gets the character to be used as a column delimiter.
|
char |
getQuoteChar()
Gets the character that is used to quote field values.
|
boolean |
hasHeaders()
Gets a value indicating whether the first record of CSV data contains column names.
|
void |
hasHeaders(boolean value)
Sets a value indicating whether the first record of CSV data contains column names.
|
void |
setCommentChar(char value)
Sets the character that is used to comment lines of CSV data.
|
void |
setDelimiter(char value)
Sets the character to be used as a column delimiter.
|
void |
setQuoteChar(char value)
Sets the character that is used to quote field values.
|
public CsvDataLoadOptions()
Examples:
Shows how to use CSV as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - CSV data destination (Java).docx");
CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.setDelimiter(';');
loadOptions.setCommentChar('$');
loadOptions.hasHeaders(true);
loadOptions.setQuoteChar('"');
CsvDataSource dataSource = new CsvDataSource(getMyDir() + "List of people.csv", loadOptions);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.CsvDataString.docx");
public CsvDataLoadOptions(boolean hasHeaders)
Examples:
Shows how to use CSV as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - CSV data destination (Java).docx");
CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.setDelimiter(';');
loadOptions.setCommentChar('$');
loadOptions.hasHeaders(true);
loadOptions.setQuoteChar('"');
CsvDataSource dataSource = new CsvDataSource(getMyDir() + "List of people.csv", loadOptions);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.CsvDataString.docx");
public boolean hasHeaders()
Remarks:
The default value is false.
Examples:
Shows how to use CSV as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - CSV data destination (Java).docx");
CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.setDelimiter(';');
loadOptions.setCommentChar('$');
loadOptions.hasHeaders(true);
loadOptions.setQuoteChar('"');
CsvDataSource dataSource = new CsvDataSource(getMyDir() + "List of people.csv", loadOptions);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.CsvDataString.docx");
public void hasHeaders(boolean value)
Remarks:
The default value is false.
Examples:
Shows how to use CSV as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - CSV data destination (Java).docx");
CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.setDelimiter(';');
loadOptions.setCommentChar('$');
loadOptions.hasHeaders(true);
loadOptions.setQuoteChar('"');
CsvDataSource dataSource = new CsvDataSource(getMyDir() + "List of people.csv", loadOptions);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.CsvDataString.docx");
value - A value indicating whether the first record of CSV data contains column names.public char getDelimiter()
Remarks:
The default value is ',' (comma).
Examples:
Shows how to use CSV as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - CSV data destination (Java).docx");
CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.setDelimiter(';');
loadOptions.setCommentChar('$');
loadOptions.hasHeaders(true);
loadOptions.setQuoteChar('"');
CsvDataSource dataSource = new CsvDataSource(getMyDir() + "List of people.csv", loadOptions);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.CsvDataString.docx");
public void setDelimiter(char value)
Remarks:
The default value is ',' (comma).
Examples:
Shows how to use CSV as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - CSV data destination (Java).docx");
CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.setDelimiter(';');
loadOptions.setCommentChar('$');
loadOptions.hasHeaders(true);
loadOptions.setQuoteChar('"');
CsvDataSource dataSource = new CsvDataSource(getMyDir() + "List of people.csv", loadOptions);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.CsvDataString.docx");
value - The character to be used as a column delimiter.public char getQuoteChar()
Remarks:
The default value is '"' (quotation mark).
Double the character to place it into quoted text.
Examples:
Shows how to use CSV as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - CSV data destination (Java).docx");
CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.setDelimiter(';');
loadOptions.setCommentChar('$');
loadOptions.hasHeaders(true);
loadOptions.setQuoteChar('"');
CsvDataSource dataSource = new CsvDataSource(getMyDir() + "List of people.csv", loadOptions);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.CsvDataString.docx");
public void setQuoteChar(char value)
Remarks:
The default value is '"' (quotation mark).
Double the character to place it into quoted text.
Examples:
Shows how to use CSV as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - CSV data destination (Java).docx");
CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.setDelimiter(';');
loadOptions.setCommentChar('$');
loadOptions.hasHeaders(true);
loadOptions.setQuoteChar('"');
CsvDataSource dataSource = new CsvDataSource(getMyDir() + "List of people.csv", loadOptions);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.CsvDataString.docx");
value - The character that is used to quote field values.public char getCommentChar()
Remarks:
The default value is '#' (number sign).
Examples:
Shows how to use CSV as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - CSV data destination (Java).docx");
CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.setDelimiter(';');
loadOptions.setCommentChar('$');
loadOptions.hasHeaders(true);
loadOptions.setQuoteChar('"');
CsvDataSource dataSource = new CsvDataSource(getMyDir() + "List of people.csv", loadOptions);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.CsvDataString.docx");
public void setCommentChar(char value)
Remarks:
The default value is '#' (number sign).
Examples:
Shows how to use CSV as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - CSV data destination (Java).docx");
CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.setDelimiter(';');
loadOptions.setCommentChar('$');
loadOptions.hasHeaders(true);
loadOptions.setQuoteChar('"');
CsvDataSource dataSource = new CsvDataSource(getMyDir() + "List of people.csv", loadOptions);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.CsvDataString.docx");
value - The character that is used to comment lines of CSV data.