Background: we have an application that generates reports from HTML (that may or may not have inline scripting). The HTML source is normally stored as a blob in the database.
There is now the need to hard-code a particular report into the application (i.e. so that it is not database dependent). I first tried it the brute force way (cutting and pasting the whole report into a const string and appending a whole lot of & vbNewLine & _
to it; that didn't work because there appears to be a limit to the number of & _
that can be used. I thought of compressing everything into (more or less) a single line, but not only would that hurt readability, it also wouldn't work for the inline scripting.
Something just occurred to me while writing this: I could open the file (containing the HTML I want to hardcode) programmatically and write the file's contents into a string. I'll give that a go now...
Can anyone suggest a better/more elegant way of doing this?