Change a text of query when report rendering

HasithaHasitha Sri Lanka
edited March 2012 in FastReport .NET
Hi,

Is there any way to change a text of query when report rendering? For example by passing part of the query through parameters and joining when report rendering.

For example:

Select * From Customers Where Code= {myparam}
Select * From Customers Where {myparam}
Select * From Customers {myparam}
Select * From {myparam} where code=1


Thanks in advance,

Hasitha.

Comments

  • edited 5:32AM
    Hello,

    Use the following code (may be in the Report.StartReport script event):

    TableDataSource table = Report.GetDataSource("MyTable") as TableDataSource;
    table.SelectCommand = "select * from ...";

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.