Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Crystal Reports with Office XP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00612908
Message ID:
00613313
Vues:
22
>I'm running WinXP with Office XP and do not have any problems opening a Word DOC exported from Crystal. I'm running Crystal 8.5.
>
>What happens if you export to RTF instead of DOC?


Hi Dan,

I'm not familiar with how to export to rtf, here's the method I'm using, any help would be appreciated on how to do that.

Is it the format type that you change?

TIA

***hsfrmmaresbooked.m_toword()
wait window at 25,50 "Please be patient, creating report..." nowait
*thisform.lockscreen = .t.
local lc_word, lc_dbf, lc_crreport, lc_title
lc_dbf = fullpath("") + substr(sys(2015),3,10) + ".dbf"
lc_word = fullpath("") + substr(sys(2015),3,10) + ".doc"
*********************
with thisform.hscntmaresbooked
with .hsoptpage
if .option1.value = 1
lc_crreport = sys(5) + "\foxdat\crystalreports\cr_marebooknewpage.rpt"
else
lc_crreport = sys(5) + "\foxdat\crystalreports\cr_marebook.rpt"
endif
endwith
*********************
with .hsoptcategory
do case
case .option1.value = 1
mcategory = " category <> ' ' "
case .option2.value = 1
mcategory = " category = 'F' "
case option3.value = 1
mcategory = " category = 'O' "
otherwise
mcategory = " category <> ' ' "
endcase
endwith
*********************
with .hsoptorder
do case
case .option1.value = 1
morder = " BOOKED_TO,NAME "
case .option2.value = 1
morder = " BOOKED_TO, accounts.lname_comp, accounts.fname, name "
case .option3.value = 1
morder = " name "
case .option4.value = 1
morder = " accountys.lname_comp, accounts.fname, name "
case .option5.value = 1
morder = " syn_mem.lname, syn_mem.fname, name "
otherwise
morder = " name "
endcase
endwith
**************************
if .hscmbstallions.value <> " "
mbookedto = " booked_to = [" + alltrim(.hscmbstallions.value ) + "] "
else
mbookedto = " ! inlist(booked_to,'CANCEL','UNKNOW','RETIRE','SELL','DELETE',' ') "
endif
**************************
myear = " yr_bred = " + str(.hslstyear.value)
thisform.r_title = alltrim(str(.hslstyear.value))
**************************
select ;
master.yr_foaled, ;
master.p_b, ;
master.last_bred, ;
master.category, ;
master.type, ;
master.p_s_c, ;
master.acct_no as acct_no, ;
master.name, ;
master.booked_to, ;
master.yr_bred, ;
master.syn_acct as syn_acct, ;
master.age_rec, ;
master.life_earn, ;
master.sire1, ;
master.dam1, ;
iif(accounts.fname = " ",alltrim(accounts.lname_comp),alltrim(accounts.fname) + ;
" " + alltrim(accounts.lname_comp)) as owner, ;
iif(syn_mem.fname = " ",alltrim(syn_mem.lname),alltrim(syn_mem.fname) + ;
" " + alltrim(syn_mem.lname)) as synmember ;
from ;
master ;
left outer join ;
accounts ;
on master.acct_no = accounts.acct_no ;
left outer join ;
syn_mem ;
on master.syn_acct = syn_mem.syn_acct ;
where ;
&mbookedto ;
and ;
&mcategory ;
and ;
&myear ;
and ;
type = "B" ;
order by ;
&morder ;
into cursor sys(2015) noconsole
copy to &lc_dbf type fox2x
with thisform
.r_crystalapp = createobject("crystalruntime.application")
.r_crreport = .r_crystalapp.openreport(lc_crreport)
.r_crreport.enableparameterprompting = .f.
lc_title = .r_crreport.parameterfields
lc_title.item(1).setcurrentvalue(.r_title)
.odatabase = .r_crreport.database
.otables = .odatabase.tables
.otable = .otables.item(1)
.otable.location = lc_dbf
.r_crreportoptions = .r_crreport.exportoptions
with .r_crreportoptions
.formattype = (14)
.destinationtype = (1)
.diskfilename = (lc_word)
endwith
.r_crreport.export(.f.)
.otable = " "
.otables = " "
.odatabase = " "
.r_crreport = " "
.r_crystalapp = " "
endwith
erase(lc_dbf)
oword = createobject("word.application")
oword.visible = .t.
oword.documents.open(lc_word)
oword.selection.wholestory
#define autoinchestopoint 72
with oword.selection.pagesetup
.orientation = 1
endwith
thisform.refresh
messagebox("You may now edit your document." + chr(13) + "Please do a 'SAVE AS' in ;
'Word' before continuing, otherwise your file will not be saved","'Save As' and Close 'Word'")
on error do errtrap with error()
oword.documents.close(0)
oword.application.quit()
erase(lc_word)
on error
with .hsoptcategory
.option1.value = 0
.option2.value = 0
.option3.value = 0
endwith
with .hsoptorder
.option1.value = 0
.option2.value = 0
.option3.value = 0
.option4.value = 0
.option5.value = 0
endwith
with .hsoptdestination
.option1.value = 0
.option2.value = 0
.option3.value = 0
endwith
with .hsoptpage
.option1.value = 0
.option2.value = 0
endwith
.hschknotbred.value = 0
.hslstyear.value = 0
wait clear
* thisform.lockscreen = .f.
endwith
thisform.refresh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform