Crystal report to show clob xml data from oracle and export to excel

Hi, i have a xml based clob column in an oracle table.i need to fetch multiple xml rows from the table each containing below xml, extract 30-35 tags out and display in crystal report and export it as excel.pls help.primarily i need to be able to export the crystal report in excel format.I can do the extraction of data via query...but is there any ready made option of xml to excel in crystal report? Finally how to export the report to excel format?


The xml is as given below:

<?xml version="1.0" encoding="UTF-8"?>
<tns:Envelope xmlns:acc="urn:com:COMPANY:accounts" xmlns:bme="" xmlns:dsc="urn:com:COMPANY:remittance" xmlns:enrich="urn:com:COMPANY:FINALHUB:enrichment" xmlns:fxpm="urn:com:COMPANY:usrouter:fxpm" xmlns:isoPmtStsRpt="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03" xmlns:ns11="urn:com:COMPANY:FINALHUB:eodp" xmlns:ns7="urn:com:COMPANY:FINALHUB:bankrefdata" xmlns:ns8="urn:com:COMPANY:usrouter:tms" xmlns:pain="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02" xmlns:phub="urn:com:COMPANY:FINALHUB" xmlns:tns="" bme:version="1-0">
              <bme:From type="">FINALHUB</bme:From>
              <bme:To type="">PRPC</bme:To>
                           <bme:Schema location="FINALHUB-v1-3.xsd" namespace="urn:com:COMPANY:FINALHUB" version="1-1"/>
              <phub:Message version="1-3">
                           <phub:Disclosures version="1-0">
                                                       <dsc:TrfrCcyAmt Ccy="USD">12345.00</dsc:TrfrCcyAmt>
                                                       <dsc:FeeCcyAmt Ccy="USD">0.00</dsc:FeeCcyAmt>
                                                              <dsc:Amt Ccy="USD">0.00</dsc:Amt>
                                                       <dsc:TotalCcyAmt Ccy="USD">12345.00</dsc:TotalCcyAmt>
                                                       <dsc:TrfrCcyAmt Ccy="USD">12345.00</dsc:TrfrCcyAmt>
                                                       <dsc:FeeCcyAmt Ccy="USD" Estimated="false">9.85</dsc:FeeCcyAmt>
                                                       <dsc:TotalCcyAmt Ccy="USD" Estimated="false">12335.15</dsc:TotalCcyAmt>
                                                <dsc:Nme>BARCLAYS BANK PLC</dsc:Nme>
                                         <dsc:DsclmrInfo lang="English">
                                                <dsc:Ustrd><![CDATA[The recipient may receive less due to fees charged by the recipient's bank and foreign taxes.]]></dsc:Ustrd>
                                                <dsc:Ustrd><![CDATA[In the event you provide an incorrect account number or recipient institution identifier, you could lose the transfer amount.                                                                           ]]></dsc:Ustrd>
                                                <dsc:Ustrd><![CDATA[You can cancel for a full refund within 30 minutes of payment, unless the funds have been picked up or deposited. You have a right to dispute errors in your transactions.                              ]]></dsc:Ustrd>
                                                <dsc:Ustrd><![CDATA[If you think there is an error, contact us within 180 days at 212 of You can also contact us for a written explanation of your rights.                            ]]></dsc:Ustrd>
                                                <dsc:Ustrd><![CDATA[For questions or complaints about Bessemer Trust contact: Consumer Financial Protection Bureau  (TTY/TDD) (855)729-2372]]></dsc:Ustrd>
                                         <dsc:DsclmrInfo lang="Spanish">
                                                <dsc:Ustrd><![CDATA[El beneficiario podría recibir menos dinero debido a las comisiones cobradas por el banco del beneficiario e impuestos extranjeros.]]></dsc:Ustrd>
                                                <dsc:Ustrd><![CDATA[Puede cancelar el envío y recibir un reembolso total dentro de 30 minutos de haber realizado el pago, a no ser que los fondos hayan sido recogidos o depositados.                                       ]]></dsc:Ustrd>
                                                <dsc:Ustrd><![CDATA[Los fondos pueden recibirse previo a la fecha indicada arriba.                                                                                                                                          ]]></dsc:Ustrd>
                                                <dsc:Ustrd><![CDATA[Números de cuenta o código SWIFT BIC incorrectos pueden causar que el remitente pierda la cantidad de la transferencia. Verifique esta divulgación cuidadosamente.                                      ]]></dsc:Ustrd>
                                                <dsc:Ustrd><![CDATA[Usted tiene el derecho de discutir errores en su transacción. Si cree que hay un error, contáctenos dentro de 180 días al 14999 o                                        ]]></dsc:Ustrd>
                                                <dsc:Ustrd><![CDATA[También puede contactarnos para obtener una explicación escrita de sus derechos.                                                                                                                        ]]></dsc:Ustrd>
                                                <dsc:Nme>Consumer Financial Protection Bureau</dsc:Nme>
                                                       <dsc:AddressLine>1-1112 (TTY/TDD)  </dsc:AddressLine>
                                                              <dsc:CountryName> </dsc:CountryName>
                                         <dsc:OrgRmtInfo version="0-8">
                                                                     <dsc:CountryName>United States</dsc:CountryName>
                                                       <dsc:DbtCcyAndAmt Ccy="USD">12345</dsc:DbtCcyAndAmt>
                                                                     <dsc:CountryName>United States</dsc:CountryName>
                                                       <dsc:CrdtCcyAndAmt Ccy="USD">0</dsc:CrdtCcyAndAmt>
                                                       <dsc:TrfrFeeCcyAmt Ccy="USD">0</dsc:TrfrFeeCcyAmt>
                                                              <dsc:Amt Ccy="USD">0</dsc:Amt>
                                                       <dsc:Ustrd>UserId: U0914-62933 | Corpid: CHASESRV | UserName: QATestone  QAtestone</dsc:Ustrd>
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DevildibAuthor Commented:
Crystal report is required in this case.pls guide with examples if possible.
slightwv (䄆 Netminder) Commented:
I posted this in your other question before you closed it so I'll repost it here:
If the end-game is Excel, why involve Crystal Reports at all?

I use OpenXML with .Net to get data from Oracle into an xlsx file.

As far as parsing, I covered that in your previous questions:
I would probably start with LINQ.

There are MANY LINQ examples out there:

Since you only want 4 nodes, LINQ might be overkill but the other method is using the older XPATH stuff and probably not any faster.
DevildibAuthor Commented:
This is diff reqmnt.i need to extact 30-35 tags for crystal reportand then export it to excel.crystal is mandatory for our project for reporting.and final result is excel.pls suggest.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Are you asking if Crystal can use XML as a datasource?
The answer is yes provided the XML is in a format it expects.  I used multiple XML files in a project a few years ago.  As far as Crystal was concerned each XML file was a table with columns.  I could even join XML files together just like tables.

I agree with slightwv, unless there is a reason for Crystal such as getting it nicely formatted for viewing, there is no need to use it just to get to Excel.

Crystal unless setup just perfectly for export to Excel, results in an Excel file that is difficult to use since it merges cells, accounts for extra whitespace by adding columns.  The data only export loses all formatting so if you plan to use that there is no reason to go through Crystal.

slightwv (䄆 Netminder) Commented:
Can't help with the actual Crystal Reports piece.

We do have a VERY GOOD Crystal Expert here.

I'm sure he will be along later!

[edited]  and he showed up while I was typing!!!
DevildibAuthor Commented:
Ok.will wait for would be appreciated if you could pls pass this question to the crystal report expert you mentioned.sorry for the inconvinience.
Thanks slightwv.  You help me with Oracle and I'll help on the Crystal questions.

slightwv (䄆 Netminder) Commented:
>> if you could pls pass this question to the crystal report expert you mentioned

Nothing to pass, he arrived when I was typing that post.

That Expert is mlmcc!  When it comes to Crystal Reports, if he can't figure out how to do it, it likely cannot be done...

I seriously doubt Crystal Reports can parsse XML faster than native C# or native Oracle XML calls.

I would do what I suggested in the previous questions:  Extract the values first, report second.

I stand by what I posted before as well:
Extract the nodes as close to the source as possible.

How often is data loaded into the tables versus how often do you need to report on it?

You might be better off extracting the XML and storing it relationally when the XML is inserted.  Then there is no need to extract it when reporting since it has already been done.

You also mentioned the DB extract was too slow.

How slow is it and where do you need it to be?

It it currently takes 2 minutes and you 'want' 1 second, give up now.  I doubt Crystal, LINQ or XPATH will achieve that 'goal'.

You probably want to look at changing the table structure to store the data as the XMLTYPE data type not a CLOB.

It will open up more options for you.

My database is pretty much 90% XML and the fields I report on are stored relationally for efficiency.  My XML is inserted through a Stored Procedure so I can extract the nodes I want stored relationally and commit all inserts at one time.

You might need an insert trigger to populate the relational table.

Basically what you are doing is eating the time to read/parse/report and moving it to time to insert a row.

You can also create XPATH indexes that will allow you to quickly access specific nodes.  Look around for "Function Based Indexes".  Again though, you are adding time to insert to save time to report later.

There is no magic here.

BUT, I bet using a tool (Crystal) to extract data from Oracle to get it into Excel will be your slowest possible alternative.  Unless you need a really pretty formatted 'report' that opens in Excel.

mlmcc mentioned it above, I'll confirm it:, in report format:  Unless everything is 100% PERFECT, the Excel output is pretty much useless!!!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DevildibAuthor Commented:
Pls do not merge my questions.pls consider each question as a diff question.i saw that you were still in frame of mind where you remembered extracting 4 columns out of xml from separate question not this i had clearly mentioned 30-35 columns.pls answer specific questions and do not relate other questions.
DevildibAuthor Commented:
Request you not to merge my questions while giving expert comments.pls consider each question as a different question.
slightwv (䄆 Netminder) Commented:
I considered 4 nodes versus 35 nodes, the advice is still the same.

I provided advice based on 35 nodes.

I'm sorry if that wasn't the advice you wanted to hear.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.