Skip to content

Commit

Permalink
added fix for ajryan#45
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherpickering committed Nov 18, 2021
1 parent 489c390 commit 0878538
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions RptToXml/RptDefinitionWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Security.Cryptography;
using System.Text;
using System.Xml;
using System.Runtime.ExceptionServices;

using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportAppServer.ClientDoc;
Expand Down Expand Up @@ -439,6 +440,7 @@ private void GetDataDefinition(ReportDocument report, XmlWriter writer)
writer.WriteEndElement();
}

[HandleProcessCorruptedStateExceptionsAttribute]
private void GetFieldObject(Object fo, ReportDocument report, XmlWriter writer)
{
if (fo is DatabaseFieldDefinition)
Expand Down Expand Up @@ -474,15 +476,20 @@ private void GetFieldObject(Object fo, ReportDocument report, XmlWriter writer)
var gnf = (GroupNameFieldDefinition)fo;

writer.WriteStartElement("GroupNameFieldDefinition");

writer.WriteAttributeString("FormulaName", gnf.FormulaName);
writer.WriteAttributeString("Group", gnf.Group.ToString());
writer.WriteAttributeString("GroupNameFieldName", gnf.GroupNameFieldName);
writer.WriteAttributeString("Kind", gnf.Kind.ToString());
writer.WriteAttributeString("Name", gnf.Name);
writer.WriteAttributeString("NumberOfBytes", gnf.NumberOfBytes.ToString(CultureInfo.InvariantCulture));
writer.WriteAttributeString("ValueType", gnf.ValueType.ToString());

try
{
writer.WriteAttributeString("FormulaName", gnf.FormulaName);
writer.WriteAttributeString("Group", gnf.Group.ToString());
writer.WriteAttributeString("GroupNameFieldName", gnf.GroupNameFieldName);
writer.WriteAttributeString("Kind", gnf.Kind.ToString());
writer.WriteAttributeString("Name", gnf.Name);
writer.WriteAttributeString("NumberOfBytes", gnf.NumberOfBytes.ToString(CultureInfo.InvariantCulture));
writer.WriteAttributeString("ValueType", gnf.ValueType.ToString());
}
catch( Exception e)
{
Console.WriteLine($"Error loading formula for group '{gnf.GroupNameFieldName}', {e}");
}
}
else if (fo is ParameterFieldDefinition)
{
Expand Down

0 comments on commit 0878538

Please sign in to comment.