RegisterData not working
Hi. I'm using a dataset and try to set to report, but not working....
This dataset has 10 records, but when I ran the reports, the report show all records. I checked that the query that the report was processed was the query used to design the report.
What I make wrong?
// create report instance
Report report = new Report();
// load the existing report
report.Load(@"..\..\report.frx");
// register the dataset
report.RegisterData(dataset, "Vendas");
report.GetDataSource("Vendas").Enabled = true;
// run the report
report.Show();
// free resources used by report
report.Dispose();
This dataset has 10 records, but when I ran the reports, the report show all records. I checked that the query that the report was processed was the query used to design the report.
What I make wrong?
This discussion has been closed.
Comments
You can get the query used to design the report and change the sql query.
I'm not happy wiht this solution, because other class is responsible to create the sql command.
There are other topic with the same problem without answer. The fast report staff don't look to the forum?
Have you tried to remove your data source from report, and add the new after?
I think the staff doesn't see this forum...
If you have relations in the report you would need to open the report in a text editor and manually remove the connections leaving the relations intact.
There is a way to edit the report file source to leave the DataSources usable in the Editor without the actual database connection being present. I can try to elaborate if interested. Keep in mind it falls under the hack category as well.
There are other topic with the same problem without answer. The fast report staff don't look to the forum?
magento 2 seo suite
All you have to do :
1. You have blank frx file as a template, open designer.exe , save as blank_report.frx
2. Create a code in .net application
3. After finish with report designer, save the frx file
4. Comment / Uncomment code above
Mageplaza Magento 2 Seo
Magento 2 Seo
How to show fast report in other Form when save finished. Example I design Form1 a report, but I want show Form 2. How to do?? thanks
How to show blank_report.frx at other form???
Hello!
If you wish to use an existing .frx file but pass data strictly from your C# code:
In the report designer, do not connect to the actual database. Create an abstract data source (via the Data menu -> New Data Source -> Register Data from Application, or by passing an empty schema using `dataset.Clone()`). The .frx file will contain a blank data source:
<TableDataSource Name="Vendas" ReferenceName="Vendas">In this case, RegisterData is bound by the ReferenceName and is guaranteed to display exactly 10 of the rows passed.
If you wish to keep the SQL query execution within the report, do not filter the DataSet manually in C# instead, add a parameter to the report and to the SQL query (WHERE ID IN (@Ids) or WHERE Date >= @StartDate), and pass the value in the code:
report.SetParameterValue(‘StartDate’, DateTime.Today);