Export the Report in Excel format
Hi,
How to export the Report in Excel format directly from the SAP to my Desktop.
Plz. give me the process???
Thanks
use this,
INCLUDE OLE2INCL.
INCLUDE EXCEL__C.
AND
H_EXCEL TYPE OLE2_OBJECT, " Excel object
H_MAPL TYPE OLE2_OBJECT, " list of workbooks
H_MAP TYPE OLE2_OBJECT, " workbook
H_ZL TYPE OLE2_OBJECT, " cell
H_F TYPE OLE2_OBJECT, " font
H TYPE I.
AND
PERFORM SUB_GET_DATA.
'get data here
PERFORM SUB_POP_DATA.
'populate data here
AND
PERFORM SUB_DISP_EXCEL.
*& Form SUB_DISP_EXCEL
FORM SUB_DISP_EXCEL.
START EXCEL
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
SET PROPERTY OF H_EXCEL 'Visible' = 1. " for printing o/p line by line in excel sheet
get list of workbooks, initially empty
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 10 'Mat Doc Number'(001) 'R'.
PERFORM FILL_CELL USING 1 2 1 4 'Item'(002) 'R'.
PERFORM FILL_CELL USING 1 3 1 10 'Mat Doc Date'(003) 'R'.
PERFORM FILL_CELL USING 1 4 1 10 'Vendor'(004) 'R'.
PERFORM FILL_CELL USING 1 5 1 20 'Mat Doc Item amount'(005) 'R'.
PERFORM FILL_CELL USING 1 6 1 15 'Material price'(006) 'R'.
PERFORM FILL_CELL USING 1 7 1 4 'Currency'(007) 'R'.
PERFORM FILL_CELL USING 1 8 1 18 'Material'(008) 'R'.
PERFORM FILL_CELL USING 1 9 1 30 'Material Desc'(009) 'R'.
PERFORM FILL_CELL USING 1 10 1 19 'Qty in Unit of Entry'(010) 'R'.
PERFORM FILL_CELL USING 1 11 1 19 'Qty Received'(011) 'R'.
PERFORM FILL_CELL USING 1 12 1 4 'Unit of Entry'(012) 'R'.
PERFORM FILL_CELL USING 1 13 1 20 'Mat Group'(013) 'R'.
PERFORM FILL_CELL USING 1 14 1 16 'Vendor Invoice'(016) 'C'.
LOOP AT T_OUT INTO W_OUT.
copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 10 W_OUT-MBLNR 'R'.
PERFORM FILL_CELL USING H 2 0 4 W_OUT-ZEILE 'R'.
PERFORM FILL_CELL USING H 3 0 10 W_OUT-BLDAT 'R'.
PERFORM FILL_CELL USING H 4 0 10 W_OUT-LIFNR 'R'.
PERFORM FILL_CELL USING H 5 0 20 W_OUT-DMBTR 'R'.
PERFORM FILL_CELL USING H 6 0 15 W_OUT-NETPR 'R'.
PERFORM FILL_CELL USING H 7 0 4 W_OUT-WAERS1 'R'.
PERFORM FILL_CELL USING H 8 0 18 W_OUT-MATNR 'R'.
PERFORM FILL_CELL USING H 9 0 30 W_OUT-MAKTX 'R'.
PERFORM FILL_CELL USING H 10 0 19 W_OUT-ERFMG 'R'.
PERFORM FILL_CELL USING H 11 0 19 W_OUT-WEMNG 'R'.
PERFORM FILL_CELL USING H 12 0 4 W_OUT-ERFME 'R'.
PERFORM FILL_CELL USING H 13 0 20 W_OUT-WGBEZ 'R'.
PERFORM FILL_CELL USING H 14 0 16 W_OUT-XBLNR 'C'.
CLEAR W_OUT.
ENDLOOP.
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTIN G #1 = 2.
SET PROPERTY OF H_EXCEL 'Visible' = 1.
PERFORM ERR_HDL USING 'Unable to create workbook'.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP EXPORTING #1 = 2. "----------can remove-------THIS IS FOR STAY AT LIST
PERFORM ERR_HDL USING 'Unable to create new workbook'..
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL USING 'Unable to free workbook'.
ENDFORM. " SUB_DISP_EXCEL
FORM FILL_CELL *
sets cell at coordinates i,j to value val boldtype bold *
FORM FILL_CELL USING I J BOLD COL VAL I_HORIZON_ALIGN.
CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
PERFORM ERR_HDL USING 'set cell object error'.
SET PROPERTY OF H_ZL 'Value' = VAL .
PERFORM ERR_HDL USING 'set value object error'.
GET PROPERTY OF H_ZL 'Font' = H_F.
PERFORM ERR_HDL USING 'set font object error'.
SET PROPERTY OF H_F 'Bold' = BOLD .
PERFORM ERR_HDL USING 'set bold object error'..
SET PROPERTY OF H_ZL 'ColumnWidth' = COL.
PERFORM ERR_HDL USING 'set columnwidth object error'.
IF NOT I_HORIZON_ALIGN IS INITIAL.
IF I_HORIZON_ALIGN = 'L'.
SET PROPERTY OF H_ZL 'HorizontalAlignment' = XLLEFT.
ELSEIF I_HORIZON_ALIGN = 'R'.
SET PROPERTY OF H_ZL 'HorizontalAlignment' = XLRIGHT.
ELSEIF I_HORIZON_ALIGN = 'C'.
SET PROPERTY OF H_ZL 'HorizontalAlignment' = XLCENTER.
ENDIF.
ENDIF.
PERFORM ERR_HDL USING 'set Alignment object error'.
ENDFORM. "FILL_CELL
*& Form ERR_HDL
outputs OLE error if any *
--> p1 text
<-- p2 text
FORM ERR_HDL USING VAL.
IF SY-SUBRC <> 0.
WRITE: / VAL.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
Similar Messages
-
How to Export SSRS report into Excel format using query string
Hello all,
I am new to SSRS world.
Last night i was trying to add a hyperlink on the SSRS report (.rdl) file, by clicking which we can export the report into "Excel" format, but with no luck.
Can anybody tell me how to form the hyperlink, so that we can export the report with its current content ( I mean the report content generated by selecting some parameter values)Hi Suman85,
Based on your scenario, you want to add a link on the SSRS report file, and then click it you can export the report into “Excel” format.
Just as kishan1901 said , you can add a textbox to your report and type in the words “Click here and export the report
to excel” .Then right-click the textbox and select Properties. Switch to Navigation tab, click the radiobutton of ‘Jump to URL’ and type in the expression ,here is just a example:
="http://vyof1884200/ReportServer$youhoo?/My+Adventure+Works/Product+Sales+and+Profitability+by+Month&rs:Command=Render&rs:Format=excel"
Then preview the report ,you will see
Click here and export the report to excel
when you move the mouse to it ,the mouse will become a hand ,then left-click, it will jump out a dialog box to indicate user whether the excel file should be saved , opened or canceled.
I think this is what you want, if you have any further requirement, could you please describe it in more detail? We would give you some resolution or workaround.
Regards,
Challen Foo -
Formating issue after export crystal report to excel format
Hi Everyone,
I have a crystal report devloped in crystal 8.5 and i am calling this report from my .net windows application. I have a problem when i export the report in excel format. One of the column size(which is report footer) gets increased because of which my report is not properly formated. I have reoved all the blank lines and extra space but still i am not able to reduce the column size. Any help will be appriciated.
Thanks in advance.Hi,
Please let us know the Visual Studio Version that you are using, just to inform you, VS2005 is compatible with CRXIR2 and above and VS2008 is compatible with CR2008 + SP0.
Do the report display properly from the designer? Does the Export from the designer in xls works fine?
Thanks,
AG. -
How can I export the report to Excel or CSV format in Rational(Java)?
<p>Dear all,</p><p>Now I develop CR report integrate with Web application, I use Ratioanl(RAD) to develop. And I want to export the report to Excel/CSV format, but always failed.</p><p>If I force it export CSV file in the system, when I use MS office to open this CSV file, the file content is bad.</p><p>Could any one tell me how to achieve this?</p><p> Many thanks!</p><p>Steven</p>
<p>CR4E is bundled with RAD 7...actually to be clear it is a version of CR4E Professional. Users of RAD 7 will also get a dev/test license of CR Server as well as number of additional features to support developing applications against their BusinessObjects Enterprise or Crystal Reports Server systems. For more information regarding the RAD 7 launch you can read the press release here:</p><p><strong><a href="http://biz.yahoo.com/bw/061205/20061205005363.html?.v=1">http://biz.yahoo.com/bw/061205/20061205005363.html?.v=1</a> </strong> </p><p>I am hoping to do a webinar in January highlighting a number of the new features available with the IBM Rational Application Developer integration.</p><p>As for RAD 6 support, unfortunately the CR4E toolkit does require Eclipse 3.2 support so it will not work with RAD 6. </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) <br /><br /> <strong><a href="http://www.eclipseplugincentral.com/Web_Links-index-req-ratelink-lid-639.html">Rate this plugin @ Eclipse Plugin Central</a></strong> </p>
-
How to export the report in HTML format for desktop application
Hi,
i have wrote the JRC desktop application to export the report and i am able to export it in PDF and other formats as mentioned in "ReportExportFormat" API.
i would like to know is there any API there which can export the report in HTML format.
i know it would be possible with web based application of JRC, but how can i do it in desktop application?There's no mechanism for static HTML pages that displays the report.
You can use the CrystalReportViewer DHTML viewer, but that's 'interactive'.
Sincerely,
Ted Ueda -
Issue while exporting the report to other formats
When the rpt file created in the BO server is used to view the report through the report viewer, there are export options available to choose from. If this export option is tried as MSExcel or Word document, the alignment, page headers and all are not coming in the same way like in the one generated through the PDF.
Hi aparmar,
Which version of the Crystal Report and Business Objects you are using?
Which SDK's you are using in your application to export the report to RTF format?
Also if you are using JRC in your application, you can follow the given link:
Font size in exported report
I hope the above link might be helpful.
Please revert if you need any other information.
Regards,
Anchal -
Exporting large report to Excel format (90K lines)
Hi,
I am trying to export a 90K line report to excel format and I get that error messsage:
Description : Une erreur d'application s'est produite sur le serveur. Les paramètres d'erreur personnalisés actuels pour cette application empêchent l'affichage à distance des détails de l'erreur de l'application (pour des raisons de sécurité). Cependant, ils peuvent être affichés par les navigateurs qui s'exécutent sur l'ordinateur serveur local.
Détails: Pour permettre l'affichage des détails de ce message d'erreur spécifique sur les ordinateurs distants, créez une balise <customErrors> dans un fichier de configuration "web.config" situé dans le répertoire racine de l'application Web en cours. Attribuez ensuite la valeur "off" à l'attribut "mode" de cette balise <customErrors>.
<!-- Fichier de configuration Web.Config -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Remarques: La page d'erreurs actuellement affichée peut être remplacée par une page d'erreurs personnalisée. Pour ce faire, modifiez l'attribut "defaultRedirect" de la balise de configuration <customErrors> de l'application, de sorte qu'il pointe vers une URL de la page d'erreurs personnalisée.
<!-- Fichier de configuration Web.Config -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
I believe it is a timeout problem. Any idea how work around this?
Thanks,I don't have the right to create reports. With those datas, I need grouping them filtering them, commenting them, creating TCD and distributing it. I believe it is easier exporting it and handle it. Also I don't want the data changing from day to day.
Then you are foobar'ed.
there is nothing more you can do it the SSRS export feature is not working for you, and you don't have access to the CM12 db and you can't create report. There are no other option to access the data.
Garth Jones | My blogs: Enhansoft and
Old Blog site | Twitter:
@GarthMJ -
Saving the report in Excel format form BO
Hi Team,
Would like to know how to provide/grant an access to User to save his/her BO reports in Excel format. Save as option is not being highlited for the user for saving the data into EXcel format.
Thanks.Hi,
Just check the preferences in the WEBI,
Just goto the option under preferences and check whether Prioritize easy data processing in Excel is enabled.
Select a priority for saving to MS Excel:
Prioritize easy data processing in Excel
Regards,
Ragoth.C -
Repersentation of #error in HFR while exporting the report in Excel
Hi All,
We are working on Hyperion Financial Report 9.3.1 with Essbase as a data source.
We are replacing the #error with 'NA', which is working fine when we are viewing the FR reports in workspace.
But when we export this report in Excel, word "NA" is changed by 0 (zero), which is misleading the user.
How can we stop this conversion (NA to 0)?
Any suggestion and help will be appreciated.
Thanks & Regards,
Mohit JainHi All,
Thanks for your answers and support.
I raised this issue to Oracle support also, I got the following response-
Hi Mohit,
I tested the case with the way you offered me. I can reproduce the problem. I think it should be a bug of the product.
I searched that on ML3. I found a bug which said that. This bug has been fixed in EPM 11.1.1.0.00. I tested that on my EPM 11.1.1.0.00 system. It works fine. The NA value can be exported in excel.
So would you like to upgrade to EPM 11.1.1.0.00 to fix the issue?
Hope this information will help others in future.
Thanks & Regards,
Mohit Jain -
Error while exporting crystal report to excel format or word format
i am using vs 2010 and sap crystal report(version 13.0.0.99) for vs 2010. when i export report to excel(97-2003 format) from crystalreportviewer, i am getting error that application has stopped working. I also have ms-office 2007 install on my pc.
when i see eventlog of system i notice following error:
Faulting application name: NBFCForms.exe, version: 1.0.0.0, time stamp: 0x4e170b01
Faulting module name: crxf_xls.dll, version: 13.0.0.99, time stamp: 0x4cc412ac
Exception code: 0xc0000409
Fault offset: 0x0009742e
Faulting process id: 0xc60
Faulting application start time: 0x01cc3e1e5657a4a4
Faulting application path: C:\Users\Harshada\Desktop\NBFCDeploy\NBFCForms.exe
Faulting module path: C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\crxf_xls.dll
Report Id: f0bae850-aa11-11e0-a98e-0019d144259bThanks Roberto and Kalpana.
This link solved the problem:
http://social.msdn.microsoft.com/Forums/en-US/bcf792f4-4da3-4dac-b689-60168e695683/error-internet-explorer-cannot-download-edreportviewerwebcontrolaxd-from-site?forum=vsreportcontrols -
Issues on exporting the report to Excel from full client BO 5.1
Hi,
I am facing a problem in exporting the BO report from Business Objects 5.1 to excel file. I am aware that there is no direct way to export the BO report to Excel from Business Objects(File--> save as to .txt file and then copy its data to excel )
When the export the BO report to excel file,I received two errors one over other
error1: Numeric data overflow (3349)
When I click OK button, second error received is like this
error2:export failed (dma0005)
I tried all options to fix this and also I looked for an dialog box " export to external file format " in Business Objects inorder to copy the report data to COPY TO DDE option but I didn't find any aforementioned dialog box
Please provide me the solution to fix the issues
Kind Regards,
SrinivasHi Denis,
Yes,all reports based on this particular universe have this problem
Are you telling me to isolate the object from the universe that is creating problems and then run the report ?
Also, I am unable to find the option from menu items in Full client BO 5.1 to open the dialog box with name " export to external file format ". Can you please tell me where I can find this?
Warm Regards,
Srinivas -
While exporting the Report to Excel Records are showing two times
Hello Gurus
When im trying to export a report from NW Portal to Excel, data is showing double times, even variable selections screen, records are showing two tmes.
What would be the problem, does we need any SP.
Thanks in advance.
Regd
LajwanthGURU'S ANY REPLIES........
-
How to export the report to Excel in Essbase
I have to export a report in exce from Web Analysis.
I am selecting the option Send to Excel given in services but when I am clicking to Export Pop up appears with message "Could not Export to File"
ThanksHi Ojha,
You wish to export to an excel page from a web analysis report.
When you select "send to excel" as one of the options of the "services", a lable named "send to excel " appears on your report(you can give a desired name of this label/buttion) , then come out of the "designer" mode and click on the buttion "send to excel"( or the buttion which you had just made by providing a name).
If you are doing this ,then a new excel should open .
Hope you dont have any problem with your microsoft excel too .It might not be the reason, but re check that too.
Sandeep Reddy Enti
HCC
http://analytiks.blogspot.com -
Cannot export crystal report in excel format from crystal report viewer
This problem occurs on only one workstation.
Open Advanced Reports > Enter workorder # > Click on 'workorder work(uninvoiced)' > Work order opens.
Click on icon "Export report"
Save as type: change to .xls
Error: Crystal Report Windows Forms Viewer. Error in file
SAP.......rpt:
Error detected by export DLL:
Export failed.Try adding c:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 to your windows enviroment variable PATH then restart.
-
Issue while exporting report in Excel Format
Hello,
I am facing problem while exporting the report in Excel Format. After analysis, I think that it could be due to two reasons, either we are using wrong versions of Jars, or we are using wrong API. Here is the code, approaches and problems we are facing. Please help.
First approach we are using is:
// using basic API
import com.crystaldecisions.reports.sdk.ReportClientDocument;
// get client document from crystal report API and open the report by specifying the report name, with path
ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.open( reportPath, 0 );
// give chance to extending classes to configure the report document by POJO or by sql parameter etc, just adding the parameters infromation using ParameterFieldController
configureReportDocument( reportClientDoc, reportMetadata, reportData, reportContext );
// get data source of crystal report
Object reportSource = reportClientDoc.getReportSource();
// export the data - we have also tried with MSExcel format
ReportExportFormat exportFormat = ReportExportFormat.recordToMSExcel;
LOGGER.debug( "exportFormat[" + exportFormat + "]" );
ByteArrayInputStream byteArray = (ByteArrayInputStream) reportClientDoc.getPrintOutputController().export(
exportFormat );
Problem Faced: Specified Excel format is not supported.
Second Approach: We come to know that excel format is supported with new releases and with occa package.
Then we tried with import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument; It ask to set the ReportServer. When we are trying to set the server as
reportClientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);
Application is unable to find 'ReportClientDocument.inprocConnectionString' property. It seems like we are using some old jars. However we have downloaded the latest released jars for eclipse 2.
Please help for it. Issue is to export the report in excel format, which is currently working fine for PDF. If this problem is related to Jars, please suggest the path to download the latest jars. We also looking for the latest jars like rasapp and rascore etc. But these are not available with Crystal Report for Eclipse 2 release.
Waiting for urgent help. Thanks you..
Regards,
MohitHi,
Send me Environment Details .
Here is the code snippet for exporting report to excel format:
<%@ page import="com.crystaldecisions.sdk.occa.report.application.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.definition.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.data.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
<%@ page import="com.crystaldecisions.sdk.framework.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.managedreports.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.exportoptions.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%
String username ="Administrator";
String password ="";
String cmsname ="localhost:6400";
String Authen ="secEnterprise";
//connecting to Enterprise
IEnterpriseSession es = CrystalEnterprise.getSessionMgr().logon(username,password,cmsname,Authen);
//get the report App Factory form the Crystal Enterprise
IReportAppFactory appFactory = (IReportAppFactory) es.getService("","RASReportService");
//get the infostore service form the Crystal Enterprise
IInfoStore istore = (IInfoStore) es.getService("","InfoStore");
//get the report by name from crystal Enterprise
IInfoObjects iobjects = istore.query("Select * From CI_INFOOBJECTS Where SI_NAME = 'sampleramz2.rpt' and SI_INSTANCE = 0 ");
//open the report in the report doc object.
ReportClientDocument Doc = appFactory.openDocument((IInfoObject)iobjects.get(0), 0, Locale.ENGLISH);
// WORKING WITH THE PRINT OUTPUT CONTROLLER
//Use the report documents PrintOutputController to export the report to a ByteArrayInputStream
ByteArrayInputStream byteIS = (ByteArrayInputStream)Doc.getPrintOutputController().export(ReportExportFormat.recordToMSExcel);
// EXPORTING THE REPORT
//Create a byte[] (same size as the exported ByteArrayInputStream)
byte[] buf = new byte[2000 * 1024];
int nRead = 0;
//Set response headers to indicate pdf MIME type and inline file
response.reset();
response.setHeader("Content-disposition", "inline;filename=ramz");
response.setContentType("application/xls");
//Send the Byte Array to the Client
while ((nRead = byteIS.read(buf)) != -1)
response.getOutputStream().write(buf, 0, nRead);
//Flush the output stream
response.getOutputStream().flush();
//Close the output stream
response.getOutputStream().close();
%>
Let me know any information is needed,
Regards,
Rameez
Maybe you are looking for
-
Problems with seagate external hdd
I have a Seagate 3TB external HDD attached to my iMac via a Firewire 800 cable. I have the latest software running (Yosemite 10.10.3) but the Mac no longer shows the HDD in finder, I can see it in disk utility but when i come to verify or repair the
-
Icloud backup dialog box will not allow me to unlock?
I can't unlock my iPad the icloud backup dialog box will not go away
-
Clearing Open Credit Memos with FINSTA01 - LOCKBX idoc
Hello, Has anyone been able to clear both invoices and credit memos with a LOCKBX idoc? We have successfully cleared open invoices but when trying to clear open credit memos the payments are still posting as attempting to clear invoices no matter ho
-
Lost photoshop CC software to electrical storm. How do I download another copy?
Over Christmas we had an electrical storm that wiped out quite a few of my programs. Have been able to restore everything on Mac Yosemite but not Photoshop CC or Lightroom. Where do I find download of these software programs?
-
Questions concerning OpenAL and SDL sound
Hi, After having sound problems with Warsow, I wanted to rebuild OpenAL as it seemed to use OSS by default. However, the PKGBUILD currently in ABS does not work anymore, the download for the source is invalid. I wrote my own PKGBUILD for openal-soft,