Web Intelligence: Save Report as PDF and with embedded HTML code

Hi all.
Sorry but I'm not able to find any post about this matter, please feel free to provide links if you know existing topics about this problem.
We created a beautiful report with HTML5 code embedded into a blank cell and we are now trying to export it in a printable format (e.g.: PDF or HTML).
As you know (as per manual information) it is not possible to export a report with embedded HTML code and keeping it in the output (cell with embedded HTML code is rendered blank).
My question is: is there a known workaround or an alternative solution to export the report and keep its content?
Print screen is not a valid option :-P
Thanks for the support or any suggestions
Stecas

Product limitation; vote for change on ideaplace, etc. I don't believe there is an *easy* workaround, but see:
https://scn.sap.com/thread/3149287
HTH
NMG

Similar Messages

  • PDF printing with embedded HTML

    Hi all.... I am running Apex 4.0.2.00.07 on 10.2.0.4.
    I have a report that looks beautiful on a web page
    it's in in an interactive report with a 2 level grouping
    the data is 4 columns
    image, html table, image, html table
    The image is not stored in the database, it's in an images folder that I use the following code to display
    <pre>
    <img class="mainimage" src="/images/112045_cha.jpg" border=0>
    </pre>
    As for the class, that's in a css at the top
    <pre>
    <STYLE TYPE="text/css">
    .mainimage {
    max-width: 200px;
    max-height: 200px;
    width: expression(this.width > 200 ? "200px" : true);
    height: expression(this.height > 200 ? "200px" : true);
    </STYLE>
    </pre>
    When i look at it in the report, it looks nice, but my requirement is a need to print it.
    If i just print it from the browser, my rows don't line up at page breaks.
    If I export to HTML, my images don't retain the css tag and are too big (also the breaks are not honored)
    If I export to PDF, the breaks are not honored and the HTML is displayed (the img tags and the table displaying the data).
    I have FOP configured, BI Publisher is not an option due to budget.
    Anyone have any suggestions?

    Check this link,
    http://www.obinotes.com/2010/10/how-to-disable-html-tags-within-pdf-in.html
    You can use portalpagenav function and refrence the target report in the column data format instead of go url.
    Thanks,
    Vino

  • I want to open ppt or pptx from the web save them as PDFs and take notes on the pdfs for school. All from the ipad, I don't want to have to go back to my computer to e-mail or convert it.

    I want to open ppt or pptx from the web, save them as PDFs, and take notes on the pdfs for school. All from the ipad, I don't want to have to go back to my computer to e-mail or convert it.

    Apple's iWork apps
    http://www.apple.com/iwork/
    3rd party Microsoft equivalent apps
    http://www.polarisoffice.com/en/iOS.asp
    http://itunes.apple.com/sg/app/quickoffice-pro-hd-edit-office/id376212724?mt=8&l s=1
    http://itunes.apple.com/sg/app/office2-hd/id364361728?mt=8&ls=1
    http://itunes.apple.com/sg/app/documents-to-go-premium-office/id317107309?mt=8&l s=1
    http://itunes.apple.com/sg/app/polaris-office/id513188658?mt=8&ls=1
    Others, including cloud based
    Microsoft Office Web Apps:These are versatile apps since they can be used on or off the cloud. Expect a simplified experience to the full version of Microsoft Office suite.
    OnLive: Access both a degree of Windows desktop functionality and full Windows versions of Microsoft Office Suite.
    CloudOn: This was one of the first solutions for iOS productivity. Syncing with Dropbox, CloudOn offers a more complete Windows desktop. The tradeoff is it also offers a more pared-down version of Word, Excel, and PowerPoint.
    rollApp: Offers Open Office programs for iOS, also utilizing Dropbox.
    LogMeIn: Remotely access your home computer's desktop from your iOS device. This solution requires coordination of logins, settings, and hookups. The free version does not offer file transfer, but you can get a separate, free app for that.
    Google Docs: Now featuring Google Drive for iOS, users no longer have to battle with pressing the Refresh periodically to initiate syncing. This makes collaboration much smoother, resulting in a stronger office productivity product.

  • Saving report as PDF and text file

    Currently, I saved my report as PDF. It opens in Acrobat reader automatically when the report is executed. Is there a way for me to save it as PDF and as a text file at the same time? (without having to open the file in Acrobat reader and saving it)

    You can add your PDF and TEXT file formats to a distribution list (Instead of GENERATE REPORT TO A FILE). To do this:
    1. Go to your Object Navigator and highlight your report.
    2. Right click on your report. Select Property Palette.
    3. Select Distribution
    4. You can add of of the formats that you want to print or save to the report to.
    5. You will have to add Distribution Id (any number starting with 1) where you want the file to be saved (c:\my_reports\inventory.pdf), the type of file: PDF and how many copies you want: 2
    6. Click OK after finishing...
    To make it work ... You would highlight your report from your Object Navigator and then choose FILE-DISTRIBUTE and this will save it to all the files your specified and/or printer.
    null

  • Jasper report  for pdf and html

    Hi friends I am Gopi
    I am doing project in servlet and jasperreport in tomcat.
    I save my path jasperreport for Html and Pdf reports.
    when i click the jsp button Export to pdf and Export to Html,
    I need to open this files in new pdf application and new browser window .
    if(pdf1.equals("html"))
    JasperExportManager.exportReportToHtmlFile(jasperPrint, path +"\\" + reportName + ".html");
         exporter = new JRHtmlExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
              exporter.exportReport();
         if(pdf1.equals("pdf"))
              System.out.println("PDF");
              response.setContentType("application/pdf");
              JasperExportManager.exportReportToPdfFile(jasperPrint,path +"\\" + reportName + ".pdf");
              exporter = new JRPdfExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
              exporter.exportReport();          
    pls help me...

    gopikannang wrote:
    when i click the jsp button Export to pdf and Export to Html,
    I need to open this files in new pdf application and new browser window . Use the target attribute of the <form> or the <a> element which opens the PDF file. Set its value to "_blank".
    Learn HTML. There is a nice tutorial at w3schools.com and a good specification at w3.org.

  • Converting report to PDF and mailing

    Hi every one,
    I've gone through various threads and i'm aware of the Functional module's used to
    convert the report to pdf and mail it back.Like CONVERT_OTFSPOOLJOB_2_PDF, CONVERT_OTF_2_PDF and for mailing we have SEND_NEW_DOCUMENT_ATT_SEND_API1.
    I've worked with this but my problem is i'm not able to convet the report output to pdf.When i'm doing this i'm getting the output of my functional module converted to pdf like the number of header and item records available for the given data in the selection screen.
    Since all the threads i've gone through is converting the single internal table which has the output to pdf.
    But i've got the REUSE_ALV_HIERSQL_LIST_DISPLAY, hierarchial report which as known has got two internal tables.How to the same to this kind of report....More over is it possible to convert report to pdf in online without transfering it to spool and getting the spool id to convert it to pdf.........
    Any help or suggestions will surely be rewarded......
    Thanks in Advance.....

    Here is the complete code for you;
    It Converts spool request into PDF document and emails it.
    <b>http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm</b>
    Regards,
    Vishal

  • My form was created by FormsCentral.  I save as a PDF and emailed it to all of my club members.  When they complete the form, save it, and email it back to me, I get a blank form. Why?

    My form was created by FormsCentral.  I save as a PDF and emailed it to all of my club members.  When they complete the form, save it, and email it back to me, I get a blank form. Why?

    If you had iCloud backup turned on, and it made a backup - yes.  If you didn't have iCloud backup turned on - but were using iCloud for Contacts, calendars, etc.  You will get the contacts and calendars, etc back.
    Purchases made with your appleID can be redownloaded as long as they are still available in the iTunes store.
    If you connected your phone to a computer with iTunes, there may be a backup on there as well.

  • Hit "Save as Adobe pdf" and pic came out on top of text box.

    Win 7.0 64 bit, acrobat 11.0.10 word 2010, created a .docx file woth a pic and a tex box on top of pic.- hit Save as Adobe pdf and pic came out on top of text box.

    Hi wmckb,
    Please try using PDF Maker option in word and check if the same problem arises.
    Hope to hear from you.
    Regards,
    Anubha

  • Getting web host name, web-port, oral-report server name and virtual path

    Hi.
    I have been using oralce forms 6i on oracle application server 10g. I have three servers installed on remote locations.I just want that when i am hosting an application on a server, the web host name, web port , oracle report server name and the path of directory should be selected in a dynaminc variable at application level at run time. In this manner, I will be able to make a single application for all three servers. Any other solution to this problem is also welcomed. Please help anyone and oblige me.

    Hi Rajesh,
    Actually Web AS Host name is <Servername>.<domain name>:<Port no>
                 Web AS Path for R/3 is </sap/bc/bsp/sapd>
    Refer the following link.
    <a href="https://forums.sdn.sap.com/thread.jspa?threadID=402561">https://forums.sdn.sap.com/thread.jspa?threadID=402561</a>
    <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=265076">https://www.sdn.sap.com/irj/sdn/thread?threadID=265076</a>
    Regards
    Hemalatha
    /Assign points if helpful/

  • I cant save a fillable PDF and its saying there is a bad parameter.  How do i fix this?

    cant save a fillable PDF and its saying

    Hi annerleavitt,
    That Bad Parameter error is likely telling you that the PDF you're trying to fill in is damaged/corrupted. Where did you get the PDF? And are you opening it in Reader or Acrobat (what versions?).
    I look forward to hearing back from you.
    Best,
    Sara

  • Why a pdf document with embedded fonts can be copied but is not searchable in pdf reader

    I am writing a pdf files with embedded subset fonts. As required, I am including the ToUnicode and CIDSet objects. To test, I created a simple PDF with two Hebrew characters. I can select the two characters and copy to the clipboard, and paste it properly into another application such as Word. But I am not able to search for a word containing these two characters. Adobe Reader (or Acrobat) displays the message that the word was not found. So in essence, I have created a PDF document which can be copied properly, but is not searchable. Any idea what I might be missing when creating the document?
    Additional information: 1. The file in question is a minimal file with just two characters. I have tested with many such files in many different languages including English. None of the files are searchable. 2. Curiously, if I search for the letter 'e', Adobe reader highlights an incorrect word, even if the letter 'e' does not exists in the file. 3. Adobe acrobat is also not able to search within this file, however when I save the file to another disk file, the saved file now is searchable. I confirmed that the major objects such as the font-file, ToUnicode object, CID object, and the font description objects are the same in the saved file. However, one of the font object is brought up closer to the top of the file. 4. FoxIt is able to search these files properly.
    5 0 obj
      <</Filter /FlateDecode /Length 115>>
      stream
            q 0.750000 0 0 0.750000 0.000000 792.000000 cm
            q q q 0.160000 0.000000 0.000000 0.160000 0.000000 0.000000 cm
            BT /F0 100.000000 Tf 0 g 750.000000 -690 Td[<02B0>] TJ 35.000000 0 Td[<02B9>] TJ ET Q
            Q
            Q
            Q
    endstream
    endobj
    10 0 obj
    <</FontName/AAAAAA+ArialUnicode/CIDSet 9 0 R /Ascent 905/CapHeight 905/Descent -212/FontFamily(Arial)/Flags 32/FontBBox [0 -212 1000 905]/ItalicAngle 0/StemV 0/FontFile2 7 0 R/Type/FontDescriptor>>
    endobj
    11 0 obj
    <</BaseFont/AAAAAA+ArialUnicode/CIDToGIDMap/Identity/CIDSystemInfo <</Ordering(Identity)/Registry(Adobe) /Supplement 0>> /FontDescriptor 10 0 R/Subtype/CIDFontType2/Type/Font>>
    endobj
    12 0 obj
    <</Subtype/Type0/BaseFont/AAAAAA+ArialUnicode/Encoding/Identity-H/DescendantFonts [11 0 R]/ToUnicode 8 0 R/Type/Font>>
    endobj
    8 0 obj
      <</Filter /FlateDecode /Length 252>>
      stream
            /CIDInit /ProcSet findresource begin
            12 dict begin
            begincmap
            /CIDSystemInfo
            << /Registry (Adobe)
            /Ordering (UCS) /Supplement 0 >> def
            /CMapName /Adobe-Identity-UCS def
            /CMapType 2 def
            1 begincodespacerange
            <0000> <FFFF>
            endcodespacerange
            3 beginbfchar
            <0000> <0000>
            <02B0> <05E0>
            <02B9> <05E9>
            endbfchar
            endcmap
            CMapName currentdict /CMap defineresource pop
            end
            end
    endstream
    endobj

    I figured the app might have that ability - considering you can add text, highlight, add a signature, annotate and draw - so my thought was why not delete a page, or rearrange for that matter?.. That should be an option, this way we don't have to export to one of the other apps to delete or rearrange..
    Thanks for the help, Bernd.
    BTW if anyone is looking - PDF Max can do all of the above and delete and rearrange. With PDF Splicer you can delete and rearrange as well, but it has no other features.
    And as for Steve Werner whose comment was deleted after it got to my inbox, it is much more than a Reader, as you can plainly see from the amount of tasks the Reader app can do above.

  • How to input password automatically with below html code

      I want to display one pdf file with password(I know the password) on website.How to input password automatically
    with below html code:
    <object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="760" height="411" border="0">
          <param name="_Version" value="65539">
          <param name="_Password" value="1234">
    it seems <param name="_Password" value="1234"> does not work.
    Is there any way to input password of PDF file automatically on server side so that Client user don't need to input password.

    Not possible.

  • Convert a web report into pdf and print (in BW 3.5)

    Hello gurus,
    i have few web reports ( created using WAD). i am looking for a possibility to convert a web report (viewed in a browser by a user) into pdf and print them and this should be done by pressing a button.
    Is it possible in BW 3.5 version?.
    could anyone please help me?
    Any how to docs. would be really helpful.
    thanks and regards
    kumar

    Here it is
    <HTML>
    <!-- BW data source object tags -->
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="SET_DATA_PROVIDER"/>
             <param name="NAME" value="DATAPROVIDER_1"/>
             <param name="DATA_PROVIDER_ID" value=""/>
             DATA_PROVIDER:             DATAPROVIDER_1
    </object>
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="SET_PROPERTIES"/>
             <param name="TEMPLATE_ID" value="ZPD_ADHOC_PAGE"/>
             <param name="MENU_BACK" value=""/>
             <param name="MENU_BACK_TO_START" value=""/>
             <param name="SUPPRESS_WARNINGS" value="X"/>
             <param name="MENU_FILTER" value=""/>
             <param name="MENU_FILTER_ON_AXIS" value=""/>
             <param name="MENU_SELECT_FILTER" value=""/>
             <param name="MENU_FILTER_ON_AXIS_CHART" value=""/>
             <param name="MENU_FILTER_CHART" value=""/>
             <param name="MENU_FILTER_DRILL_DOWN" value=""/>
             <param name="MENU_DRILL_UP_GIS" value=""/>
             <param name="MENU_DRILL_DOWN" value=""/>
             <param name="MENU_EXCHANGE_OBJECTS" value=""/>
             <param name="MENU_REMOVE_DRILL_DOWN" value=""/>
             <param name="MENU_SWITCH_AXIS" value=""/>
             <param name="MENU_HIERARCHY_NODE_DRILL" value=""/>
             <param name="MENU_HIERARCHY_DRILL" value=""/>
             <param name="MENU_HIERARCHY_STATE" value=""/>
             <param name="MENU_SORT" value=""/>
             <param name="MENU_CALCULATE_RESULT" value=""/>
             <param name="MENU_CALCULATE_VALUE" value=""/>
             <param name="MENU_CUMULATE_VALUE" value=""/>
             <param name="MENU_DISPLAY_DOCUMENTS" value=""/>
             <param name="MENU_DOCUMENT_CREATE" value=""/>
             <param name="MENU_DISPLAY_DOCUMENT_PROP" value=""/>
             <param name="MENU_DISPLAY_DOCUMENT_SELEC" value=""/>
             <param name="MENU_RRI" value=""/>
             <param name="MENU_EXPORT_TO_CSV" value=""/>
             <param name="MENU_EXPORT_TO_XLS" value=""/>
             <param name="MENU_BOOKMARK" value=""/>
             <param name="MENU_CHARACTERISTIC_PROPERTIES" value=""/>
             <param name="MENU_VALUE_PROPERTIES" value=""/>
             <param name="MENU_QUERY_PROPERTIES" value=""/>
             <param name="MENU_VARIABLE_SCREEN" value=""/>
             <param name="MENU_CURRENCY_CONVERSION" value=""/>
             <param name="MENU_ENHANCED" value=""/>
             TEMPLATE PROPERTIES
    </object>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control">
    <TITLE>SAP BW Reporting Print Page</TITLE>
    <link href="/sap/bw/Mime/BEx/StyleSheets/BWReports.css" type="text/css" rel="stylesheet"/>
    <script type"text/javascript">
    <!--
    //   Global Variable Definition
    var dataTable = "";
    var pageRowCnt = 0;
    var prevPage = 0;
    var ColumnCnt = 0;
    var PrintDateTimeStamp = new Date();
    var rptWidth = 0;
    //DATE STAMP FUNCTION
    function datestamp(){
               var Today = new Date()
               document.write(Today);
    function getReportTitle() {
                    var myQueryString = window.location.search;
                    var startOfRptTitle = myQueryString.indexOf("QTITLE=");
                    if (startOfRptTitle != -1)
                         var endOfRptTitle = myQueryString.indexOf("&", startOfRptTitle + 7);
                         var myTitle = unescape(myQueryString.substring(startOfRptTitle + 7, endOfRptTitle));
                         var rpttitle = "";
                         for(i=0;i<myTitle.length;i++){
                             if (myTitle.substring(i,i+1) == "+"){
                                 rpttitle = rpttitle + ' ';
                             else
                                 rpttitle = rpttitle + (myTitle.substring(i,i+1));
                    else
                         var rpttitle =  "Unspecified Query Title";
                    return rpttitle;
    queryTitle=getReportTitle();
    function getHeading2() {
                    var myQueryString = window.location.search;
                    var startOfHdr2 = myQueryString.indexOf("HDR2=");
                    if (startOfHdr2 != -1)
                         var endOfHdr2 = myQueryString.indexOf("&", startOfHdr2 + 5);
                         var myHdr2 = unescape(myQueryString.substring(startOfHdr2 + 5, endOfHdr2));
                         var hdr2 = "";
                         for(i=0;i<myHdr2.length;i++){
                             if (myHdr2.substring(i,i+1) == "+"){
                                 hdr2 = hdr2 + ' ';
                             else
                                 hdr2 = hdr2 + (myHdr2.substring(i,i+1));
                    else
                         var hdr2 =  "#";
                    return hdr2;
    header2=getHeading2();
    function getHeading3() {
                    var myQueryString = window.location.search;
                    var startOfHdr3 = myQueryString.indexOf("HDR3=");
                    if (startOfHdr3 != -1)
                         var endOfHdr3 = myQueryString.indexOf("&", startOfHdr3 + 5);
                         var myHdr3 = unescape(myQueryString.substring(startOfHdr3 + 5, endOfHdr3));
                         var hdr3 = "";
                         for(i=0;i<myHdr3.length;i++){
                             if (myHdr3.substring(i,i+1) == "+"){
                                 hdr3 = hdr3 + ' ';
                             else
                                 hdr3 = hdr3 + (myHdr3.substring(i,i+1));
                    else
                         var hdr3 =  "#";
                    return hdr3;
    header3=getHeading3();
    function getAsOfDate() {
                    var myQueryString = window.location.search;
                    var startOfRelevance = myQueryString.indexOf("ASOFDATE=");
                    if (startOfRelevance != -1)
                         var endOfRelevance = myQueryString.indexOf("&", startOfRelevance + 9);
                         var myRelevance = unescape(myQueryString.substring(startOfRelevance + 9, endOfRelevance));
                         var asof = "";
                         for(i=0;i<myRelevance.length;i++){
                             if (myRelevance.substring(i,i+1) == "+"){
                                 asof = asof + ' ';
                             else
                                 asof = asof + (myRelevance.substring(i,i+1));
                    else
                         var asof =  "";
                    return asof;
    asofDateTime=getAsOfDate();
    function getPaperSize() {
                    var myQueryString = window.location.search;
                    var startOfPaperSize = myQueryString.indexOf("PSIZE=");
                    if (startOfPaperSize != -1)
                         var endOfPaperSize = myQueryString.indexOf("&", startOfPaperSize + 6);
                         var myPaperSize = unescape(myQueryString.substring(startOfPaperSize + 6, endOfPaperSize));
                         var psize = "";
                         for(i=0;i<myPaperSize.length;i++){
                                 psize = psize + (myPaperSize.substring(i,i+1));
                    else
                         var psize =  "0";    // default if none supplied  (normal 8x11)
                    return psize;
    varPaperSize=getPaperSize();
    var PaperSizeParamString='&PSIZE=' + escape(varPaperSize);
       switch(varPaperSize){
            case "0":    // Landscape - Letter
                           var WidthMax = 910;
                           var RowsPerPageMax = 38;
                           break;
            case "1":    // Landscape - Legal
                           var WidthMax = 1190;
                           var RowsPerPageMax = 38;
                           break;
            case "2":    // Portrait - Letter
                           var WidthMax = 660;
                           var RowsPerPageMax = 54;
                           break;
    function getTotalColumns() {
       var myHTML = dataTable.rows[1].innerHTML;
       var TotalTDs = 0;
       var nextTD = 0;
       for (i=0;i<myHTML.length;i++) {
           nextTD =  myHTML.indexOf("<TD", i);
           if (nextTD != -1) {
              i=nextTD;
              TotalTDs++;
           else break;
       return TotalTDs;
    function GetPageHeadings() {
       var headingHTM = "";
       var leftspancnt = 0;
       var rightspancnt = 0;
       var headingspancnt = 2;
       if (header2 != '#') headingspancnt = headingspancnt + 1;   // adjust for extra headings
       if (header3 != '#') headingspancnt = headingspancnt + 1;  
       if (currPage > 1) {
          headingHTM += '<TR style="page-break-before:always; display:none; visibility:hidden; "><TD Colspan="' + ColumnCnt + '"></td></tr>';
       else {
          headingHTM += '<TABLE  id="THEREPORT" name="MYREPORT" cellSpacing=0 cellPadding=0 width=' + WidthMax + ' border=0>';
       if (ColumnCnt == 1) {
          headingHTM += '<TR><TD vAlign=top align=left nowrap><font Size=3><STRONG>';
          headingHTM += queryTitle;
          headingHTM += '</STRONG></font></TD><TD Rowspan="' + headingspancnt + '" align="right" vAlign="top"><input type="image" border="0" name="SAPLogo" src="/sap/bw/Mime/Customer/Images/images.jpg" alt="SAP Logo"></TD></TR>';
          if (header2 != '#') headingHTM += '<TR><TD vAlign="top" align="left"><FONT Size=1>' + header2 + '</FONT></TD></TR>';
          if (header3 != '#') headingHTM += '<TR><TD vAlign="top" align="left"><FONT Size=1>' + header3 + '</FONT></TD></TR>';
          headingHTM += '<TR><TD vAlign="top" align="left"><FONT Size=1>' + asofDateTime + '</FONT></TD></TR>';
          headingHTM += '<TR><TD vAlign="top" align="left" Colspan="2"><hr size=2 color=black align=left></TD></TR>';
          headingHTM += '<tr>' + dataTable.rows[0].innerHTML + '<TD> </TD></TR>';
       else {
          leftspancnt = Math.floor(ColumnCnt/2);
          rightspancnt = ColumnCnt - leftspancnt;
          headingHTM += '<TR><TD vAlign=top align=left nowrap Colspan="' + leftspancnt + '"><font Size=3><STRONG>';
          headingHTM += queryTitle;
          headingHTM += '</STRONG></font></TD><TD Rowspan="' + headingspancnt + '" Colspan="' + rightspancnt  + '" align="right" vAlign="top"><input type="image" border="0" name="SAPLogo" src="/sap/bw/Mime/Customer/Images/images.jpg" alt="SAP Logo"></TD></TR>';
          if (header2 != '#') headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + leftspancnt + '"><FONT Size=1>' + header2 + '</FONT></TD></TR>';
          if (header3 != '#') headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + leftspancnt + '"><FONT Size=1>' + header3 + '</FONT></TD></TR>';
          headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + leftspancnt + '"><FONT Size=1>' + asofDateTime + '</FONT></TD></TR>';
          headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + ColumnCnt + '"><hr size=2 color=black align=left></TD></TR>';
          headingHTM += '<tr>' + dataTable.rows[0].innerHTML + '</TR>';
       return headingHTM;
    function GetPageFooting() {
       var footingHTM = "";
       var leftspancnt = 0;
       var rightspancnt = 0;
       if (ColumnCnt == 1) {
          footingHTM += '<TR><TD vAlign="top" align="left" Colspan="2"><hr size=2 color=black align=left></TD></TR>';
          footingHTM += '<TR><TD vAlign="top" align="left" nowrap><FONT Size=1>Prepared: ';
          footingHTM += PrintDateTimeStamp;
          footingHTM += '</FONT></TD><TD vAlign="top" align="right"><FONT Size=1>';
          footingHTM = footingHTM + 'Page ' + currPage.toString() + ' of ' + varPageTotal.toString();
          footingHTM += '</FONT></TD></TR>';
       else {
          leftspancnt = Math.floor(ColumnCnt/2);
          rightspancnt = ColumnCnt - leftspancnt;
          footingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + ColumnCnt + '"><hr size=2 color=black align=left></TD></TR>';
          footingHTM += '<TR><TD vAlign="top" align="left" nowrap Colspan="' + leftspancnt + '"><FONT Size=1>Prepared: ';
          footingHTM += PrintDateTimeStamp;
          footingHTM += '</FONT></TD><TD vAlign="top" align="right" Colspan="' + rightspancnt + '"><FONT Size=1>';
          footingHTM = footingHTM + 'Page ' + currPage.toString() + ' of ' + varPageTotal.toString();
          footingHTM += '</FONT></TD></TR>';
       return footingHTM;
    function GetReportFooting() {
       var footingHTM = "";
       footingHTM += '</TABLE>';
       return footingHTM;
    function formatToPrint() {
       var PrintHTM = "";
       PrintHTM += GetPageHeadings();
       if (ColumnCnt != 1) {
          for (var i=1;i<dataTable.rows.length;i++) {
               (currPage > prevPage)?prevPage=currPage:"";  //increment current page count
               if ((pageRowCnt + 1)>RowsPerPageMax){
                   PrintHTM += GetPageFooting();
                   pageRowCnt = 0;
                   currPage++;
               if (prevPage != currPage) {
                   PrintHTM += GetPageHeadings();
               else
                   PrintHTM += '<tr>' + dataTable.rows<i>.innerHTML + '</tr>';
                   pageRowCnt++;
       PrintHTM += GetPageFooting();       
       PrintHTM += GetReportFooting();
       return PrintHTM;
    function DisplayPrintNotice() {
    // Paper Size "0" is Letter with Landscape
    // Paper Size "1" is Legal with Landscape
    // Paper Size "2" is Letter with Portrait
    if (varPaperSize == "0") {var varMessage ="nn From your browser File Menu, select Page Setup and do the following: nn 1) Adjust the Printer Orientation to Landscape n 2) select Print menu, then select the Print button.";}
    if (varPaperSize == "1") {var varMessage ="nn From your browser File Menu, select Page Setup and do the following: nn 1) Adjust the Paper Size to Legal n 2) Adjust the Printer Orientation to Landscape n 3) select Print menu, then select the Print button.";}
    //if (varPaperSize == "2") {var varMessage ="nn From your browser File Menu, select Page Setup and do the following: nn 1) Adjust the Paper Size to Letter n 2) Adjust the Paper Source (if necessary) n 3) Adjust the Orientation to Portrait (default) n 4) Select the Okay button nn Again select the File Menu, select Print, then select the Print button.";}
    alert(varMessage);
    //window.print()
    /*   SAP BW Reporting Stylesheet Revisions        */        
    function writeStyleRevisions() {
    function writeDynamicFontRevisions(dynafont) {
    //Writes the Dynamic Stylesheet
    -->
    </script>
    </HEAD>
    <BODY>
    <TABLE  id="tp1" cellSpacing=0 cellPadding=0 width=660 border=0 >
        <TR>
        <TD vAlign=top align=left nowrap>
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="GET_ITEM"/>
             <param name="NAME" value="MYQUERY"/>
             <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID"/>
             <param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
             <param name="GENERATE_CAPTION" value=""/>
             <param name="GENERATE_LINKS" value=""/>
             <param name="WIDTH" value="660"/>
             <param name="BORDER_STYLE" value="NO_BORDER"/>
             <param name="SUPPRESS_REPETITION_TEXTS" value=""/>
             <param name="BLOCK_SIZE" value="3500"/>
             <param name="SHOW_PAGING_AREA_TOP" value="X"/>
             <param name="TARGET_DATA_PROVIDER_1" value="DATAPROVIDER_1"/>
             ITEM:            MYQUERY
    </object>
        </TD>
      </TR>
    </TABLE>
    <SCRIPT type="text/javascript">
    <!--
            var tbls = document.body.getElementsByTagName("TABLE");
            for (var i=0;i<tbls.length;i++) {
                  if (tbls<i>.name == "MYQUERY"){
                        var dataTable = tbls<i>;
                        break;
            document.title = queryTitle;
            rptWidth = dataTable.clientWidth;
            rptHeight = dataTable.clientHeight;
            originalRptWidth = rptWidth;
            originalRptHeight = rptHeight;
            originalRowHeight = Math.floor(rptHeight/(dataTable.rows.length+1));
            rptPageHeightMax = 580;                                                                                //660 less basic header and footer of 80
            if (header2 != '#') rptPageHeightMax = rptPageHeightMax - 20;   // adjust for extra headings
            if (header3 != '#') rptPageHeightMax = rptPageHeightMax - 20;  
            if (dataTable.rows.length == 1) {
                ColumnCnt = 1;                //No Applicable Data found message
            else {
                ColumnCnt = getTotalColumns();
            startingFont = 65;
            varFontSize = startingFont;
            if (rptWidth > WidthMax) {
                while ((rptWidth > WidthMax) && (varFontSize > 15))
                    writeDynamicFontRevisions(varFontSize);
                    rptWidth = dataTable.clientWidth;
                    rptHeight = dataTable.clientHeight;
                    varFontSize = varFontSize - 5;
                // calculate max rows per page
                rowHeight = Math.floor(rptHeight/(dataTable.rows.length+1)) + 1;        // add 1 for 2 row heading, add 1 for padding
                RowsPerPageMax = Math.floor(rptPageHeightMax/rowHeight) - 2;   // adjust for column headings
            if (dataTable.rows.length == 1) {
                varPageTotal = 1;                //No Applicable Data found message
            else {
                totalRows = dataTable.rows.length-1;                                       // total rows less headings
                varPageTotal = Math.floor(totalRows/RowsPerPageMax);       // compute total pages
                if (totalRows != (varPageTotal * RowsPerPageMax)) {
                    varPageTotal = varPageTotal + 1;                                        // if not a complete last page, add 1 for partial page
            currPage = 1;
            document.write(formatToPrint());
            document.all.tp1.style.display = "none";
            document.all.tp1.style.visibility = "hidden";
    //        DisplayPrintNotice();
    -->
    </SCRIPT>
    <STYLE>
    input.ie55   { display: none }
    </STYLE>
    <!-- special style sheet for printing -->
    <STYLE media=print>
    .noprint     { display: none }
    </STYLE>
    <script defer>
    function window.onload() {
        if (!factory.object) {
            return
        else {
    //     factory.printing.header = "SAP"
    //     factory.printing.footer = "SAP"
            if ( varPaperSize == "2" ) { factory.printing.portrait = true; }
            else { factory.printing.portrait = false; }
            factory.printing.Print(true);
            // enable control buttons
      /*  var templateSupported = factory.printing.IsTemplateSupported();
           var controls = idControls.all.tags("input");
           for ( i = 0; i < controls.length; i++ ) {
               controls<i>.disabled = false;
               if ( templateSupported && controls<i>.className == "ie55" )
                  controls<i>.style.display = "inline";
    </script>
    <P>
    <div id=idControls class="noprint" style="VISIBILITY: hidden">
    <input disabled type="button" value="Print this page"
    onclick="factory.printing.Print(true)">
    <input disabled type="button" value="Page Setup..."
    onclick="factory.printing.PageSetup()">
    <input class=ie55 disabled type="button" value="Print Preview..."
    onclick="factory.printing.Preview()">
    <input class=ie55 disabled type="button" value="Landscape"
    onclick="factory.printing.portrait=false">
    <input class=ie55 disabled type="button" value="Portrait"
    onclick="factory.printing.portrait=true">
    </div>
    </BODY>
    </HTML>

  • CRM ONLINE 2013: On Approval Of Quotation, Run Report, Generate PDF and Send an Email With PDF as attachment

    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>

  • Exporting report as PDF and CSV formats same time with out executing DB query twice

    Post Author: cpriyanka
    CA Forum: Exporting
    I am using Crystal Report 9.0 version and Java.
    I am getting "PrintOutputController" from "ReportClientDocument"
    And then by calling export(ReportExportFormat.PDF) generating PDF format report.
    Now I need to generate both PDF and CSV format files same time. How can it be done?
    My understanding is when we call "export" it does the DB query execution and other functionality.
    In that case, if I call "export" two times with two different formats, then DB query will be executed twice and that takes lot of time.
    To avoid, is there a way I can all some API so DB query executed once, but I can export report in to multiple formats?
    I appreciate your help.
    Thanks.

    Post Author: cjmorris1201
    CA Forum: Exporting
    Hello,
    Are you using the "pull" or "push" method for your crystal reports?  If you are using the "pull" method (the report itself executes the sql) then I believe there is no way around having the query execute twice since it is fired off each time you open and export the report.
    If you use the "push" method, however, then you can just create the recordset/dataset and then set the datasouce once for the report.
    Here's a broad overview of push and pull though the Crystal Report Viewer is used.  The viewer may or may not be applicable in your case:
    http://aspalliance.com/265_Crystal_Report_for_Visual_Studio_NET#Page5
    Regards, Carl

Maybe you are looking for

  • Problem with uploading manual bank statements

    Hey everyone, I am having trouble with a client who seems to have put some manual bank statements in the system using transaction ff67. Although there were some direct deposit customer payments in that account, they did not reflect in the customers a

  • Particle Playground: trouble with wall and particle image

    Hello Friends, I'm fairly new to all of the fancy stuff in After Effects, particularly particles, but I've had a lot of success so far, and just one problem that I can't seem to figure out. Perhaps someone here can help me. I'm trying to create a cli

  • Command   R does not work

    Model name: IMAC Processor: 2.5 GHZ Memory 4 GB Storage capacity: 500 GB the computer has two operating systems, Mac and windows. My Mac was OS lion mountain that I upgraded to Yosemite. I manged to damage both operating systems. after 3 days of work

  • ITunes eats up CPU

    My iTunes eats up CPU (95%-142%) while converting from MP3 to AAC!? 18 tracks (134 MB) is not to much I assume! Fans on my MacBook Pro 17" are working non-stop (at 5800-6000 min.Speed) during this "operation"! Is there a particular reason or there is

  • Query Description Required

    Hi All, I have a requirement, whereby when I run t.code ST03N, I get technical name of a query I would like to have the description of the query is the a way to do so ? Say via SE16 ... and get them ... Please assist Nathan