Hello,
I have a CSV export that needs some fields qualified by double quotes and
some that do not. How do I control this behavior in Reporting Services?
I have tried specifying a blank text qualifier in rsreportserver.config and
surrounding the applicable fields by double quotes but that doesn't work as
the double quote qualifier gets repeated.
TIA,
Ray
SS2K5On Jan 7, 4:06 pm, raybouk <rayb...@.discussions.microsoft.com> wrote:
> Hello,
> I have a CSV export that needs some fields qualified by double quotes and
> some that do not. How do I control this behavior in Reporting Services?
> I have tried specifying a blank text qualifier in rsreportserver.config and
> surrounding the applicable fields by double quotes but that doesn't work as
> the double quote qualifier gets repeated.
> TIA,
> Ray
> SS2K5
The quickest way to accommodate this is to use casting in SSRS (i.e.,
CStr(Fields!SomeFieldName.Value)). You would cast the fields that you
need to have quotes around. Also, you could use the format part of the
Properties tab for the fields you need to have the quotes around. An
expression similar to this might work: ="''#''" Another alternative
(more reliable, though more work) would be to use a StreamReader and
StreamWriter after the fact (after exporting the report to a given
format) to read in the report file into a string or stringbuilder,
then use String.Replace() (or String.Format()) and then output the
file with the quote identifiers for certain fields. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment