ssrs 2005 export to csv issue
Hello,
I am exporting a report from SSRS 2005 to CSV format.
I have set the device info Encoding to ASCII.
I have two fields ord and type and a total count field at the end.
When I export to CSV the file looks like this:
textbox4
textbox25
textbox10
order
type
ord
typ
Total:
17
288744
IM
ord
typ
Total:
17
288724
MT
ord
typ
Total:
17
288557
MT
ord
typ
Total:
17
280307
CA
ord
typ
Total:
17
288722
MS
ord
typ
Total:
17
288023
IN
ord
typ
Total:
17
279791
CU
ord
typ
Total:
17
288699
DP
ord
typ
Total:
17
288717
MT
ord
typ
Total:
17
287994
TR
ord
typ
Total:
17
258522
IN
ord
typ
Total:
17
288752
MT
ord
typ
Total:
17
288383
MT
ord
typ
Total:
17
287081
CA
ord
typ
Total:
17
287986
CA
ord
typ
Total:
17
288620
EF
ord
typ
Total:
17
288719
MT
But the file should look like this:
order
type
288744
IM
288724
MT
288557
MT
280307
CA
288722
MS
288023
IN
279791
CU
288699
DP
288717
MT
287994
TR
258522
IN
288752
MT
288383
MT
287081
CA
287986
CA
288620
EF
288719
MT
TOTAL: 17
How can I eliminate the unwanted/unnecessary fields???
Setting the device info header to no-header did not solve it.
Please help!
Thanks.
July 14th, 2011 12:03am
Hi mexl,
Does the report preview on BIDS and report preview on Report Server (before exporting) looks good to you?
How many columns you have when you execute the report (before exporting to any of the file)?
Please let us know your feedback.
Thanks
KumarKG, MCTS
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2011 12:07am
Hi,
Yes, the report preview on BIDS and Report Server looks good
I have 2 columns.
Thanks.
July 14th, 2011 12:20am
Hi Again,
Can you try exporting to Excel or pdf ( I mean other formats)?
Does it happens the same?
Thanks
KumarKG, MCTS
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2011 12:32am
Hi,
In Excel and PDF, it does not happen. Looks good in excel and pdf.
July 14th, 2011 12:53am
Hi mexl,
Thanks for your question, could you please give the report's design steps for us to reproduce your scenario. Here I do a test in local environment, you can see below:
The actual display in report goes like this:
Field Field1 Field2
A 2 12
B 8 8
Total 10 20
And the output when exported to csv should be as follows:
Total TField1 TField2 Field Field1 Field2
Total 10 20 A 2 12
Total 10 20 B 8
8
This behavior is by design. In the report designer, there are 3 rows within the table. One row is the table headers, "Field", "Field1", and "Field2". One row is for the actual values of "Field", "Field1", and "Field2". This
row in the designer is what corresponds to the rows you see as (A,2,12) and (B,8,8). The last row is for the subtotal row, which corresponds to what you see as ("Total", 10, 20). The csv renderer is outputting what you see because the subtotal row exists
as separate static textboxes (they are not associated with the same group as the row above it) within the table.
For you to obtain your desired result in the csv renderer, one way would be within your SQL query, return the last row as "Total", "10", and "20", instead of using a subtotal row altogether.
You can also try exporting to excel, as excel will preserve layout of data (hence "Total", 10, and 20 will appear below "B", 8, and 8) whereas csv renderer has its own rules for rendering data only, since it disregards layout.
Thanks,
Challen FuPlease remember to mark the replies as answers if they help and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
July 18th, 2011 2:16am


