Can I RegisterDate in reportscript?

Can I create a report file and load data from external file with frx report script?

load report with designer, read multiple json files, sql query, mixed the data and put together in datatable then registerdata to report

Comments

  • Hello!

    Yes, you can create a DataTable or DataSet (by reading files or a database) and register them using Report.RegisterData(...) directly within the report script in the _StartReport handler.

    Example: 

    private void _StartReport(object sender, EventArgs e)
    {
        var dt = new System.Data.DataTable("MyData");
        dt.Columns.Add("Name", typeof(string));
        dt.Rows.Add("FromScriptRow1");
    
        Report.RegisterData(dt, "MyData");
        var ds = Report.GetDataSource("MyData");
        ds.Enabled = true;
        Data1.DataSource = ds;
    }
    

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.