I’m trying to find a way to serialize a foundset. I am trying to run a jasper report against a serialized data.
serialize to what?
what does jasper report wants when it deserializes it?
Pure class/binary serializing can’t be done, the foundset needs to much state (like a client)
jcompagner:
serialize to what?
what does jasper report wants when it deserializes it?
Pure class/binary serializing can’t be done, the foundset needs to much state (like a client)
Jasper plugin’s runReport() currently requires a foundset object. I attempted to pass it a dataset but it failed. I haven’t checked to see if it would be possible to modify the jasper plugin to accept a dataset since the state information wouldn’t be important in this case.
You can convert your dataset to a foundset with js.createDataSource.
Jeroen de Vries:
You can convert your dataset to a foundset with js.createDataSource.
How can I do it? createDatasource returns a string, not a foundset (I see in Manual)
log-out:
Jeroen de Vries:
You can convert your dataset to a foundset with js.createDataSource.How can I do it? createDatasource returns a string, not a foundset (I see in Manual)
Thanks Jeroen! That was the part I was missing.
log-out, the way to do it is to create a form based off of the created datasource and then refering to that new form for the foundset. The code can look something like this which converts a foundset to a dataset and then back into a foundset. The benefit being the dataset could be serialized/deserialized.
var fs = forms.customers.foundset;
var ds = databaseManager.convertToDataSet(fs, ['customer_id', 'companyname']);
var fname = "mytestform";
var uri = ds.createDataSource('mydata', [JSColumn.TEXT, JSColumn.TEXT]);
var jsform = solutionModel.newForm(fname, uri, null, true, 300, 300);
var fs2 = forms[fname].foundset;
Wow! So I have to create a “virtual form” only for convert a dataset to a foundset
There may be a method like “convertToFoundset”…
There’s no need whatsoever to create a form to instantiate the foundset that is based on a JSDataSet: just do a databaseManager.getFoundSet(DatasourceString); with the dataSourceString you got from JSDataSet.createDataSource().
Paul
Ok, thanks!