Master- and Subreport with two scripted datasources with parameters [message #187674] |
Mon, 28 August 2006 16:58  |
Eclipse User |
|
|
|
Originally posted by: thmwg.web.de
Hi together,
IŽve a problem which drives be crazy. I try to generate a
master-/subreport with two scripted datasources and I do not know how to
pass the parameter from the master to the subreport. Here is my code
Scripted Source #1
open :
modelClass = new Packages.de.thmwg.scripted.ModelReport();
models = modelClass.readModel();
totalModels = models.size();
currentModel = 0;
fetch :
if (currentModel >= totalModels) {
return (false);
}
var model = models.get(currentModel);
row["oidModel"] = model["oidModel"];
row["strBezeichnung"] = model["strBezeichnung"];
params["paramsModel"] = row["oidModel"];
currentModel = currentModel+1;
return (true);
And the scripted Datasource #2
open :
fgClass = new Packages.de.thmwg.scripted.ModelReport();
fgs = fgClass.readFG(params["paramsModel"]);
totalFGs = fgs.size();
currentFG = 0;
fetch :
if (currentFG >= totalFGs) {
return (false);
}
var fg = fgs.get(currentFG);
row["oidFG"] = fg["oidFG"];
row["strFGBezeichnung"] = fg["strFGMasterBezeichnung"];
currentFG = currentFG+1;
return (true);
Within the scripted datasource#1 I try to pass the parameter by
params["paramsModel"] = row["oidModel"];
But when generating only the first "oidModel" is passed to the params.
Has anybody a idea how to pass parameters between two scripted
datasources? IŽve also read all informations give in FAQŽs, newgroups etc.
Thanks.
Greetings
Thomas
|
|
|
|
Re: Master- and Subreport with two scripted datasources with parameters [message #187780 is a reply to message #187682] |
Tue, 29 August 2006 06:09  |
Eclipse User |
|
|
|
Originally posted by: thmwg.web.de
Hi Tyrone,
thanks for reply. No - I have a master-/subreport. For each row in
datasource#1 I got an ID and this ID should be passes to the second
datasource#2 as a parameter. That means, when the first query of dataset#1
is called then the parameter idModel is passed to dataset#2 and dataset#2
is called.
For example
1. Customer Meier
INVOICE :
1. Computer
2. Laptop
3. Book
2. Customer Mueller
INVOICE :
1. Notebook
2. Router
...
I hope IŽll understand my problem. Any suggestions solving the problem?
Thanks
Thomas
Tyrone Hed wrote:
> Thomas,
> Are you passing data that has been changed by the first query?
> If 'yes', then I don't know how to do it.
> If 'no', then you should be able to pass the same thing to both,
> using the 'beforeOpen' method to change the query before it is executed.
> If 'no', then say so and I will supply the code.
>
Ty
Hi together,
IŽve a problem which drives be crazy. I try to generate a
master-/subreport with two scripted datasources and I do not know how to
pass the parameter from the master to the subreport. Here is my code
Scripted Source #1
open :
modelClass = new Packages.de.thmwg.scripted.ModelReport();
models = modelClass.readModel();
totalModels = models.size();
currentModel = 0;
fetch :
if (currentModel >= totalModels) {
return (false);
}
var model = models.get(currentModel);
row["oidModel"] = model["oidModel"];
row["strBezeichnung"] = model["strBezeichnung"];
params["paramsModel"] = row["oidModel"];
currentModel = currentModel+1;
return (true);
And the scripted Datasource #2
open :
fgClass = new Packages.de.thmwg.scripted.ModelReport();
fgs = fgClass.readFG(params["paramsModel"]);
totalFGs = fgs.size();
currentFG = 0;
fetch :
if (currentFG >= totalFGs) {
return (false);
}
var fg = fgs.get(currentFG);
row["oidFG"] = fg["oidFG"];
row["strFGBezeichnung"] = fg["strFGMasterBezeichnung"];
currentFG = currentFG+1;
return (true);
Within the scripted datasource#1 I try to pass the parameter by
params["paramsModel"] = row["oidModel"];
But when generating only the first "oidModel" is passed to the params.
Has anybody a idea how to pass parameters between two scripted
datasources? IŽve also read all informations give in FAQŽs, newgroups etc.
Thanks.
Greetings
Thomas
|
|
|
Powered by
FUDForum. Page generated in 0.04401 seconds