Home
Analytics
Grid Binding
vj-raghav
hi,
i have a report with a grid(mygrid) ,the grid has been bound to a dataset(say:GridDataset),the data set call's a stored procedure in QUERY section to fill its values.
when i bond the dataset to the grid and drag-drop required columns and run the report it works perfectly fine ,But when i change the database the grid shows empty rows.
solutions tried:
1)double checked the stored procedure for possible dependency.(i,e.may be used "databasename.table name") but no use its was neat. ^_^
2)checked if the same parameters return value in mysql ,and yes that part is good. the call works fine in any database.
3)the order of the parameter's in dataset as per the stored procedure
Problem:
1)unable to identify where the problem is and why i had to re bind the grid with a dataset and drag-drop all the time when a database is changed.
Find more posts tagged with
Comments
mwilliams
Have you tried going to the binding tab of the grid and hitting "refresh"?
vj-raghav
thanks williams ,but when i deploy it in a application ,cannot refresh the dataset all the time and copy-back the report design file .
"yes similar to the refreshing from binding tab i right clicked on the data set and refreshed it ,then bound it back to the grid and drag-dropped all the columns to the rows in grid and it worked "
-but i cannot do it all the time and copy back the design file to application,pls suggest any more possible solutions to try if some 1 have faced the same prob.
regards,
raghav
mwilliams
How are you switching databases? By a parameter within your dataSource? Or what? Also, what is your BIRT version? Are your column names all exactly the same? Please let me know. If you can reproduce this using flat file, xml, or scripted dataSets so that I can see the issue happen, please attach such an example so I can test. Thanks!
vj-raghav
hi Williams,
the refreshing works but manually had to refresh the dataset as well as the table or elements bound to that dataset
is there a way to dynamically refresh the data-sets as well as the data bindings for the elements bound to the data-set
thanks in advance
vj-raghav
i have been searching forums and found out that the refresh button only add's new dataset columns to the binding ,but i even have to remove the unused or columns that are now not avail in dataset from the bindings tab .......
please suggest some solution .cause when the application is deployed the database it uses will be different to what i am using to develop report ,so manual refresh and remove buttons available will not fit my requirements .
i need some methods or script that can refresh bindings as well as remove the unavail bindings dynamically
thanks in advance!!
mwilliams
If you're talking about from within the designer, you'll probably have to do it the manual way. I don't know of another. I guess you could just design your tables dynamically in the beforeFactory method. This would allow you to adjust your bindings depending on what database you use.
vj-raghav
// added this in adaptor event handler class
Module module = reportContext.getReportRunnable().getDesignHandle().getModule();
List<DesignElement> allElements = module.getAllElements();
for (DesignElement designElement : allElements) {
DesignElementHandle handle1 = designElement.getHandle(module);
if (handle1 instanceof ReportItemHandle) {
ReportItemHandle reportItemHandle = (ReportItemHandle) handle1;
if (reportItemHandle != null){
reportItemHandle.removedUnusedColumnBindings();
}
}
}
//imports for code
import org.eclipse.birt.report.model.api.elements.structures.ComputedColumn;
import org.eclipse.birt.report.model.core.DesignElement;
import org.eclipse.birt.report.model.core.Module;
hey mike...this code will remove the unused bindings for any element in the report dynamically and re bind new avail bindings .....hope this is useful for any 1 else
mwilliams
Awesome! Thanks for the update! This could make a good tip to add in the devShare, as well!
actuser9
<p>Any ideas as to how to create a data set parameter binding on a grid linked to a data set from a data object? Any inputs are appreciated.</p>