Home » Archived » BIRT » "'s (quotation marks) around csv items
"'s (quotation marks) around csv items [message #184038] |
Wed, 09 August 2006 15:37  |
Eclipse User |
|
|
|
I have a report where the csv needs to have qutoation marks around each
item. For example, the .csv file should look like this:
"column1","column2","column3"
"row1column1","row1column2","row1column3"
"row2column1","row2column2","row2column3"
....
....
....
For the headers, I simply renamed them in the Table Binding to include the
quotes. This works fine.
For the actual data, I tried changing the output Data Type to String for all
columns, and changing the expression to:
"\"" + dataSetRow["column1"] + "\"";
This generates the following output for the .csv:
"column1","column2","column3"
"""row1column1""","""row1column2""","""row1column3"""
"""row2column1""","""row2column2""","""row2column3"""
....
....
....
I have a feeling this is a bug, and I can file a bug report for it if that
sounds appropriate to anyone. In the meantime, is there another way to
generate the output I'm trying to get? I don't know if there's an easier
way to do it in the first place, or if someone can think of a good
workaround for this bug. I haven't been able to yet.
Thanks in advance,
floor
|
|
|
Re: "'s (quotation marks) around csv items [message #204254 is a reply to message #184038] |
Thu, 30 November 2006 21:54  |
Eclipse User |
|
|
|
This is a correct behavior.
In csv file, the approach to represent value '"' is """", please note the
first and last double quote is normal quote that enclose a string, the
second quote serves as escaper, and the third quote is the data content.
If you want a value '"ABC"' to be represented in a csv file, the csv file
would looks like follows: '"""ABC"""'.This is standard csv file format.
Thanks.
Lin
"floor" <floorflux@hotmail.com> wrote in message
news:ebddpd$nnl$1@utils.eclipse.org...
> I have a report where the csv needs to have qutoation marks around each
> item. For example, the .csv file should look like this:
>
> "column1","column2","column3"
> "row1column1","row1column2","row1column3"
> "row2column1","row2column2","row2column3"
> ...
> ...
> ...
>
> For the headers, I simply renamed them in the Table Binding to include the
> quotes. This works fine.
>
> For the actual data, I tried changing the output Data Type to String for
all
> columns, and changing the expression to:
>
> "\"" + dataSetRow["column1"] + "\"";
>
> This generates the following output for the .csv:
>
> "column1","column2","column3"
> """row1column1""","""row1column2""","""row1column3"""
> """row2column1""","""row2column2""","""row2column3"""
> ...
> ...
> ...
>
> I have a feeling this is a bug, and I can file a bug report for it if that
> sounds appropriate to anyone. In the meantime, is there another way to
> generate the output I'm trying to get? I don't know if there's an easier
> way to do it in the first place, or if someone can think of a good
> workaround for this bug. I haven't been able to yet.
>
> Thanks in advance,
>
> floor
>
>
>
|
|
|
Goto Forum:
Current Time: Sat Jun 21 14:01:14 EDT 2025
Powered by FUDForum. Page generated in 0.05462 seconds
|