?
Solved

exporting to a csv using line break

Posted on 2006-05-23
4
Medium Priority
?
402 Views
Last Modified: 2008-02-01
Hi,

I am exporting to csv using CR 10.0. In fact exported file are sql statements. I have formula in detail section where I have my sql:

"Update dbo.Matrix Set nConnectionDuration="&{s_Matrix_CR.nConnectionDuration}&", lConnectionCost="&{s_Matrix_CR.lConnectionCost}*1000000&", nDeductionPercentage="&{s_Matrix_CR.nDeductionPercentage}&", nDeductionThreshold="&{s_Matrix_CR.nDeductionThreshold}&" where tablenumber="&{s_Matrix_CR.tablenumber}&" AND destcode='"&{s_CountryList1.destcode}&"' AND accesscode='"&{s_Matrix_CR.accesscode}&"';"

When populated, I get this record:

Update dbo.Matrix Set nConnectionDuration=0.00, lConnectionCost=0.00, nDeductionPercentage=35.00, nDeductionThreshold=1.00 where tablenumber=218.00 AND destcode='00212' AND accesscode='0034';

What I need is to put a carriage return between each record and write GO for example:

Update dbo.Matrix Set nConnectionDuration=0, lConnectionCost=0, nDeductionPercentage=45, nDeductionThreshold=1 where tablenumber=207 AND destcode='0021210' AND accesscode='0034';      
GO
Update dbo.Matrix Set nConnectionDuration=0, lConnectionCost=0, nDeductionPercentage=45, nDeductionThreshold=1 where tablenumber=207 AND destcode='002126' AND accesscode='0034';
GO
....
....

I used Detail2 section and put GO in that section but when csv exported, I get this (which is not correct format):

Update dbo.Matrix Set nConnectionDuration=0, lConnectionCost=0, nDeductionPercentage=45, nDeductionThreshold=1 where tablenumber=207 AND destcode='0021210' AND accesscode='0034';      GO
Update dbo.Matrix Set nConnectionDuration=0, lConnectionCost=0, nDeductionPercentage=45, nDeductionThreshold=1 where tablenumber=207 AND destcode='002126' AND accesscode='0034';      GO

Can someone help me to format my report so that exported csv has carriage return and written with GO;

sql statement;
GO
sql statement;
GO

Thanks.

Nick

0
Comment
Question by:NickHoward
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
RickJ earned 300 total points
ID: 16747596
Create a formula with this...

'GO' + chr(13)

Then put it into your Detail2 section.
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 450 total points
ID: 16748098
Or to get GO on its own line

 chr(13) + 'GO' + chr(13)


You might actually need to use CR LF which is
 chr(10) + chr(13) + 'GO' +  chr(10) + chr(13)

mlmcc
0
 

Author Comment

by:NickHoward
ID: 16749617
Thanks and it worked.

I tried to split points but I don't know what happened - I am sorry if you do not get as expected.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 16757206
Split worked fine.

Glad i could help

mlmcc
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Is your organization moving toward a cloud and mobile-first environment? In this transition, your IT department will encounter many challenges, such as navigating how to: Deploy new applications and services to a growing team Accommodate employee…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question