Export to Excel or PDF Custom tag...

After scouring the web I've put together a custom tag that
will allow HTML data to be streamed to an Excel file or a PDF.
First I created the custom tag called "contentWrapper":
<cfsilent>
<cfparam name="url.exportType" default=""><!--- I am
the output type for this page; pdf, flashpaper, excel or html
--->
<!--- check to see what whether the "ExportFormat" string
exists in the URL --->
<cfswitch expression="#url.exportType#">
<!--- Begin logic "ExportFormat" string = pdf or
flashpagerexists in the URL --->
<cfcase value="pdf,flashpaper">
<cfif thisTag.executionMode eq "end">
<cfdocument format="#url.exportType#">
<cfoutput>
<html>
<head>
<title>Export to PDF or Flashpaper</title>
</head>
<body>
#thisTag.generatedContent#
</body>
</html>
<cfdocumentitem type="header"><span
style="font-face: Verdana; font-size: 0.7em">Footer
Content</span></cfdocumentitem>
<cfdocumentitem type="footer"><span
style="font-face: Verdana; font-size:
0.7em">#dateFormat(now(),"short")#
#timeFormat(now(),"short")#</span></cfdocumentitem>
</cfoutput>
</cfdocument>
</cfif>
</cfcase>
<!--- End logic "ExportFormat" string = pdf or
flashpagerexists in the URL --->
<!--- Begin logic "ExportFormat" string = excel in the
URL --->
<cfcase value="excel">
<cfif thisTag.executionMode eq "end">
<cfheader name="Content-Disposition"
value="filename=export.xls">
<cfcontent type="application/msexcel"
variable="#ToBinary( ToBase64( thisTag.GeneratedContent.Trim() )
)#">
</cfif>
</cfcase>
<!--- End logic "ExportFormat" string = excel in the URL
--->
</cfswitch>
</cfsilent>
Next I place my custom tag around a HTML table:
<!--- Begin Content Wrapper Custom --->
<tags:contentWrapper>
<!-- Begin content table -->
<table width="90%" border="0" cellpadding="2"
cellspacing="1" bgcolor="#000000">
<tr>
<td align="center"
bgcolor="#CCCCCC"><strong>Custom
tag</strong></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">Export to Excel or
PDF</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">Example</td>
</tr>
<tr>
<td bgcolor="#FFFFFF"> </td>
</tr>
</table>
<!-- End content table -->
</tags:contentWrapper>
<!--- End Content Wrapper Custom --->
Finally I used two form buttons inconjunction with the
onClick event to open my PDF or Excel file:
<cfoutput>
<table cellpadding="" cellspacing="">
<tr>
<td>
<!-- Begin buttons used to pass the exportType -->
<input type="button" onClick="window.open('
http://#HTTP_HOST#/#SCRIPT_NAME#?#QUERY_STRING#&exporttype=pdf');"
value="Export To PDF">
<input type="button" onClick="window.open('
http://#HTTP_HOST#/#SCRIPT_NAME#?#QUERY_STRING#&exporttype=excel');"
value="Export To Excel">
<!-- End buttons used to pass the exportType -->
</td>
</tr>
</table>
</cfoutput>
Voila.

Did u tried the first method? i.e directly exporting the analysis to excel?
Thanks.

Similar Messages

  • Any ideas on how to merge 2 reports on page to export to Excel or PDF?

    This is for OBIEE 11g (we are currently running 11.1.1.6.8). We have a user requirement to put the prompt selections on each report that is exported to Excel or exported to PDF. This requirement has to do with auditors. We cannot use the Filter Criteria view because we have saved filters that contain other saved filters so not all of the filters are shown. What the users want is to just have the ability to Export to Excel or PDF for one report and add the prompt criteria so that it also shows in Excel or PDF. We know we can use presentation variables and create a narrative view to show all of the prompt criteria. But we don't want to have this in a view in the compound layout of every report on the page (we have many pages with many reports on them). What we would like to do is have the Export (to Excel or PDF) download the prompt criteria (like when you use the printable HTML and printable PDF functionality only we want this for one report). So think of merging the report that is being Exported to Excel or PDF with another report that is built to show the prompt criteria. Is anyone else doing this kind of functionality? Any ideas on how to do this with javascript?
    We created an SR on this to find out if Oracle had some ideas but they did not and said that this is already an enhancement request ( Bug 8242921: ALLOW PROMPTS TO BE DISPLAYED WHEN DOWNLOAD TO EXCEL)
    Any help would be appreciated. Marybeth

    Did u tried the first method? i.e directly exporting the analysis to excel?
    Thanks.

  • How to Audit the Report which is Export to Excel and PDF

    Hi All,
    Is there any way that we can audit the report which is exported to Excel or PDF and what data the user is exporting to his local computer.
    We can audit the scheduled report with output Excel or pdf but i am not sure about the audit for report export activity to excel and pdf.
    Thanks & Regards,
    Rahul Akurathi

    Hi,
    You said that you have a new request number when you changed the program in Dev. Release that request and ask your Basis guys to move that transport to Testing Client. The program will be automatically updated in the testing client with the changes you have done in Dev when the transport gets imported in testing.
    Reward if useful.
    Thanks
    Aneesh.

  • How to Export to Excel and Pdf

    Hi,
    I displayed the data into table using JSP page.
    I am creating two buttons as one is Export to Excel and 2nd one is Export to Pdf. If i click Export to Excel button then the table data has to Export to Excel sheet. and same to to Pdf also.
    Can you please send me the corresponding code
    It's very urgent

    Can you please send me the corresponding codereally ???
    It's very urgentindeed...
    See:
    - iText (pdf) => www.lowagie.com/iText/
    - POI HSSF (excel) => http://poi.apache.org/hssf/index.html
    hope that helps

  • Export to Excel and PDF

    Hi Guys,
    I need a bit of a help for exporting my data to Excel or PDF. Can someone link me to a good article how can I do this using SAP NetWeaver Developer Studio CE. Thanks a lot guys!

    Hi,
    Export to Excel:
    Please look at this [wiki|http://wiki.sdn.sap.com/wiki/display/WDJava/UploadingexcelfileusingWebDynproforJava]
    [Web Dynpro Java - Exporting Table Data into Excel|http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproJava-ExportingTableDataUsingOn-DemandStreams-SAPNW+7.0]
    Export to PDF:
    check this thread
    [Export to PDF|Export to PDF] and [Transfer data from WebDynpro Context to PDF|Transfer data from WebDynpro Context to PDF - Options]
    Hope this helps!!
    Thanks & Regards
    Vijay K

  • How can I export from Excel to pdf using Acrobat Std to achieve uniform page size throughout the whole pdf document?

    After exporting the whole workbook to a single pdf file, page sizes are inconsistent. When viewing the document in full screen, some pages show up as 25% zoomed, others as 34%.  I could re-print the exported pdf file to pdf in Acrobat Std, and that way I could get the same page size throughout the document, but then I loose my bookmarks, which I don't want.
    I have already set the page size to A4 in Excel, but that's not where my problem lies. any help, hint is appreciated.

    A good place to start is Karl Heinz Kremer's blog, where he has a few examples:
    http://khkonsulting.com/2010/09/reading-pdf-form-fields-with-vba/

  • Creating a macro for export to excel using a custom map

    Hi all
    I've created a custom map to export a custom table to excel, which works. Then tried to create a macro to do this export for me and it was stopped on the 'File; Save As' part of the export (almost the very beginning)
    Looking for suggestions for best practises or anything to watch out for when creating a macro to export (or any help in general in this area...books, etc)
    Using MSP 2010 (Pro)...we have server but I was attempting this as a stand-alone project
    Thanks in advance for your response
    Shelleyb MCTS

    Firstly make sure you have SP2 installed. Then try recording a macro of you manually saving to Excel with a pre-saved map. Compare the recorded code and your code.
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • Does Adobe Export convert Excel to pdf. ?

    Yes or No ?

    Hi georgebenjamin,
    The other way around: ExportPDF converts PDF files to Excel (and several other formats). Adobe PDF Pack, on the other hand, lets you convert Excel files to PDF.
    Best,
    Sara

  • Pdf export to Excel is changing dates to Aremenian

    I am exporting to Excel from .pdf.  It is taking the dates and converting them to Armenian and switching the months and days around.  I cannot find where it is telling this to do it.  Under my options, language, it is checked English.
    Does anyone know where it is told to change the format to this?

    I am having the same problem except it is changing mine to Afrikaans......any help is appreciated.

  • Export tray captions to PDF/Excel

    Hello,
    Does anyone know how i can export the tray captions to Excel/PDF.
    I'm missing all my captions when i export to excel or pdf.
    Please help.
    Kind regards,
    Jeroen

    Hello,
    I'm facing the same problem and I would like to know if you found any solution to this very embarassing issue ?
    Thanks in advance,
    Regards,
    François

  • Export to Excel from Reports produces corrupt file format

    Whenever I choose to export to excel results of custom reports I am unable to open the file as I am told the file format is corrupt. The contents show as containing xml data and even changing the extension from xls to xml does not get me anywhere.
    If I save the report and then download I am still informed the file format does not match the extension but the fie will open in Excel.

    Hi,
    Please raise a ticket or provide the URL if the issue is still there.
    Kind Regards,
    Alex

  • Exporting simple tables in pdf to Excel or word and maintain correct text/column flow.

    Even with a black and white, clear scan at high settings, my exports to Word/Excel result are poor.  Text is recognized but not in the correct sequence for editing.  I find myself using the column select (Alt key) feature and exporting columns one at a time!  When exporting to Excel, the contents of one cell in the pdf table ends up in 20 cells in Excel among many other misalignments.  When exporting to word, it's a mess of tabs/graphics/paragraph returns...etc.  I find myself selecting the text in 25 or so graphic text boxes!
    Appears that many people have the same experience but I haven't seen a solution as advertised by Adobe.  It appears so easy on video.
    Can anyone recommend a step-by-step proven method (Win 7, Acrobat X, Office 2007, InDesign CS5.5)?
    Txs!

    I am not sure about what video, but my guess is that was a PDF produced from Excel or WORD with PDFMaker. In such a case, it would have tags and all that would retain all of the information you need. When you are working with a scanned document, you have no such tag info that provides layout info (like cell locations and such). There are some 3rd party products that are said to do a better job in such cases, but often cost as much as Acrobat and only do the conversion. If you can point out the video, then maybe we can discuss aspects of what you are doing compared to the video.

  • WAD Export to Excel, PDF parameters query export

    Hi,
    I solve the problem with export to excel in WAD. Customer want to see all parameters (and also filters in query) with which are query execute in query in  export to MS Excel or PDF.
    Any advices?
    Thanks
    Petr

    Hi,
    Take a copy of template 0ANALYZER, it will have all the components which have the web analyzer.
    Check the below link for the same:
    http://help.sap.com/saphelp_nw04/helpdata/en/0d/af12403dbedd5fe10000000a155106/frameset.htm
    Hope this helps........
    Rgs,
    Ravikanth

  • How do I get PDF forms to export to excel in the desired order?

    How do I get PDF forms to export to excel in the desired order?
    Here is what I have done:
    As taken from another post:
    Choose Forms > Manage Form Data > Merge Data Files Into Spreadsheet.
    In the Export Data From Multiple Forms dialog box, click Add Files.
    In the Select file Containing Form Data dialog box, select a file format option in File Of Type option (Acrobat Form Data Files or All Files). Then locate the form files that you want to merge into the spreadsheet, select them, and click Select.
    Repeat the previous step to add form data files that are in other locations, as needed.
    Click Export. Then select a folder and filename for the spreadsheet, and click Save.
    In the Export Progress dialog box, click either View File Now to open the spreadsheet file or Close Dialog to return to Acrobat."
         The problem now is that Adobe populates Excel in ABC order of the form, based off of the name of each box in the form. For example, if my form has three text boxes, named A, B, and C, then Adobe will export to Excel as such:
    Row 1 =         A                              B                              C
    Row 2 =         data entered             data entered              data entered
    where 'data entered' is whatever the user typed into the form boxes. But what if I want a different order for exporting, and I don't want to rename my text boxes? What if I want:
    Row 1 =         C                              B                              A
    Row 2 =         data entered             data entered              data entered   ?
    Is there a way to do this in acrobat x or xi?
    Thanks

    I don't have time to test right now, but there was a change with Acrobat 10 where it exports according to the tab order, which you may have to set manually, so give that a shot. Otherwise, you'll have to process the file after it's exported if you need the fields in a particular order. This wouldn't be too difficult to do with something like a VBS or JS script in Windows.

  • One digit in customer number missing in Export to excel download

    Dear All,
               We have a customized report for customer collection.The output of this report is as per desired. But when we download it to excel last digit in customer master is missing.That means say customer number is 1100051 while we export to excel customer number showing is 110005 , last digit gets missing. This is for all the customers.
              One more point I would like to state here. In that report we have 2 radio buttons. Bank Receipt and Down Payment . This error is coming only for Down payment radio button.
              Can anybody please help me solve this issue.
    Regards
    Abhijit

    hi ABHIJIT DAS ,
    debug and see the internal table values ,whether the customes is comming fully  and also check the fiels length for
    that customer .
    regards,
    chinnaiya P

Maybe you are looking for

  • How to DMZ my Xbox

    I got the new E4200 router as I had issues with my old router. I was able to DMZ my console with the old router. But with my new router my xbox IP has changed and I want to know which numbers to use and how to DMZ my Xbox with Cisco Connect. Thanks,

  • How do I reverse an auto update? mainly a java update

    On 6/13/12 there were a few "automatic" updates - one of them was a JAVA for MAC OS X 10.6 update 9    (updating Java SE;6 to 1.6.0_33) Ever since this was installed - I can no longer access a site that has worked for some time now.  It is a USCG Aux

  • ITunes 9 on Leopard 10.5.8 - RIP speeds now stuck at 8x

    Hi, So I was happily importing some new cd's into my collection, all were around 30-40x on my G5 Powermac Dual 1.8 I had one cd that the last track was not reading and so I turned on error correction, then tried to rip that track again. The track jus

  • There is an incompatible version of Nokia PC Suite...

    Hi, I just installed Nokia OVI Suite for my N97 and after reboot my PC, i tried to open OVI Suite but it gave me following error; "There is an incompatible version of Nokia PC Suite installed on your PC. Please, uninstall it, or upgrade to recent ver

  • Blackberry Passport not charging

    They basically asked me the usual questions like is your charger good etc. When I told them it was my fault and I just wanted to buy a battery from them, for whatever price they want, they just told me to send it in the shop I bought it from. I live