Showing posts with label theclient. Show all posts
Showing posts with label theclient. Show all posts

Friday, March 30, 2012

Problems with the ReportViewer Control

Theclient side reportviewer control is used with a typed dataset in vs 2005.

But I have noticed something that is really interesting,

theturkish characters in the dataset are changed in the runtime enviroment when used with the reportviever control.

such as.

exec sp_executesql N'SELECT CASES._ID, CASES._OWNERID, CASES._LASTMODIFYDATE, CASES._DELETIONSTATUS, CASES._SECURITYCODE,
CASES._NAME, CASES._STATE,
CASES._DESCRIPTION, CASES._CATEGORY, CASES._TYPE, CASES.PRIORITY, CASES.REASON, CASES.ORIGIN, CASES.FROMDATE,
CASES.TODATE,
CASES.COMMENT, CASES.WHATID, CASES.WHATTYPE, VIEW_WHONAME.WHONAME, ORGANIZATION._NAME AS ORGANIZATIONNAME,
PERSON.HOMETEL, PERSON.EMAIL
FROM CASES INNER JOIN
VIEW_WHONAME ON CASES.WHOID = VIEW_WHONAME.WHOID INNER JOIN
PERSON ON VIEW_WHONAME.WHOID = PERSON._ID INNER JOIN
ORGANIZATION ON PERSON.WORKINGORGANIZATIONID = ORGANIZATION._ID
WHERE (CASES._OWNERID = @.ownerID) AND (CASES._ID = @.entityID) AND (VIEW_WHONAME.WHOTYPE =''KİÅ?İ'')',N'@.ownerID
smallint,@.entityID int',@.ownerID=1,@.entityID=30

-----------

>>> the bold area should be 'K???' which is a turkish string...

What sholud I do? Do I need to configure the sql server or do I need to configure asp.net runtime?

Is the data type of VIEW_WHONAME.WHOTYPE NVARCHAR? If yes, that means you've stored the unicode characters in SQL, so just make sure you're comparing it to unicode chars at runtime. You can mark a string as UNICODE in SQL by adding a N prefix in front of the string:

VIEW_WHONAME.WHOTYPE =N''KİÅ?İ''

|||

I did tried that but still the dataset in the app_code changes the string at runtime.When I test the dataset designer at design time, everything is just fine.

if there any configuration I have to make to stop asp.net runtime changing my strings?

----------------------------

exec sp_executesql N'SELECT CASES._ID, CASES._OWNERID, CASES._LASTMODIFYDATE, CASES._DELETIONSTATUS, CASES._SECURITYCODE,
CASES._NAME, CASES._STATE,
CASES._DESCRIPTION, CASES._CATEGORY, CASES._TYPE, CASES.PRIORITY, CASES.REASON, CASES.ORIGIN,
CASES.FROMDATE, CASES.TODATE,
CASES.COMMENT, CASES.WHATID, CASES.WHATTYPE, VIEW_WHONAME.WHONAME, ORGANIZATION._NAME AS ORGANIZATIONNAME,
PERSON.HOMETEL, PERSON.EMAIL
FROM CASES INNER JOIN
VIEW_WHONAME ON CASES.WHOID = VIEW_WHONAME.WHOID INNER JOIN
PERSON ON VIEW_WHONAME.WHOID = PERSON._ID INNER JOIN
ORGANIZATION ON PERSON.WORKINGORGANIZATIONID = ORGANIZATION._ID
WHERE (CASES._OWNERID = @.ownerID) AND (CASES._ID = @.entityID) AND (VIEW_WHONAME.WHOTYPE =N''KİÅ?İ'')',N'@.ownerID
smallint,@.entityID int',@.ownerID=1,@.entityID=30

|||finally I have sp?ved the problem by jsut saving the dataset using advanced save options and I gave the apporopiate encoding to it.|||finally I have solved the problem by just saving the dataset using advanced save options and I gave the apporopiate encoding to it.