I'm using Crystal Reports Basic for Visual Studio 2008 to generate a report from a database. In the database there is a "structured data" field called data. It is a way of representing a Hashtable and the format is:
XLLLKeyYMMMValue where: X is the length of the length of the Key L is the length of the Key Y is the length of the length of the Value M is the length of the Value
so if I were to encode
Name = John Robert Oxley Age Of Poor Little Developer = 27
I would have.
Name (L = 4 therefore X = 1) John Robert Oxley (M = 17 therefore Y = 2) Age Of Poor Little Developer (L = 28 therefore X = 2) 27 (M = 2 therefore Y = 1)
so the field for this record would contain
14Name223John Robert Oxley228Age Of Poor Little Developer1227
There are a number of fields that I know I want in the report. They may not be in the data field in the table however. Now for my questions
- I'm guessing I have to create a custom function parseStructuredData(data, field) which returns the field I want or null if not present.
- Are there any resources on the net for custom functions or a book that I should buy for Crystal Reports (preferably ebook) as I have very little experience?
- Then do I use a "Formula Field" to put it on the report?
Update This is running on MS SQL server but I would prefer not to use a stored procedure to parse the data as I don't want to modify the database.