We have a requirement of sending report in excel and text format files to user by fetching the results from Report Definition. For sending text file need to convert data to pipe delimited text. For eg:
101|Cus1|Male
102|Cus2|Female
Report data contain more than 5 k records. Need suggestions for text file conversion.
Use a single background activity to generate the file by looping through the Report Definition results and building each row as a pipe-delimited string. Call the report, iterate over the result list, and for each record append values like ID + “|” + Name + “|” + Gender into a StringBuilder-style property, adding a new line after each row. Once all rows are processed, write the complete string to a text file using a file utility method or repository API. This approach handles large volumes like 5k+ records efficiently and avoids memory issues by processing in one controlled flow.