Hello All,
in this post let us explore report generation functionality in siebel.
Generally we have BIP integration with siebel for any report generation.
RTF files/Templates are uploaded in siebel and we can genrated reports in the uploaded format.
I tried to achieve something that can generate reports/PDF files without BI Publisher, seems a bit absured but its achieveable.
Though it cannot get all the functionalites of BI Publisher but it servers the purpose for simple reports
The Solution
1. Get the values which we need to display in Report in PR file
2. Generating HTML in Desired format with field values/records from a PR file
3. Call 3rd party plugin to convert the HTML to Canvas and then to pdf
here's the output,
Click on Open Summary it displays a Preview and when i click on Generate Report, PDF for reports gets generated and downloaded
Benefits,
Disadvantages
Open UI Code
3rd Party Jquery required,
in this post let us explore report generation functionality in siebel.
Generally we have BIP integration with siebel for any report generation.
RTF files/Templates are uploaded in siebel and we can genrated reports in the uploaded format.
I tried to achieve something that can generate reports/PDF files without BI Publisher, seems a bit absured but its achieveable.
Though it cannot get all the functionalites of BI Publisher but it servers the purpose for simple reports
The Solution
1. Get the values which we need to display in Report in PR file
2. Generating HTML in Desired format with field values/records from a PR file
3. Call 3rd party plugin to convert the HTML to Canvas and then to pdf
here's the output,
Click on Open Summary it displays a Preview and when i click on Generate Report, PDF for reports gets generated and downloaded
Benefits,
- Although it cannot replace BI Publisher, but can be used for certain reports that are single page and require no/less calculations
- Since no BIP is used, can be set up for some priority reports which are very critical and cannot afford BIP unavailablility
- No Cost included, so free :-)
Disadvantages
- Since it works on HTML, so complex logics and multi page reports cannot be build
- Need Individual Coding/Setup for each report which will be difficult to maintain
- Generated Reports are not very clear i.e. qualty of pdf generated is not very good
- Dependent on 3rd party,
Open UI Code
3rd Party Jquery required,
- https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.22/pdfmake.min.js
- https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js
Code that generates the PDF
$('.open-report').click(function () {
html2canvas($('#report123')[0], {
onrendered: function (canvas) {
var data = canvas.toDataURL();
var docDefinition = {
content: [{
image: data,
width: 500
}]
};
pdfMake.createPdf(docDefinition).download("Table.pdf");
}
})
Complete Code,
https://drive.google.com/open?id=14qCed01MaqnoN9rKJU-AWVQcaHSC5A0e
Hi Rahul,
ReplyDeleteI am trying to use the same html2canvas in my PM, but getting below error. Please shed some lights here if possible. Using jsPDF instead on pdfMake.
Uncaught ReferenceError: html2canvas is not defined
code:
var doc = new jsPDF('p', 'mm', [297, 210]);
html2canvas(source, {
onrendered: function(canvas) {
var data = canvas.toDataURL("image/png");
doc.addImage(data, 'PNG', 10, 10);
doc.save('sample.pdf');
}
});