Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Auto report generation
RiaR
Hi All,
I have to create two reports. One as Master report, consider the output of that report is 'Manager ID'.
My 2nd Report is for Employee details. This report will be generated by getting the parameter 'Manager ID' from my first report. According to that parameter Employee details have to be generated.
How i can achieve this? and how i have to deploy this in iServer?
Please guide me with example
Ria
Find more posts tagged with
Comments
kclark
You can use drill through links in your master report. Then use a hidden parameter in the subreport. In the example I've attached I used this SQL query to get all managers from the DB<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>select CLASSICMODELS.EMPLOYEES.EMPLOYEENUMBER, CLASSICMODELS.EMPLOYEES.REPORTSTO, CLASSICMODELS.EMPLOYEES.LASTNAME, CLASSICMODELS.EMPLOYEES.FIRSTNAME, CLASSICMODELS.EMPLOYEES.JOBTITLE
from CLASSICMODELS.EMPLOYEES
where CLASSICMODELS.EMPLOYEES.JOBTITLE <> 'Sales Rep'</pre>
<br />
Then I created a drill through link on the employee number that passes the value of row["EMPLOYEENUMBER"] to the subreport.<br />
<br />
In the subreport I used this query to get all of the employees that report to that manager.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>select CLASSICMODELS.EMPLOYEES.EMPLOYEENUMBER, CLASSICMODELS.EMPLOYEES.REPORTSTO, CLASSICMODELS.EMPLOYEES.LASTNAME, CLASSICMODELS.EMPLOYEES.FIRSTNAME, CLASSICMODELS.EMPLOYEES.JOBTITLE
from CLASSICMODELS.EMPLOYEES
where CLASSICMODELS.EMPLOYEES.REPORTSTO = ?</pre>
<br />
Then I was able to link the hidden parameter in the subreport to REPORTSTO in the parameters section of the edit data set UI.<br />
<br />
Let me know if you have any questions
RiaR
Hi Clark,
Thanks for your reply. Actually i don't want to go for drill down functionality, Instead of clicking the
link the Master report should automatically driven the sub report to generate output for each Manager with his Employee as a separate pdf. And these pdf will be mailed to corresponding Managers.
How i can achieve this? Do i have use any scripts? Please guide me on this.
Thanks,
Ria
kclark
<a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/991-mailing-birt-reports-as-body-of-email/'>Take
a look at this devshare</a> it has some code that shows how you can email reports. You can also email reports with the iHub.
RiaR
Hi Clark,
For mailing process i am going to use iHub. My exact need is how i can generate separate pdf report for each manager with his employee.
* My first report should provide the output of 'Manager ID'
* My second report should get the output from first report as a parameter. And for each Manger Id it should generate separate pdf containing the corresponding details of employees.
* After generating pdf, Each pdf should be delivered to corresponding Managers through iHUB
Thanks,
Ria
RiaR
Hi All,
Please help me on this.
Thanks in Advance,
Ria
kclark
I'm working on an example for you now. I've created a class that takes the manager id as a parameter. Then the class will call the genReport.bat to create the subreport passing the information it needs to create them. This way I can call the class in the onCreate() of the master report to create a subreport for each manager. The output will be PDF and then you can have iHub email these reports. I'll post the complete code once it's finished.
RiaR
Hi Clark,
Thanks. Still i am struggling on this, Once u complete please share it.
regards,
Ria
kclark
<a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/1335-report-bursting-with-birt/'>Take
a look at this devshare</a> it might be what your looking for since your using the iHub.
RiaR
Thanks Clark. Is there any other way to do the same without using iHub?
If so please let me know.
Regards,
Ria
kclark
<a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/1029-burst-pdf-report-using-script/'>This
example</a> shows how you can do the same thing by accessing the RE API from JavaScript with open source BIRT.
RiaR
This help me lot. Thanks Clark