Generated PDF Filesize Concerns
Hello,
I have am creating PDFs by generated XDP files from ColdFusion. Each PDF could have different sections that would appear or not based on the XML data passed in with the XDP file. I am concerned that having all of the sections in one file may bloat the generated PDF filesize? Is this true or is the PDF filesize only dependent upon the information that is actually displayed when it is generated (rather than both the displayed and hidden design elements)?
Are there any resources that folks have found useful for PDF file size optimization techniques?
Thanks.
Lisa Backer
The Kennedy Center for the Performing Arts
Hi Sergiusz,
Thank you for your reply. I look at what you wrote and try to make some test...
1) For first I download FontForge, which can generate type1 font from true type. So I open FontForge and open my Arial.ttf font and use "Generate Fonts" to save my Arial.ttf font to pfb and pfm (whoch are need to set in uifont.ali). I have to change encoding, because my font has 2byte encoding so I reecondode the font from ISO10646-1 to ISO8859-2 and generate to pfb.
2) Then I navigate REPORTS_PATH from regedit to my *.pfm and *.pfb files.
3) I add these lines to end of my uifont.ali
[ PDF:Embed ]
Arial = "Arial.pfm Arial.pfb"
ArialNarrow = "ArialNarrow.pfm ArialNarrow.pfb"
4) Then I generate my report but nothing change... I check "Font used" in my pdf file, but there were not my fonts embedded I guess..
I also try PDF:Subset, but it doesnt change anything... I try PDF aliasing to see if my uifont is working - this work very well, but I dont need to change font...
Any other advice? Thank you so much to everyone!
Martin
Similar Messages
-
Bookmarks not created when generating pdf
Hello
I am using 'robohelp for html' and generate pdf files as user guide from existing word format user guide.
I import than and create bookmarks for the TOC of the word user guide.
Now I generate pdf. But the generated pdf file, do not show bookmarks, I also checked in View-Navigation Panels- > but no bookmark icon is there.
I want bookmarks when I create pdf for my documentaion,Actually my concern is that the elements, I would like to add like bookmarks in the PDF files are in some files of the book, but not all.
I feel that the problem is there.
But why i see some of elements, and not all ?
You do not have to physically use the elements in each file of the book; however, all the files in the book should use the same set of elements. My guess is that FrameMaker does not search through all the files in the book when it generates the list of available elements. It probably creates these things from the first file in the book.
Do all the files in the book use the same set of elements? If not, make sure the first file in the book uses the set that includes all the elements you want to be in the bookmarks.
In my opinion, all the files in the book should use the same set of elements. So, I suggest opening a copy of your template, select all the files in the book, and import the element definitions from the template to the files. -
Why would hyperlinks fail to work half-way through generated PDF?
I'm trying to create a PDF of a MS Word file using the Adobe PDF > Convert to Adobe PDF function. In the generated PDF, half-way through the file the hyperlinks stop working although they display correctly. In the source Word file, the links work fine. The Word file is heavily cross referenced and is about 14 MB. It was originally a 26MB file, but I reduced the filesize by converting the embedded graphics from embedded Visio objects to .wmf images.
My question - what would make the hyperlinks fail? Is it a system processing issue? The rest of the PDF seems fine. Note that the final PDF also contains bookmarks. All other PDFs I generate work correctly.
System Details:
Word 2003
Adobe Acrobat 7.0 Professional
Windows XP, Version 2002, SP2
789 MHz, 3GB RAM
Any ideas would be appreciated.Just in case, I would suggest updating your Acrobat. You have to install the updates in order, but AA7 is currently at 7.1.2. The updates are available at http://www.adobe.com/support/downloads/product.jsp?product=1&platform=Windows. Version 7.0.1 is a very early version. The latter versions (7.1.x) were primarily security updates. The 7.0.x updates were fixing a lot of the bugs.
-
Crystal Report generate PDF with J2EE problem
Dear All
I am having a great problem on generating PDF file by Crystal Report in J2EE.
I have my J2EE application runs Crystal Report to generate PDF files.
However for a report, i hit the following error (red color) when the PDF is generating.
But is no problem for the other reports.
Here is the code that i used to generate the PDF
My OS and Java version as follows
Window 2003 server.
Java 1.4.2_04
Please Kindly Help
Thanks very much
public static void export(HttpServletRequest request, HttpServletResponse response, String reportPath, ArrayList paramList, ReportExportFormat outFormat) throws Exception{
System.gc();
HttpSession session = request.getSession(false);
Object reportSource = getReportSource(request, reportPath);
ReportExportControl exportControl = new ReportExportControl();
if(paramList != null && paramList.size()>0){
exportControl.setParameterFields(getParamFields(paramList));
ExportOptions exportOptions = new ExportOptions();
exportOptions.setExportFormatType(outFormat);
PDFExportFormatOptions pdfexpopts = new PDFExportFormatOptions();
exportOptions.setFormatOptions(pdfexpopts);
exportControl.setReportSource(reportSource);
exportControl.setExportOptions(exportOptions);
exportControl.processHttpRequest(request, response, session.getServletContext(), null);
exportControl.dispose();
public static IReportSource getReportSource(HttpServletRequest request, String reportPath) throws Exception{
ReportClientDocument oReportClientDocument = new ReportClientDocument();
HttpSession session = request.getSession(false);
oReportClientDocument.open(reportPath, 0);
return oReportClientDocument.getReportSource();
00:57:08,671 ERROR reportdefinition Thread-28 - Report printer was not valid, switching to default printer.
00:57:08,687 ERROR objectformatter Thread-28 - com.crystaldecisions.reports.dataengine.k: |Y
00:57:09,343 ERROR b Thread-28 - Disk Exporter: no output file was created by an exporter
00:57:09,343 ERROR b Thread-28 - PdfExporter: caught Exception in PDFFormatter.finalizeFormatJob (from destination?); java.lang.IllegalArgumentExceptionHi,
I have tried this code but stil the same.
However i tried setup another tomcat and application in the other machine and the only job for the application is exporting the report that has problem, then the error is gone.
So i guess that is the memory size problem.
Thanks for this
One more question about the memory size between Tomcat and Crystal report.
I have set in catalina.bat as
set JAVA_OPTS = "-Xms2048M -Xmx1024M"
and CRConfig as
<JVMMaxHeap>1024000000</JVMMaxHeap>
<JVMMinHeap>512000000</JVMMinHeap>
1. Is that the correct setting.?
2. The memory in the JAVA_OPT and is the MAX and MIN memory that java would use,
then is the Max memory in CRConf is 1024M out of the java heap size or the application use another 1024 memory -
"Error while generating pdf" error come when clicking on "Print Version "
Hello ,
When we execute Query in the Portal there is a 'Print version' button.
When you select it, it opens up print dialog and click OK
It is supposed to send 'pdf' stream to Web browser client on end user but it is not able to generate the pdf .
getting ' Error while generating pdf '
I am working on BI 7.0 .
The same is running fine in the Q Environment .But in Production we are getting this error .
Thanks ,
RahulHi,
I think this is an ADS error. This is a reason why pdf's are not working. We had the same issue.
You can check your installation:
Usage of SAP NetWeaver BI Diagnostics & Support Desk Tool
SAP Note Number: [937697|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bw_bex/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d393337363937%7d]
Exceptions: Prerequisites for messages in the area BI Java
SAP Note Number: [1224043 |https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bw_bex/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d31323234303433%7d]
Solution in our case was to update the SAPADS package to 7.00 17.1
Regards
Andreas -
Error while generating PDF ( BEx Web Analyzer )
Hi,
Is there any limit to the number of pages we can print using ADS? We always get
" Error while generating PDF" Error when we try to print reports with more than 500 lines.
Thanks
NivedaGreat. It worked.
Points assigned.
Niveda -
Error while generating PDF in portal but not in WAD
Hi,
When I execute the command to export to pdf, I have a screen to fill settings of my pdf, then I valid my choice and I have this message : "Error while generating PDF" in my portal.
However, when I want to execute on Web Application Designer and click on my command "export to pdf", I have a same screen and I can open or save my document.
Is someone have an idea : why it is possible to generate my pdf on WAD but not in my portal ??
Any information is much appreciated !
Thanks in advance
V.K.Hi Pradnya,
Thanks for your answer. However it is for an old version of SAP NetWeaver..
I work with SAP BI 7.0 version.
Regards,
V.K. -
Error while generating PDF BI 7 Report Designer
Hi,
I am getting this error Error while generating PDF when i tried print version on report designer,
I tried to find information on this error but there was no information regarding this , so posted here.
Please let me know if you have any suggestions.
Thanks,
KumarWe have restated the java server and now the issue solved.
Kumar -
Hello Guru's,
I have done the ADS configuration setup and checked all configuration settings.It seems everything is working fine but when i select the option "Print Verison" ( I have executed a query using the query designer) i am getting above error.
FYI: Its a BI 700 system and we are at Suport pack10 level (both ABAP+Java). By the way i should let you know that it is a copy of Production.
Here is the log:
Error while generating PDF
com.sap.ip.bi.webapplications.pageexport.PageExportRenderingRootNode PageExport1
Error while generating PDF
com.sap.ip.bi.webapplications.pageexport.PageExportRenderingRootNode PageExport#
Any thoughts as to what the messages above might be pointing me to?I should appreciate your help.
Thanks,
Ravi.Hello Dezso,
I have executed the test report FP_TEST_00 and i got a form containing several lines on two pages.I have checked all the configuration checks and got the correct results as mentioned in the ADS document. But when i try to print a query using the query analyzer,i am getting that PDF error. I have no issues with my other BI 700 system.
Ravi. -
Error while generating PDF - in Bex Web
Hi Experts,
I am currently having the issue that I receive the error "Error while generating PDF" when using the "Print Version" functionality. This problem only occurrs for the Bex Web Query. I know that the ADS service is configured correctly- The webservice test is successful and other applications (Guided Procedures, MSS) also use it successfully.
Please see below the excerpt from the default trace:
A message was generated:
ERROR
Error while generating PDF
com.sap.ip.bi.webapplications.pageexport.PageExportRenderingRootNode PageExportRenderingRootNode_0001
Message: 28
Stack trace: java.lang.ArrayIndexOutOfBoundsException: 28
at com.sap.ip.bi.export.xfa.impl.SizeCalculator.getColumnSizes(SizeCalculator.java:178)
at com.sap.ip.bi.export.impl.ExportController.setSizes(ExportController.java:220)
at com.sap.ip.bi.export.impl.ExportController.calculateAndSetSizes(ExportController.java:611)
at com.sap.ip.bi.export.impl.ExportController.doExportPrep(ExportController.java:408)
at com.sap.ip.bi.export.impl.ExportController.convert(ExportController.java:336)
at com.sap.ip.bi.export.controller.ExportResult.createExport(ExportResult.java:58)
at com.sap.ip.bi.webapplications.pageexport.PageExportRenderingRootNode.createPDF(PageExportRenderingRootNode.java:453)
at com.sap.ip.bi.webapplications.pageexport.PageExportRenderingRootNode.doExport(PageExportRenderingRootNode.java:105)
at com.sap.ip.bi.webapplications.pageexport.PageExportRenderingRootNode.processRendering(PageExportRenderingRootNode.java:252)
at com.sap.ip.bi.webapplications.runtime.impl.Page.buildRenderingTree(Page.java:3809)
at com.sap.ip.bi.webapplications.runtime.impl.Page.processRenderingRootNode(Page.java:3867)
at com.sap.ip.bi.webapplications.runtime.impl.Page.processRendering(Page.java:3510)
at com.sap.ip.bi.webapplications.runtime.impl.Page.doProcessRequest(Page.java:3470)
at com.sap.ip.bi.webapplications.runtime.impl.Page.processRequest(Page.java:2489)
at com.sap.ip.bi.webapplications.runtime.controller.impl.Controller.doProcessRequest(Controller.java:892)
at com.sap.ip.bi.webapplications.runtime.controller.impl.Controller.processRequest(Controller.java:813)
at com.sap.ip.bi.webapplications.runtime.jsp.portal.services.BIRuntimeService.handleRequest(BIRuntimeService.java:456)
at com.sap.ip.bi.webapplications.runtime.jsp.portal.components.LauncherComponent.doContent(LauncherComponent.java:21)
at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
at java.security.AccessController.doPrivileged(Native Method)
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
If you have any idea or clue it would be greatly appreciated.
Thanks in advance for every support,
JanHi Jan,
Most possible causes for encountering this issue are:
Possible cause:
- The ADS is installed on a plattform, that is currently not supported by SAP for ADS. Please check the avaliablity at: Product Availability Matrix
- Mixing of different Netweaver releases (NW04 and NW04s) -> This is unfortunatelly not possibble the J2EE engine release has to match with the ABAP stack release in order connect them properly.
- The ADS SP level does not match the J2EE engine SP level. -> Please update the software components to have the same support package level.
Hope this helps!!
Regards,
Arafat -
Hi,
I am using CRM ONLINE 2013.
How to automate below process?
1. On Approval Of Quotation, Run Report.
2. Generate PDF.
3. Send an Email With PDF as attachment.
As i have gone through many forums for this topic, but creating a plugin code for generating Report PDF is not possible in CRM ONLINE.
So, What is the alternate way to do this..?
Thanks.This is my entire code mentioned below:-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript">
if (typeof (SDK) == "undefined")
{ SDK = { __namespace: true }; }
SDK.JScriptRESTDataOperations = {
_context: function () {
if (typeof GetGlobalContext != "undefined")
{ return GetGlobalContext(); }
else {
if (typeof Xrm != "undefined") {
return Xrm.Page.context;
else { return new Error("Context is not available."); }
_getServerUrl: function () {
var serverUrl = this._context().getServerUrl()
if (serverUrl.match(/\/$/)) {
serverUrl = serverUrl.substring(0, serverUrl.length - 1);
return serverUrl;
_ODataPath: function () {
return this._getServerUrl() + "/XRMServices/2011/OrganizationData.svc/";
_errorHandler: function (req) {
return new Error("Error : " +
req.status + ": " +
req.statusText + ": " +
JSON.parse(req.responseText).error.message.value);
_dateReviver: function (key, value) {
var a;
if (typeof value === 'string') {
a = /Date\(([-+]?\d+)\)/.exec(value);
if (a) {
return new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
return value;
Create: function (object, type, successCallback, errorCallback) {
var req = new XMLHttpRequest();
req.open("POST", this._ODataPath() + type + "Set", true);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () {
if (this.readyState == 4 /* complete */) {
if (this.status == 201) {
successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
else {
errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
req.send(JSON.stringify(object));
Retrieve: function (id, type, successCallback, errorCallback) {
var req = new XMLHttpRequest();
req.open("GET", this._ODataPath() + type + "Set(guid'" + id + "')", true);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () {
if (this.readyState == 4 /* complete */) {
if (this.status == 200) {
successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
else {
errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
req.send();
Update: function (id, object, type, successCallback, errorCallback) {
var req = new XMLHttpRequest();
req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("X-HTTP-Method", "MERGE");
req.onreadystatechange = function () {
if (this.readyState == 4 /* complete */) {
if (this.status == 204 || this.status == 1223) {
successCallback();
else {
errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
req.send(JSON.stringify(object));
Delete: function (id, type, successCallback, errorCallback) {
var req = new XMLHttpRequest();
req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("X-HTTP-Method", "DELETE");
req.onreadystatechange = function () {
if (this.readyState == 4 /* complete */) {
if (this.status == 204 || this.status == 1223) {
successCallback();
else {
errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
req.send();
RetrieveMultiple: function (type, filter, successCallback, errorCallback) {
if (filter != null) {
filter = "?" + filter;
else { filter = ""; }
var req = new XMLHttpRequest();
req.open("GET", this._ODataPath() + type + "Set" + filter, true);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () {
if (this.readyState == 4 /* complete */) {
if (this.status == 200) {
successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d.results);
else {
errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
req.send();
__namespace: true
</script>
<script type="text/javascript">
//Create Email and link it with Order as Regarding field
var Xrm;
var email = new Object();
var ownerID = "";
var CustomerId = "";
if (window.opener) { Xrm = window.opener.Xrm; }
else if (window.parent) { Xrm = window.parent.Xrm; }
//Get ownerid who send email of quotation to customer
function GetOwnerID() {
var owner = Xrm.Page.getAttribute("ownerid").getValue();
ownerID = owner[0].id;
var ownerName = owner[0].name;
var entityType = owner[0].entityType;
GetToEmailGUID();
//Get customerid who receive email of quotation from owner
function GetToEmailGUID() {
var Customer = Xrm.Page.getAttribute('customerid').getValue();
CustomerId = Customer[0].id;
var CustomerName = Customer[0].name;
var entityType = Customer[0].entityType;
//if CustomerId is type of "Account" then get Primary Contact id of that account
if (entityType == "account") {
var contact = Xrm.Page.getAttribute("customerid").getValue();
if (contact === null) return;
var serverUrl = Xrm.Page.context.getClientUrl();
var oDataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc/AccountSet(guid'" + contact[0].id + "')?$select=PrimaryContactId";
var req = new XMLHttpRequest();
req.open("GET", oDataSelect, false);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json;charset=utf-8");
req.onreadystatechange = function () {
if (req.readyState === 4) {
if (req.status === 200) {
var retrieved = JSON.parse(req.responseText).d;
CustomerId = retrieved.PrimaryContactId.Id;
else {
alert(this.statusText);
req.send();
function CreateEmail() {
GetOwnerID();
email.Subject = "Email with Report Attachment";
//Set The current order as the Regarding object
email.RegardingObjectId = {
Id: Xrm.Page.data.entity.getId(), //Get the current entity Id , here OrderId
LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
//Create Email Activity
SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
// Email Call Back function
function EmailCallBack(result) {
email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
var activityPartyFrom = new Object();
// Set the From party of the ActivityParty to relate an entity with Email From field
activityPartyFrom.PartyId = {
Id: CustomerId, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
LogicalName: "contact"
// Set the "activity" of the ActivityParty
activityPartyFrom.ActivityId = {
Id: result.ActivityId,
LogicalName: "email"
// Now set the participation type that describes the role of the party on the activity).
activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
// Create the from ActivityParty for the email
SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
var activityPartyTo = new Object();
// Set the From party of the ActivityParty to relate an entity with Email From field
activityPartyTo.PartyId = {
Id: ownerID, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
LogicalName: "systemuser"
// Set the "activity" of the ActivityParty
activityPartyTo.ActivityId = {
Id: result.ActivityId,
LogicalName: "email"
// Now set the participation type that describes the role of the party on the activity).
activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
// Create the from ActivityParty
SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
//ActivityParty From Callback
function ActivityPartyFromCallBack(result) {
//ActivityParty To Callback
function ActivityPartyToCallBack(result) {
GetReportId('ABM_Infotech_SalesQuote');
//Create attachment for the created email
function CreateEmailAttachment() {
//get reporting session and use the params to convert a report in PDF
var params = getReportingSession();
//Email attachment parameters
var activitymimeattachment = Object();
activitymimeattachment.ObjectId = Object();
activitymimeattachment.ObjectId.LogicalName = "email";
activitymimeattachment.ObjectId.Id = email.ActivityId;
activitymimeattachment.ObjectTypeCode = "email",
activitymimeattachment.Subject = "File Attachment";
activitymimeattachment.Body = encodePdf(params);
activitymimeattachment.FileName = "Report1.pdf";
activitymimeattachment.MimeType = "application/pdf";
//Attachment call
SDK.JScriptRESTDataOperations.Create(activitymimeattachment, "ActivityMimeAttachment", ActivityMimeAttachmentCallBack, function (error) { alert(error.message); });
//ActivityMimeAttachment CallBack function
function ActivityMimeAttachmentCallBack(result) {
var features = "location=no,menubar=no,status=no,toolbar=no,resizable=yes";
var width = "800px";
var height = "600px";
window.open(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", features);
// To open window which works in outlook and IE both
//openStdWin(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", width,
height, features);
//This method will get the reportId based on a report name that will be used in getReportingSession() function
function GetReportId(reportName) {
var oDataSetName = "ReportSet";
var columns = "ReportId";
var filter = "Name eq '" + reportName + "'";
retrieveMultiple(oDataSetName, columns, filter, onSuccess);
function retrieveMultiple(odataSetName, select, filter, successCallback) {
var serverUrl = Xrm.Page.context.getServerUrl();
var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";
var odataUri = serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "?";
if (select) {
odataUri += "$select=" + select + "&";
if (filter) {
odataUri += "$filter=" + filter;
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
datatype: "json",
url: odataUri,
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader("Accept", "application/json");
success: function (data) {
if (successCallback) {
if (data && data.d && data.d.results) {
successCallback(data.d.results);
else if (data && data.d) {
successCallback(data.d);
else {
successCallback(data);
error: function (XmlHttpRequest, errorThrown) {
if (XmlHttpRequest && XmlHttpRequest.responseText) {
alert("Error while retrieval ; Error – " + XmlHttpRequest.responseText);
function onSuccess(data) {
reportId = data[0].ReportId.replace('{', ").replace('}', ");
CreateEmailAttachment(); // Create Email Attachment
//Gets the report contents
function getReportingSession() {
var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
var retrieveEntityReq = new XMLHttpRequest();
var Id = Xrm.Page.data.entity.getId();
var quotationGUID = Id.replace('{', ""); //set this to selected quotation GUID
quotationGUID = quotationGUID.replace('}', "");
var reportName = "ABM_Infotech_SalesQuote"; //set this to the report you are trying to download
var reportID = "751089AA-74B8-E211-B52F-D8D3855B253B"; //set this to the guid of the report you are trying to download
var rptPathString = ""; //set this to the CRMF_Filtered parameter
var strParameterXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'><entity name='quote'><all-attributes /><filter type='and'><condition
attribute='quoteid' operator='eq' uitype='quote' value='" + quotationGUID + "' /> </filter></entity></fetch>";
retrieveEntityReq.open("POST", pth, false);
retrieveEntityReq.setRequestHeader("Accept", "*/*");
retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
rptPathString = "id=%7B" + reportID + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName="
+
reportName + "&isScheduledReport=false&p:ABMFilteredQuote=" + strParameterXML;
//remove the part starting from &p:salesorderid if your report has no parameters
retrieveEntityReq.send(rptPathString);
var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
var ret = new Array();
ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
x = retrieveEntityReq.responseText.indexOf("ControlID=");
ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
return ret;
var bdy = new Array();
var bdyLen = 0;
function concat2Bdy(x) {
bdy[bdyLen] = x;
bdyLen++;
function encodePdf(params) {
bdy = new Array();
bdyLen = 0;
var retrieveEntityReq = new XMLHttpRequest();
var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] +
"&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] +
"&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
retrieveEntityReq.open("GET", pth, false);
retrieveEntityReq.setRequestHeader("Accept", "*/*");
retrieveEntityReq.send();
BinaryToArray(retrieveEntityReq.responseBody);
return encode64(bdy);
var StringMaker = function () {
this.parts = [];
this.length = 0;
this.append = function (s) {
this.parts.push(s);
this.length += s.length;
this.prepend = function (s) {
this.parts.unshift(s);
this.length += s.length;
this.toString = function () {
return this.parts.join('');
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function encode64(input) {
var output = new StringMaker();
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
while (i < input.length) {
chr1 = input[i++];
chr2 = input[i++];
chr3 = input[i++];
enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
return output.toString();
</script>
<script type="text/vbscript">
Function BinaryToArray(Binary)
Dim i
ReDim byteArray(LenB(Binary))
For i = 1 To LenB(Binary)
byteArray(i-1) = AscB(MidB(Binary, i, 1))
concat2Bdy(AscB(MidB(Binary, i, 1)))
Next
BinaryToArray = byteArray
End Function
</script>
</head>
<body>
<input type="button" onclick="CreateEmail();" value="Attach Report" />
</body>
</html> -
Generate pdf and html(urgent)
can anybody tell how to generate pdf and html from a single report,
thanks in advFrom a single report, you can generate outputs to html, htmlcss, pdf, rtf, XML and text formats.
If you use rwclient, rwrun or rwservlet methods, specify desformat=pdf/html and the destination file name in desname command line parameters.
If you use Reports Builder, open a report, select File->Generate to file and select html/pdf. Then give the file name.
For more details, Refer to Reports Tutorial / Publishing Reports document from this site.
http://otn.oracle.com/docs/products/reports/content.html
Thanks,
The Oracle Reports team -
Writing a java program for generating .pdf file with the data of MS-Excel .
Hi all,
My object is write a java program so tht...it'll generate the .pdf file after retriving the data from MS-Excel file.
I used POI HSSF to read the data from MS-Excel and used iText to generate .pdf file:
My Program is:
* Created on Apr 13, 2005
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
package forums;
import java.io.*;
import java.awt.Color;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import com.lowagie.text.Font.*;
import com.lowagie.text.pdf.MultiColumnText;
import com.lowagie.text.Phrase.*;
import net.sf.hibernate.mapping.Array;
import org.apache.poi.hssf.*;
import org.apache.poi.poifs.filesystem.*;
import org.apache.poi.hssf.usermodel.*;
import com.lowagie.text.Phrase.*;
import java.util.Iterator;
* Generates a simple 'Hello World' PDF file.
* @author blowagie
public class pdfgenerator {
* Generates a PDF file with the text 'Hello World'
* @param args no arguments needed here
public static void main(String[] args) {
System.out.println("Hello World");
Rectangle pageSize = new Rectangle(916, 1592);
pageSize.setBackgroundColor(new java.awt.Color(0xFF, 0xFF, 0xDE));
// step 1: creation of a document-object
//Document document = new Document(pageSize);
Document document = new Document(pageSize, 132, 164, 108, 108);
try {
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter writer =PdfWriter.getInstance(document,new FileOutputStream("c:\\weeklystatus.pdf"));
writer.setEncryption(PdfWriter.STRENGTH128BITS, "Hello", "World", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);
// step 3: we open the document
document.open();
Paragraph paragraph = new Paragraph("",new Font(Font.TIMES_ROMAN, 13, Font.BOLDITALIC, new Color(0, 0, 255)));
POIFSFileSystem pofilesystem=new POIFSFileSystem(new FileInputStream("D:\\ESM\\plans\\weekly report(31-01..04-02).xls"));
HSSFWorkbook hbook=new HSSFWorkbook(pofilesystem);
HSSFSheet hsheet=hbook.getSheetAt(0);//.createSheet();
Iterator rows = hsheet.rowIterator();
while( rows.hasNext() ) {
Phrase phrase=new Phrase();
HSSFRow row = (HSSFRow) rows.next();
//System.out.println( "Row #" + row.getRowNum());
// Iterate over each cell in the row and print out the cell's content
Iterator cells = row.cellIterator();
while( cells.hasNext() ) {
HSSFCell cell = (HSSFCell) cells.next();
//System.out.println( "Cell #" + cell.getCellNum() );
switch ( cell.getCellType() ) {
case HSSFCell.CELL_TYPE_STRING:
String stringcell=cell.getStringCellValue ()+" ";
writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
phrase.add(stringcell);
// document.add(new Phrase(string));
System.out.print( cell.getStringCellValue () );
break;
case HSSFCell.CELL_TYPE_FORMULA:
String stringdate=cell.getCellFormula()+" ";
writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
phrase.add(stringdate);
System.out.print( cell.getCellFormula() );
break;
case HSSFCell.CELL_TYPE_NUMERIC:
String string=String.valueOf(cell.getNumericCellValue())+" ";
writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
phrase.add(string);
System.out.print( cell.getNumericCellValue() );
break;
default:
//System.out.println( "unsuported sell type" );
break;
document.add(new Paragraph(phrase));
document.add(new Paragraph("\n \n \n"));
// step 4: we add a paragraph to the document
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
// step 5: we close the document
document.close();
My Input from MS-Excel file is:
Planning and Tracking Template for Interns
Name of the Intern N.Kesavulu Reddy
Project Name Enterprise Sales and Marketing
Description Estimated Effort in Hrs Planned/Replanned Actual Actual Effort in Hrs Complexity Priority LOC written new & modified % work completion Status Rework Remarks
S.No Start Date End Date Start Date End Date
1 setup the configuration 31/01/2005 1/2/2005 31/01/2005 1/2/2005
2 Deploying an application through Tapestry, Spring, Hibernate 2/2/2005 2/2/2005 2/2/2005 2/2/2005
3 Gone through Componentization and Cxprice application 3/2/2005 3/2/2005 3/2/2005 3/2/2005
4 Attend the sessions(tapestry,spring, hibernate), QBA 4/2/2005 4/2/2005 4/2/2005 4/2/2005
The o/p I'm gettint in .pdf file is:
Planning and Tracking Template for Interns
N.Kesavulu Reddy Name of the Intern
Enterprise Sales and Marketing Project Name
Remarks Rework Status % work completion LOC written new & modified Priority
Complexity Actual Effort in Hrs Actual Planned/Replanned Estimated Effort in Hrs Description
End Date Start Date End Date Start Date S.No
38354.0 31/01/2005 38354.0 31/01/2005 setup the configuration 1.0
38385.0 38385.0 38385.0 38385.0 Deploying an application through Tapestry, Spring, Hibernate
2.0
38413.0 38413.0 38413.0 38413.0 Gone through Componentization and Cxprice application
3.0
38444.0 38444.0 38444.0 38444.0 Attend the sessions(tapestry,spring, hibernate), QBA 4.0
The issues i'm facing are:
When it is reading a row from MS-Excel it is writing to the .pdf file from last cell to first cell.( 2 cell in 1 place, 1 cell in 2 place like if the row has two cells with data as : Name of the Intern: Kesavulu Reddy then it is writing to the .pdf file as Kesavulu Reddy Name of Intern)
and the second issue is:
It is not recognizing the date format..it is recognizing the date in first row only......
Plz Tell me wht is the solution for this...
Regards
[email protected]Don't double post your question:
http://forum.java.sun.com/thread.jspa?threadID=617605&messageID=3450899#3450899
/Kaj -
While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट. Word file generated of the same report have correct hindi इ matra position and also pdf generated from this word file also contains the same.
-
D:\dzbat\bin>genpdf
D:\dzbat\bin>javadoc -doclet com.sun.tools.doclets.mif.MIFDoclet -docletpath d:\
mifdoclet1.2\lib\mifdoclet.jar -J-Xmx20M -batch dzbatcher -print pdf -d d:\lsmap
isericsson\docs -sourcepath d:\lsmapisericsson com.mahindrabt.lsm
Loading source files for package com.mahindrabt.lsm...
Constructing Javadoc information...
MIF Doclet version 1.2 beta 2 (build date: 09 Aug 2002)
I installed mifdoclet1.2 and DZbatcher and tried to generate PDF file with the following batch file
javadoc -doclet com.sun.tools.doclets.mif.MIFDoclet -docletpath d:\mifdoclet1.2\lib\mifdoclet.jar -J-Xmx20M -batch dzbatcher -print pdf -d d:\lsmapisericsson\docs -sourcepath d:\lsmapisericsson com.mahindrabt.lsm
It gives the following output and does not genrate the PDF file and does not give any error. Is there any problem with my batch file? Please help me out from this.
Generating d:\lsmapisericsson\docs\mif\overview.mif...
Using default stylemap file...
Template Used: d:\lsmapisericsson\docs\mif\template.mif
Using default batchmap file...
Building tree for all the packages and classes...
Generating d:\lsmapisericsson\docs\fm\package-list...
Generating d:\lsmapisericsson\docs\mif\com.mahindrabt.lsm.mif...
Generating default overview page...
Generating d:\lsmapisericsson\docs\mif\almanac.mif...
Generating d:\lsmapisericsson\docs\mif\api.book.mif...
Generating d:\lsmapisericsson\docs\mif\mif-to-fm.batch...
Executing: dzbatcher -makername framemaker d:\lsmapisericsson\docs\mif\mif-to-fm
.batch...
Regards
TusharI see no problem with your batch file, and the messages
proceed properly. To troubleshoot this further, I suggest
you read the email (currently adjacent) titled:
"Error using MIF doclet to create PDFs".
It describes several different approaches, including
generating PS and using Distiller to generate PDF,
or trying dzbatcher with -v option to echo each
command to see where it stops.
Please let us know your results, as this seems to be
a common problem.
-Doug Kramer
Javadoc team
Maybe you are looking for
-
How to find out list of users and their access on Sharepoint
Hello Everyone How can i find out list of users and what access they have on SharePoint site? I want to create table with list of the users and their access? Thanks
-
Extenal component not rendering file links properly
Hi Adobe CQ expert, We need to include an external web app (based on asp) into our new CQ website. The asp web app is a search engine which searches another internal document database and returnes a list of files such as powerpoints, pdfs etc. These
-
Compressor mysteriously won't open anymore
Hi, I've used Compressor with FCP 4.5 for over a year now. When I had to reinstall my system after a crash, Compressor is grayed out in FCP and won't open from the Finder. I have moved so many times I no longer have my disk. I've tried repairing perm
-
I am using the Oracle 10g express edition
Is it possible to connect using a Java program? If so, what connect string should I be using?
-
How to disable 'autoselect' in drawing mode? (S.O.7)
Hi, i've noticed this thing in Star Office 7, that whenever you've just drawn a line using the "Freeform Line" tool, the line you've drawn is automatically selected, so that if you want to draw another one, you have to drag the mouse all the way over