Groups | Blog | Home
all groups > sql server reporting services > february 2005 >

sql server reporting services : language property BUG when using expressions.



klumsy NO[at]SPAM gmail.com
2/28/2005 8:10:54 PM
in one of my projects i was dynamically setting the Language property
of tables, textboxes etc , but it just wasn't working.. For my needs i
solved the problem by rather setting dynamic Formats however i still
thing this is a bug..

it is shown in the example below..
i have textboxes where each are set to

=code.mydate which just returns a datetime

the first textbox has language set to default (which is english (US)
so the date
gets shown in MM/DD/YYYY format
the next one is set to English (United Kingdom) so it correctly
shows it as DD/MM/YYYY
however when i set it to English (United Kingdom) via a function or
even just an expression ="English (United Kingdom)" it doesn't work..
the language property only works when it is static, not dynamic.

Karl

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition"
xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Textbox Name="textbox4">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<Format>d</Format>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<Language>="English (United Kingdom)"</Language>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<Top>0.875in</Top>
<Height>0.25in</Height>
<Width>1.75in</Width>
<CanGrow>true</CanGrow>
<Value>=code.mydate</Value>
<Left>0.25in</Left>
</Textbox>
<Textbox Name="textbox3">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<Format>d</Format>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<Language>=code.languagefunc</Language>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<Top>1.25in</Top>
<rd:DefaultName>textbox3</rd:DefaultName>
<Height>0.25in</Height>
<Width>1.75in</Width>
<CanGrow>true</CanGrow>
<Value>=code.mydate</Value>
<Left>0.25in</Left>
</Textbox>
<Textbox Name="textbox2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<Format>d</Format>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<Language>en-GB</Language>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<Top>0.5in</Top>
<rd:DefaultName>textbox2</rd:DefaultName>
<Height>0.25in</Height>
<Width>1.75in</Width>
<CanGrow>true</CanGrow>
<Value>=code.mydate</Value>
<Left>0.25in</Left>
</Textbox>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<Format>d</Format>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<Top>0.125in</Top>
<rd:DefaultName>textbox1</rd:DefaultName>
<Height>0.25in</Height>
<Width>1.75in</Width>
<CanGrow>true</CanGrow>
<Value>=code.mydate</Value>
<Left>0.25in</Left>
</Textbox>
</ReportItems>
<Style />
<Height>2.875in</Height>
</Body>
<TopMargin>1in</TopMargin>
<Code>Public Function mydate as DateTime
return CDATE("2005-5-30")
End Function

Public Function languagefunc as string
return "English (United Kingdom)"
End Function</Code>
<Width>6.5in</Width>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<Description />
<rd:ReportID>b3046005-89ba-47b1-aa40-b446a2205b39</rd:ReportID>
<BottomMargin>1in</BottomMargin>
<Language>en-US</Language>
Robert Bruckner [MSFT]
2/28/2005 10:21:21 PM
The language property follows ISO standard language abbreviations. You can
also check this webpage:
http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes or here:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/language_codes.asp

Hence, en-US and en-GB are valid language abbreviations, while "English
(United Kingdom)" or "English (United States)" are not. You should actually
see a publishing warning message if you set the language property to the
string constant "English (United Kingdom)". If you use an expression, you
would see a processing warning which however is visible e.g. on the SOAP
API, but not e.g. through HTML Viewer.

The UI in Visual Studio may be misleading a little bit because it shows the
"nice" language names rather than the abbreviations. But if you look at the
generated RDL, you will see the abbreviations. Just try en-GB in the report,
and it should work.

HTH,
Robert

--
This posting is provided "AS IS" with no warranties, and confers no rights.




[quoted text, click to view]

AddThis Social Bookmark Button