Elrodyn
20th September 2011, 06:20
Dear Baan/LN followers,


Sorry if this topic already been asked before(@mod,request more sub category of topic in the forum please).

I'm creating the report with MS reporting now, but i want to add more field from different table on the report, anyone can help me how to do it?

Thanks,

Roy

JaapJD
20th September 2011, 09:32
There are at least 3 ways to do this:
- Add the fields as report input fields to the 4GL report and (if the fields are not selected yet in the session) read them in the program script of the session or in the report script (e.g. in the before.layout of a detail line).
- Call an LN DLL from the custom code of the MS report to read the additional data.
- Create another dataset in the report that connects directly to the database. With the lookup report functions you can kind of join the datasets together.

Elrodyn
20th September 2011, 10:04
Hello JaapJD,


hmm, if i use the 4gl method that means i need to customize the report field and then arrange it on the MS reporting right? can i do that even after i'm halfway doing the report? i mean i already made the MS reporting but then i add the field on the 4gl, will the new field appeared on the MS reporting?

for the call DLL you mean the API?

and for the datasets, i think the report cannot dynamically link the company parameter, correct me if i'm wrong though...

Thanks,

Roy

Elrodyn
20th September 2011, 10:48
Hello,


updating again, i put the new input field on the 4gl report, refreshed the datasets and the field is appeared on the MS reporting!.

by the way, JaapJD is it possible to create report that has 2 forms seperated by package combination? as the report code are the same in the VRC?

Thanks,

Roy

JaapJD
20th September 2011, 11:21
Indeed, refreshing the dataset fields willl pick up the new report inport fields.

Regarding the other issues:
- Calling a DLL is described in "Executing a method call of an ERP LN Library" of the Developers Guide.
- If you create a query for an additional dataset you can use the Report parameter "CompanyNumber" as a query parameter.

JaapJD
20th September 2011, 11:24
You can have different report designs for different package combinations. But then you need to use the $pacc placeholder in the folder path of the report server (ttrpi1500m000).
Note that the report designs are stored as additional files in the LN server. Per VRC you can have different report designs, even if the 4GL report is only in one VRC.

Elrodyn
20th September 2011, 11:42
OK,


Let me try all your methods, but from my experience it should be easier to crete a query and link it wih lookup and parameter right?

Thanks,

Roy

JaapJD
20th September 2011, 11:50
Hi Roy,
To me the additional query seems to be more difficult compared to the other 2 methods. There are some additional deployment issues for the datasource. If all data comes directly from LN, you don't need to bother about the connection details. The dynamic connection string handles automatically the use of the report from different hosts/bses. If you connect directly to the database, you need to be aware of connecting to the right database if you move from test to production.
The additional query may also create performance problems, because you don't know on beforehand which data you need, so you may read unnecessary data.
Regards,
JaapJD

Elrodyn
21st September 2011, 06:21
Hello JaapJD,

I've tried using the additional query and you were right, there's some problem when i tried to export and import it to another server.

I guess then the best way to do this report is to collect all the data on the 4gl report and then make the layout on the MSreport.

Thanks,

Roy