java.lang.Object
com.aspose.words.CsvDataLoadOptions
public class CsvDataLoadOptions
To learn more, visit the LINQ Reporting Engine documentation article. Example:
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 Summary |
|---|
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. |
| Property Getters/Setters Summary | ||
|---|---|---|
char | getCommentChar() | |
void | setCommentChar(char value) | |
| Gets or sets the character that is used to comment lines of CSV data. | ||
char | getDelimiter() | |
void | setDelimiter(char value) | |
| Gets or sets the character to be used as a column delimiter. | ||
boolean | hasHeaders() | |
void | hasHeaders(boolean value) | |
| Gets or sets a value indicating whether the first record of CSV data contains column names. | ||
char | getQuoteChar() | |
void | setQuoteChar(char value) | |
| Gets or sets the character that is used to quote field values. | ||
| Constructor Detail |
|---|
public CsvDataLoadOptions()
Example:
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)
Example:
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");| Property Getters/Setters Detail |
|---|
getCommentChar/setCommentChar | |
public char getCommentChar() / public void setCommentChar(char value) | |
Example:
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");getDelimiter/setDelimiter | |
public char getDelimiter() / public void setDelimiter(char value) | |
Example:
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");hasHeaders/hasHeaders | |
public boolean hasHeaders() / public void hasHeaders(boolean value) | |
false.
Example:
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");getQuoteChar/setQuoteChar | |
public char getQuoteChar() / public void setQuoteChar(char value) | |
The default value is '"' (quotation mark).
Double the character to place it into quoted text.
Example:
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");