Page 1 of 2
Refresh fields in datasource
Posted: Wed Aug 06, 2014 1:29 am
by dlangford
Hi,
We're just evaluating your product, but can't figure out how to achieve this...
I have a report that is linked to a sql view, and want to add a field to the view then have it available in the report designer.
After adding a field to a view used in a report, I've tried opening the report, going to the Dictionary panel, then going Actions -> Syncronize...but the new field doesn't appear.
Hopefully there's a simple way for the designer to see the database changes...
Thanks in advance,
Dave.
Re: Refresh fields in datasource
Posted: Wed Aug 06, 2014 6:53 am
by Alex K.
Hello, Dave
Please try to use the "RetrieveColumn" button in the edit datasource window for the necessary datasource.
Thank you.
Re: Refresh fields in datasource
Posted: Tue Jul 09, 2019 11:18 am
by petrdivis
Hi,
can this be achieved programatically when having custom StiUserSource and StiUserAdapterService? So the column appears in Dictionary on the right
thanks!
Re: Refresh fields in datasource
Posted: Thu Jul 11, 2019 9:20 pm
by Lech Kulikowski
Hello,
You can use RegData() and Synchronize() methods.
Thank you.
Re: Refresh fields in datasource
Posted: Mon Jul 15, 2019 1:37 pm
by petrdivis
Hello,
unfortunatelly, the RegData creates a new DataSource "test" instead of replacing our "GEONIS/test" datasource
- GeonisReportDesigner_2019-07-15_15-34-53.png (4.29 KiB) Viewed 3101 times
the code:
Code: Select all
StiReport.Load(filePath);
UpdateAssemblies();
foreach (StiDataSource stiReportDataSource in StiReport.DataSources)
{
if (stiReportDataSource.GetDataAdapter() is GReportAdapterService gds)
{
DataTable gDataTable = gds.FetchColumns(stiReportDataSource as GReportDataSource);
StiReport.RegData(stiReportDataSource.Name, gDataTable);
}
}
StiReport.Dictionary.Synchronize();
Re: Refresh fields in datasource
Posted: Mon Jul 15, 2019 8:48 pm
by Lech Kulikowski
Hello,
You should use the same name of the DataSet(GEONIS) and Table(test) in the RegData() method.
Thank you.
Re: Refresh fields in datasource
Posted: Tue Jul 16, 2019 6:17 am
by petrdivis
Thanks, I tried as you suggested with
RegData("GEONIS", gDataTable) but it didnt refresh missing column.
the mrt looks like this:
- Notepad2_2019-07-16_08-04-30.png (51.2 KiB) Viewed 3091 times
I tried to delete DOCUMENT column from the DB, but in Dictionaries in Designer it does not refresh.
- GeonisReportDesigner_2019-07-16_08-08-27.png (15.01 KiB) Viewed 3091 times
The "GEONIS" is category name in the GReportDataSource.
Code: Select all
public override string GetCategoryName()
{
return "GEONIS";
}
Re: Refresh fields in datasource
Posted: Tue Jul 16, 2019 7:34 am
by Lech Kulikowski
Hello,
Please check:
report.Dictionary.DataSources.Clear();
report.RegData("");
report.Dictionary.Synchronize();
Thank you.
Re: Refresh fields in datasource
Posted: Tue Jul 16, 2019 8:55 am
by petrdivis
That is weird, even if i do
report.Dictionary.DataSources.Clear();
report.Dictionary.Synchronize();
the Data Sources in Dictionary UI does not get empty.
Re: Refresh fields in datasource
Posted: Tue Jul 16, 2019 1:38 pm
by Lech Kulikowski
Hello,
Please send us a sample project which reproduces the issue for analysis.
Thank you.