Hello Roddney,
1) You can add a condition to MakeNewReport call
For example, normally the report shows all invoices
my_project.MakeNewReport(
"report_1",
"mssql://...",
"SELECT * FROM invoices" )
But it also can show a subset or even a single invoice with a specified ID
my_project.MakeNewReport(
"report_1",
"mssql://...",
"SELECT * FROM invoices WHERE invoice = 1" )
2) In the latest versions (like 9.3+) you can use parameters for this task if you define the query in report like:
SELECT * FROM invoices $!P( pFilter )
$!P( pFilter ) will be replaced with condition (or an empty string if not specified)
And then you don't need to specify your base query again, just pass an empty string for it:
my_report=my_project.MakeNewReport(
"report_1",
"mssql://...",
"" )
Add condition when necessary
my_report.SetParameterValue( "pFilter", "WHERE invoice = 1" )