Sunday, February 19, 2012

CSV, Render method and encoding

Hi there,
I'm creating my report using the Render method and the format is set to
"CSV". I found that when my report is opened using Excel, each row is treated
as one long string and Excel does not seem to recognise the commas as
demiliters.
After googling, it seemed that the default encoding of the report as Unicode
was the cause of this, so I passed in "ASCII" as the encoding type for the
Render method, however, Excel is still not recognising the commas as
delimiters. Am I missing something?
CheersOk, found out why this wasn't working...I was passing "ASCII" as the Encoding
argument (the 8th srgument) to the Render method, which I really should have
realised is actually a ByRef argument.
What I should have been doing is passing
"<DeviceInfo><Encoding>ASCII</Encoding></DeviceInfo>" to the DeviceInfo
argument (the 4th argument) of the Render method.
Once I did that, the report formatted as a CSV opened up fine in Excel.
Doh! Dune
"Dune" wrote:
> Hi there,
> I'm creating my report using the Render method and the format is set to
> "CSV". I found that when my report is opened using Excel, each row is treated
> as one long string and Excel does not seem to recognise the commas as
> demiliters.
> After googling, it seemed that the default encoding of the report as Unicode
> was the cause of this, so I passed in "ASCII" as the encoding type for the
> Render method, however, Excel is still not recognising the commas as
> delimiters. Am I missing something?
> Cheers|||Dune,
I'm new to RS, so any help would be appreciated. Where did you put that
line of code in at? I've got users asking for ASCII format as well.
Thanks,
Chris
"Dune" wrote:
> Ok, found out why this wasn't working...I was passing "ASCII" as the Encoding
> argument (the 8th srgument) to the Render method, which I really should have
> realised is actually a ByRef argument.
> What I should have been doing is passing
> "<DeviceInfo><Encoding>ASCII</Encoding></DeviceInfo>" to the DeviceInfo
> argument (the 4th argument) of the Render method.
> Once I did that, the report formatted as a CSV opened up fine in Excel.
> Doh! Dune
> "Dune" wrote:
> > Hi there,
> >
> > I'm creating my report using the Render method and the format is set to
> > "CSV". I found that when my report is opened using Excel, each row is treated
> > as one long string and Excel does not seem to recognise the commas as
> > demiliters.
> >
> > After googling, it seemed that the default encoding of the report as Unicode
> > was the cause of this, so I passed in "ASCII" as the encoding type for the
> > Render method, however, Excel is still not recognising the commas as
> > delimiters. Am I missing something?
> >
> > Cheers

No comments:

Post a Comment