Showing posts with label spaces. Show all posts
Showing posts with label spaces. Show all posts

Thursday, March 8, 2012

Control names of fields when exporting to CSV

My query returns fields that have spaces in the names, for example:

select o.OrderID as 'INVOICE NUMBER', etc..

When I created the DataSet for this query in report designer, it changed all spaces in the field names to underscores, i.e. INVOICE_NUMBER.

This report must be exported to CSV, and the names of the fields (first row in csv) must have the spaces, not underscores. But it appears RS uses the field names (not the names in the column headers of the report table control) as the field names. Is there any way for me to force the field names in the first row of the csv to something other than the field names in the DataSet?

Thanks!

I think I you should be able to rename the column headers to change the results in the CSV file.


HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

ALFKI,

You can go to the column properties data output tab and enter the "Element Name" and select output as "Yes" this is how I can my export to csv files.

Ham

|||

should read

"how I change my export column names in the csv files"

|||Thanks - the only problem is, Element Name cannot contain a space , hence the underscores. Oh, well...|||

ALFKI,

Sorry, Yes, you are still bounded by the textbox property field names. You could not for instance name a textbox "My Textbox Value" is must be My_TextBox_Value. I mistaken thought you were just trying to rename the field.

Ham

Saturday, February 25, 2012

CONTAINS with substring

I have a table field that is full-text indexed. I am trying to locate
records where a substring of data is present in a string without spaces. The
format is something like this:
"AAAAAABBAAAA"
If I am looking for the existence of "AABBA" in the string, CONTAINS
apparently will not work, because this command works only with complete words
with spaces between. So this type of query fails:
CONTAINS(fieldname, "AABBA")
or
CONTAINS(SUBSTRING(fieldname, 5,5), "AABBA")
Is there a way to use CONTAINS with substrings like this?
seeker
No, the only thing you can do is store the string in reverse in your table
you are FTI'ing, and then reserve the search string and do wildcarding. This
only works if you are searching for suffixes, not letter patterns in the
middle of a word/token.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"seeker" <seeker@.discussions.microsoft.com> wrote in message
news:3F5BA0DE-AC1B-44A0-886E-8D54E2AFC3A0@.microsoft.com...
> I have a table field that is full-text indexed. I am trying to locate
> records where a substring of data is present in a string without spaces.
The
> format is something like this:
> "AAAAAABBAAAA"
> If I am looking for the existence of "AABBA" in the string, CONTAINS
> apparently will not work, because this command works only with complete
words
> with spaces between. So this type of query fails:
> CONTAINS(fieldname, "AABBA")
> or
> CONTAINS(SUBSTRING(fieldname, 5,5), "AABBA")
> Is there a way to use CONTAINS with substrings like this?
> --
> seeker