Dynamic Report

RamyaRamya cbe
edited 9:23PM in FastReport .NET
Hi Friends,

I want a report in which the query will be generated dynamically. How to display the report with the dynamic Query. Should I need to pass the Query as parameter. I am new to fast report. Please help me.

Comments

  • edited 9:23PM
    Hello,

    You need to change the query before generating a report:

    report.Load(...);
    TableDataSource query = report.GetDataSource("YourQuery") as TableDataSource;
    query.SelectCommand = "select * from ....";
    report.Show();
  • RamyaRamya cbe
    edited 9:23PM
    AlexTZ wrote: »
    Hello,

    You need to change the query before generating a report:

    report.Load(...);
    TableDataSource query = report.GetDataSource("YourQuery") as TableDataSource;
    query.SelectCommand = "select * from ....";
    report.Show();


    Hello AlexTZ,

    Am using fast report in asp.net with C#.
    As am new to fast report, please explain me in detail what we give in the .frx file and in the asp.net code side.

    My requirement is, I want to generate a report in which the number of columns and the actual column will be fixed dynamically by the user.

    Please help me.

    Thanks in advance.

    Ramya
  • edited 9:23PM
    You can change the sql text in the WebReport.StartReport event handler (i.e. in your asp.net code), or use the report script to do this. In the latter case, go the report designer, select the "Report" item in the Properties window, click the "Events" button and create an event handler for the StartReport event. The code would be:
    TableDataSource query = Report.GetDataSource("YourQuery") as TableDataSource;
    query.SelectCommand = "select * from ....";
    

    You may use report parameters to pass a query text. To do this, define a parameter and use it in the script:
    TableDataSource query = Report.GetDataSource("YourQuery") as TableDataSource;
    query.SelectCommand = (string)Report.GetParameterValue("SQLText");
    

    To pass a parameter value, use the WebReport.StartReport event handler:
    WebReport.Report.SetParameterValue("SQLText", your_text);
    

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.