CW2.003 Report Writer - Using variable for file path/name 
Author Message
 CW2.003 Report Writer - Using variable for file path/name

Hi

Since using variables for the file path/name....my reports don't work any
more.  The report engine reports it cannot find the database/tables.

Any help in overcomming this will be appreciated...as i think i am
overlooking something very basic.

I am using calls with parameters to the report engine

Thanks

Ben



Fri, 23 Feb 2001 03:00:00 GMT  
 CW2.003 Report Writer - Using variable for file path/name
15 1/2 hours....

Must have stumped a lot of people here...as it did me..:-)



Sat, 24 Feb 2001 03:00:00 GMT  
 CW2.003 Report Writer - Using variable for file path/name
Hi Ben,

This is what I do when using Filename Variables:

1.  Export my Dictionary to a TXD.
2.  Edit the TXD using a Text Editor (ie. CW) and search for and Remove all
the File Name Variable entries.  They all begin with ",NAME(" ( eg.
,NAME(PathCustomer)).
3.  Save the TXD when done.
4.  Refresh your Report TXR using this TXD.

You Report.TXR will now expect to find the Data Files in the Current
Directory.    What you do next depends on how you are using the File Name
Variables.  If it is to simply point at Data on a Server, then Edit the
[SEARCHPATHS] entry in your Report.TXR to include the Server Data path eg.

[SEARCHPATHS]
 PATH('*.tps','N:\PROGDATA\')

However, if you are using the File Name Variables to point a different
directories say in a multi- company app then the approach is different.  I
use the SETPATH() function to change the Default directory before calling
the Report.Txr.  Some sample code follows:

!Data embed
RptCurrentPath      String(256)
RptDataPath         String(256)
RptParameters       String(256)
RptPrinter          String(70)

! Call Custom Reportwriter Reports

 Setcursor(CURSOR:Wait)
 RptCurrentPath = Path()
 RptDataPath    = Clip(RptCurrentPath)&'\'&Clip(PathARData)
 Setpath(Clip(RptDataPath))
 RptParameters = 'cwprint '&Clip(RptCurrentPath)&'\ARCUS.TXR /W'
 Run(Clip(RptParameters))
 Setpath(Clip(RptCurrentPath))
 Setcursor()

Hope this helps.

Regards

Steve Muller
the Father of "Roll Your Own" Accounts Receivable "The Complete Sample
Application for CW2-4)"


Quote:
> Hi

> Since using variables for the file path/name....my reports don't work any
> more.  The report engine reports it cannot find the database/tables.

> Any help in overcomming this will be appreciated...as i think i am
> overlooking something very basic.

> I am using calls with parameters to the report engine

> Thanks

> Ben



Sun, 25 Feb 2001 03:00:00 GMT  
 CW2.003 Report Writer - Using variable for file path/name
Thanks...

I will give it a try...

I am using multiple databases in multiple directories..

Ben

Quote:

>Hi Ben,

>This is what I do when using Filename Variables:

>1.  Export my Dictionary to a TXD.
>2.  Edit the TXD using a Text Editor (ie. CW) and search for and Remove all
>the File Name Variable entries.  They all begin with ",NAME(" ( eg.
>,NAME(PathCustomer)).
>3.  Save the TXD when done.
>4.  Refresh your Report TXR using this TXD.

>You Report.TXR will now expect to find the Data Files in the Current
>Directory.    What you do next depends on how you are using the File Name
>Variables.  If it is to simply point at Data on a Server, then Edit the
>[SEARCHPATHS] entry in your Report.TXR to include the Server Data path eg.

>[SEARCHPATHS]
> PATH('*.tps','N:\PROGDATA\')

>However, if you are using the File Name Variables to point a different
>directories say in a multi- company app then the approach is different.  I
>use the SETPATH() function to change the Default directory before calling
>the Report.Txr.  Some sample code follows:

>!Data embed
>RptCurrentPath      String(256)
>RptDataPath         String(256)
>RptParameters       String(256)
>RptPrinter          String(70)

>! Call Custom Reportwriter Reports

> Setcursor(CURSOR:Wait)
> RptCurrentPath = Path()
> RptDataPath    = Clip(RptCurrentPath)&'\'&Clip(PathARData)
> Setpath(Clip(RptDataPath))
> RptParameters = 'cwprint '&Clip(RptCurrentPath)&'\ARCUS.TXR /W'
> Run(Clip(RptParameters))
> Setpath(Clip(RptCurrentPath))
> Setcursor()

>Hope this helps.

>Regards

>Steve Muller
>the Father of "Roll Your Own" Accounts Receivable "The Complete Sample
>Application for CW2-4)"


>> Hi

>> Since using variables for the file path/name....my reports don't work any
>> more.  The report engine reports it cannot find the database/tables.

>> Any help in overcomming this will be appreciated...as i think i am
>> overlooking something very basic.

>> I am using calls with parameters to the report engine

>> Thanks

>> Ben



Sun, 25 Feb 2001 03:00:00 GMT  
 CW2.003 Report Writer - Using variable for file path/name
Hi Ben,

i  too had this problem...
here is how i did it:
in the report i declared a runtime variable with the same name as the file
variable used in the dictionary (!FileName) omitting the ! sign of course.
i passed the value (Path\FileName) from the app and it works fine.
hope i could help.
bye
Chris

bdl schrieb:

Quote:
> Hi

> Since using variables for the file path/name....my reports don't work any
> more.  The report engine reports it cannot find the database/tables.

> Any help in overcomming this will be appreciated...as i think i am
> overlooking something very basic.

> I am using calls with parameters to the report engine

> Thanks

> Ben



Sun, 25 Feb 2001 03:00:00 GMT  
 CW2.003 Report Writer - Using variable for file path/name

Ben,

Here is a example that I am using that allows the Report Writer or Runtime
Engine to find the files. Report Writer opens the .ini file with the same
name as the report .txr on its own.

SAMPLE CALL:





      ' /VUser=' & glo:user &|
      ' /W')

SAMPLE INI:

[Run]
[Variables]
ApDetailFile=01apdet.tps
ApInvFile=01apinv.tps
ApOpenFile=01apopen.tps
ApPayFile=01appay.tps
ApRInvFile=01aprinv.tps
ApRPayFile=01aprpay.tps
ApvendFile=01vend.tps
AropenFile=01open.tps
ArshipFile=01ship.tps
ArsmanFile=01sman.tps
CashFile=01cash.tps
CityFile=01city.tps
CusTaxFile=01custax.tps
CustomerFile=01cust.tps
EpaMastFile=01epamst.tps
EquipmentFile=01equip.tps
ExcMastFile=01excmst.tps
FuelCtlFile=01fctl.tps
FuelMstFile=01fuemst.tps
GlacctFile=01glact.tps
GlBegBalFile=01begbal.tps
GlclassFile=01glcls.tps
GLPLFile=01glp&l.tps
GlTranFile=01gltran.tps
GlTrialFile=01gltril.tps
GlTypeFile=01gltype.tps
InvaltFile=01ialt.tps
InvcatFile=01icat.tps
InvDetailFile=01idet.tps
InvmastFile=01imst.tps
InvReplFile=01repl.tps
InvtranFile=01itrn.tps
InvphyFile=01iphy.tps
OrdetailFile=01Ordd.tps
OrdMastFile=01Ordm.tps
OrdpriceFile=01Ordp.tps
OrdtableFile=01Ordt.tps
PartFile=01part.tps
PoFileFile=01pofile.tps
PoHeadFile=01pohead.tps
ProductFile=01prod.tps
PoMastFile=01pomast.tps
StaxcolFile=01tcol.tps
staxpayFile=01tpay.tps
TaxRateFile=01taxrat.tps
TermsFile=01term.tps
TrmMastFile=01trmmst.tps
VendPartFile=01vendp.tps
VTermsFile=01vterm.tps
[Paths]

Wesley Coleman

Quote:

>Hi

>Since using variables for the file path/name....my reports don't work any
>more.  The report engine reports it cannot find the database/tables.

>Any help in overcomming this will be appreciated...as i think i am
>overlooking something very basic.

>I am using calls with parameters to the report engine

>Thanks

>Ben



Tue, 27 Feb 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Date calculations using Report Writer or CW2.003

2. CW2.003 Report Writer Purchase.

3. Report Writer CW2.002 to 2.003....Problem

4. CW2.003 - Changing file path(s)

5. CW2.003 - file backup using Process Template

6. CW2.003 - file errors on Clarion file - HELP!

7. CW2.003 Copy file changes file date

8. Create string on report in CW2.003

9. CW2.003 - strange report behavior

10. CW2.003 - dynamic sort on a report?

11. Creating report fields at runtime in CW2.003

12. CW2.003 report problem

 

 
Powered by phpBB® Forum Software