Hello,
I would like to show negative currency values with the negative symbol instead of bracket in the telerik report. E.g. -$101.00 instead of ($203.00) or -€101.00 instead of (€101.00) - we use different currencies in the app. I set this.Culture.NumberFormat.CurrencyNegativePattern = 1; in the *.Designer.cs file. The application compiles correctly and the values show properly, but the report in the design mode has an error:
at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
Do you have the information how to fix the issue?
5 Answers, 1 is accepted
This is the summary at the top of the *.Designer.cs file:
#region Component Designer generated code
/// <summary>
/// Required method for telerik Reporting designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private
void
InitializeComponent()
If possible, place any custom code in the *.cs file of the report (in the report's constructor).
Regards,
Nasko
Progress Telerik
private void InitializeComponent()
{
this.entityDataSource1 = new Telerik.Reporting.EntityDataSource();
this.detail = new Telerik.Reporting.DetailSection();
this.textBox1 = new Telerik.Reporting.TextBox();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
//
// entityDataSource1
//
this.entityDataSource1.ConnectionString = "GeneralDataContext";
this.entityDataSource1.Context = typeof(General.Data.Models.GeneralDataContext);
this.entityDataSource1.ContextMember = "GetData";
this.entityDataSource1.Name = "entityDataSource1";
//
// detail
//
this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
this.textBox1});
this.detail.Name = "detail";
//
// textBox1
//
this.textBox1.Name = "textBox1";
this.textBox1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1.2000001668930054D), Telerik.Reporting.Drawing.Unit.Inch(0.20000000298023224D));
this.textBox1.Format = "{0:C}";
this.textBox1.Value = "= Fields.value";
//
// Report
//
this.Culture = new System.Globalization.CultureInfo("en-US");
this.Culture.NumberFormat.CurrencyNegativePattern = 1;
this.DataSource = this.entityDataSource1;
this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
this.detail});
this.Name = "Report";
((System.ComponentModel.ISupportInitialize)(this)).EndInit();
}
#endregion
private Telerik.Reporting.DetailSection detail;
private Telerik.Reporting.EntityDataSource entityDataSource1;
private TextBox textBox1;
You are still changing code manually inside the InitializeComponent method in *.Designer.cs. You should not be doing that, as this will break the report designer.
The *.Designer.cs file should not be modified manually:
#region Component Designer generated code
/// <summary>
/// Required method for telerik Reporting designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private
void
InitializeComponent()
If you modify this file in any way, the report designer will break, exactly as shown in your screenshot.
Instead of doing that, please move the custom code to the report's constructor.
Regards,
Nasko
Progress Telerik
It works, thanks.
It works, thanks.