Escaping characters in XML for Visual Studio ReportViewer

aveysel

New Member
I am building my own RLDC for a Report Viewer object in Visual Studio. I allow the user to pick a format for the date. I can't get support for the G format though.Tuesday, April 17, 1923 I have created a template so to speak and I am injecting the value the user supplies into the rldc right before providing it to the report viewer to display. This is the code I supply:\[code\]"=FormatDateTime(Fields!eDateTime.Value,1)"\[/code\]This is the actual Table Cell in XML that gets fed to the report viewer:\[code\]<TableCell><ReportItems><Textbox Name="eDateTime_1"><rd:DefaultName>eDateTime_1</rd:DefaultName><Style><BorderStyle><Default>Solid</Default><Bottom>Solid</Bottom></BorderStyle><FontSize>10pt</FontSize><FontWeight>700</FontWeight><Format>=FormatDateTime(Fields!eDateTime.Value,1)</Format> <-------------<PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom></Style><ZIndex>2</ZIndex><CanGrow>true</CanGrow><Value>=Fields!eDateTime.Value</Value></Textbox></ReportItems></TableCell>\[/code\]The problem is this is what the user views on after that is processed in the report-viewer.\[code\]We1ne01a12, AuA.D.u0A 01, 2012\[/code\]As you can see the cell is translating all the format characters: d, s, any y as if they're format keywords. how do I communicate that the output value of this cell is to be interpreted as a string literal and escape the translating of those letters to date/time format keywords.
 
Back
Top