I found one blog which can help me but I ran into the same problem where the query is returning null from the report.
msdax.wordpress.com/.../how-to-set-the-query-range-on-a-ssrs-report
SRSReportRun reportRun = new SRSReportRun("maInventoryValuationAuditorsReport.maDesign");
// Create variables for setting the range for the query.
Query query;
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
int i;
TransDate parmFromDate = 08\09\2015;
TransDate parmToDate = today();
// Check if the query will return data.
if (reportRun.init())
{
// Find the report's query.
query = reportRun.reportQuery("maInventoryValuationReportForAuditQuery"); // query name of the report
if (query != null) // query is null
{
// Get the Customers data source.
queryBuildDataSource = query.dataSourceTable(tableNum(GeneralJournalEntry));
if (queryBuildDataSource != null)
{
queryBuildRange = queryBuildDataSource.addRange(fieldName2Id(queryBuildDataSource.table(), "AccountingDate"));
queryBuildRange.value(queryRange(parmFromDate,parmToDate));
}
}
// Save the report settings.
reportRun.saveSettings();
// Run the report.
reportRun.run();
}
query is empty for some reason.
Please help.