Dynamics Ax Report project bug.

On my env I have installed one ReportingService and 2 Axapta: DEV and TST. These axapta have different DB.
I deployed one report on DEV. It works.
After this report was deployed to TST, but the query used in report wasn’t moved to TST.

The bug: when I try to open the report in DEV it search the query in TST, and report return error : No query found.
How can I work in this case, where to set the axapta to deploy report?