CE-881 - Refactoring exports & reports

- add some fields together into ReportDestination class
- pass more data into export streamers (views) and add preRun method
- Add queryHint POTENTIALLY_LARGE_NUMBER_OF_RESULTS
- add pivot views
- optionally take in full ReportMetaData object instead of a name (e.g., for a user-defined/saved report)
This commit is contained in:
2024-03-27 19:50:06 -05:00
parent 05f31d0722
commit e078015732
17 changed files with 421 additions and 165 deletions

View File

@ -26,6 +26,7 @@ import java.io.ByteArrayOutputStream;
import com.kingsrook.qqq.backend.core.actions.reporting.GenerateReportAction;
import com.kingsrook.qqq.backend.core.context.QContext;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.actions.reporting.ReportDestination;
import com.kingsrook.qqq.backend.core.model.actions.reporting.ReportFormat;
import com.kingsrook.qqq.backend.core.model.actions.reporting.ReportInput;
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QCriteriaOperator;
@ -204,9 +205,12 @@ public class GenerateReportActionRDBMSTest extends RDBMSActionTest
ReportInput reportInput = new ReportInput();
QContext.setQSession(new QSession().withSecurityKeyValue(TestUtils.SECURITY_KEY_STORE_ALL_ACCESS, true));
reportInput.setReportName(TEST_REPORT);
reportInput.setReportFormat(ReportFormat.CSV);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
reportInput.setReportOutputStream(outputStream);
reportInput.setReportDestination(new ReportDestination()
.withReportFormat(ReportFormat.CSV)
.withReportOutputStream(outputStream));
new GenerateReportAction().execute(reportInput);
return (outputStream.toString());
}