About Me

My photo
Software Developer and ideas man!

Thursday, June 11, 2015

Ant Regex for updating SCOM MP version information in mpproj file

One think I had fun doing today was using ant's Perl v5 regex expressions to write in the version info of our build process into the SCOM Management Pack prior to building with MSBuild - I could have used the auto-increment feature of VSAE but this would not have been synchronized with the ant build properties we use for our other binaries that is part of a wider build deployment.

So, looking for a solution I thought I'd explore ant's regexs - the statement below works by matching on the version xml tags and groups them along with existing version info before substituting in the ant version properties used as part of the wider build process in the management pack project file.  

 <replaceregexp file="${SCOM.dir}/Pauls.mpproj"                     
byline="true"
match="(<Version>)([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)(<\/Version>)"
replace="\1${VersionMajorNo}\.${VersionMinorNo}\.${VersionPatchNo}\.${VersionBuildNo}\3"/>

So
  1.0.0.5
becomes
  11.2.0.278

Monday, June 8, 2015

Localizing Legends in Crystal Reports

To localize the legends in my Crystal Reports Graphs I had effectively change my SQL "select statements" at runtime to incorporate column aliases.

For example, my original sql statement looks like this

SELECT `Copy_of_ivv`.`Trading_Date`, `Copy_of_ivv`.`High`, `Copy_of_ivv`.`Low`
 FROM   `Copy of ivv`

To get the legends to display in chinese, you have to alias the columns returned which appears to drive the legend names

 SELECT `Copy_of_ivv`.`Trading_Date` as '交易日', `Copy_of_ivv`.`High` as '高', `Copy_of_ivv`.`Low` as '低'
 FROM   `Copy of ivv`