ajryan/RptToXml

Include number formatting configuration

Opened this issue · 2 comments

I suspect like many others, I have just started using the tool in an attempt to provide some sort of audit trail/diff in Git when modifying Crystal Reports.

I just updated the format of a numeric field and re-generated the xml. To my surprise, it is exactly the same.

I will try and take a look at the source and see if it's something I can add in, but quite hectic at the moment.

Thanks for the great tool!

I've just taken a quick look. I guess we would want to add something around

else if (reportObject is FieldObject)

I don't think we're currently extracting any field formatting. But it looks like we might want to check fo.DataSource.ValueType, then we know which fo.FieldFormat property to examine?

For fo.FieldFormat.NumericFormat it shouldn't be too bad, I think we only have 5 properties to extract:

CurrencySymbolFormat
DecimalPlaces
EnableUseLeadingZero
NegativeFormat
RoundingFormat

It may be a bit more of a PITA for date/datetime.

I also wonder how simple the mapping is from the enum:

    [CLSCompliant(true)]
    public enum FieldValueType
    {
        Int8sField = 0,
        Int8uField = 1,
        Int16sField = 2,
        Int16uField = 3,
        Int32sField = 4,
        Int32uField = 5,
        NumberField = 6,
        CurrencyField = 7,
        BooleanField = 8,
        DateField = 9,
        TimeField = 10,
        StringField = 11,
        TransientMemoField = 12,
        PersistentMemoField = 13,
        BlobField = 14,
        DateTimeField = 15,
        BitmapField = 20,
        IconField = 21,
        PictureField = 22,
        OleField = 23,
        ChartField = 24,
        SameAsInputField = 250,
        UnknownField = 255
    }

Any words of wisdom if i'm to try throwing together a PR?

Sorry I missed this - yes please send out a PR if you are able.