>>The piece of code below basically writes a button to the screen. This is done many times to creates rows of times increments and columns of rooms for a scheduler (xx = rows and yy = columns). Since this code is running anyway, and I need to create a report that represents the screen, can I use this code somehow to create my report? It's already pretty clunky, even for legacy code, so all ideas welcome.
>>
>>
>>@ xx -1, 8 + but_size * ( yy - 1 ) SAY ALLTRIM(m.ApptRuleRemCode) + ;
>> REPLICATE( " ", but_size - (LEN(ALLTRIM(m.ApptRuleRemCode)))) STYLE 'U' COLOR ( m.ApptRuleSlotColor )
>>
>One thing you could experiment with:
>- create a report cursor with a single character column long enough to contain all the characters in a single screen row
>- create some sort of GenRow() function that can create a character representation of a single screen row. Hopefully the code you show above is called in some sort of orderly top-to-bottom, left-to-right manner or some such that can make your life easier
>- spin through all your rows, call GenRow() for each and INSERT its output into the report cursor
>- on the report, put the report cursor character column in the Detail band, and use a fixed font. Style 'U' is underline, so you can use an underline font. It might look better with a separate row of dashes or underscores below each row of "buttons" instead.
That's a great idea! Have as many fields in the detail bands as I have columns (yy). Loop through the rows (xx) and generate output. That's exactly how the code works, starts at 1,1 and goes across, then down for the next row. Thanks!