Board index » delphi » Help with ReportSmith and report variables please.

Help with ReportSmith and report variables please.

Please can some kind person tell me how to transfer the value from a
Date variable to ReportSmith at runtime?

I've managed to transfer string values from variables using the
following:

Report2.InitialValues.Add('@rptvar=<'+stringvar+'>');

But no matter what I've tried I can't get a date to work.

Can anyone please give me a short example which will transfer a date
variable to a report variable in ReportSmith at runtime?

Thank's in advance

 

Re:Help with ReportSmith and report variables please.


Quote
tuff...@pncl.co.uk (Keith Walter) wrote:
> >Please can some kind person tell me how to transfer the value from a
> >Date variable to ReportSmith at runtime?

> >I've managed to transfer string values from variables using the
> >following:

> >Report2.InitialValues.Add('@rptvar=<'+stringvar+'>');

> >But no matter what I've tried I can't get a date to work.
Stefan Paetow wrote:
> Change the date variable into a string and then, in ReportSmith, change
> it back to Date...

> Hope this helps and works...

I'm having the same problem, too. In my report, there is a report
variable: rvTestDate (Date type). In my Delphi application,
the following lines work:

  Report1.InitialValues.Add('@rvTestDate=<''11/15/95''>');
  Report1.Run;

However, I could not make it work with:
  var
    vDateStr: String;
  ...
    vDateStr := '11/15/95';
    Report1.InitialValues.Add('@rvTestDate=<'+vDateStr+'>');
    Report1.Run;

Is '@rvTestDate=<'+vDateStr+'>' the correct syntax to assign a
variable? though there is no error message at compilering time from
Delphi. I cann't find any information on it. Actually, I copied it
from tuffley's message.

Someone help us, please.

--
FANG LUO                   |
New Mexico Bureau of Mines | E-mail: fa...@prism.nmt.edu
Campus Station             | Office: (505) 835-5627
Socorro, NM 87801          | Fax   : (505) 835-6333

Re:Help with ReportSmith and report variables please.


Quote
tuff...@pncl.co.uk (Keith Walter) wrote:

| >Please can some kind person tell me how to transfer the value from a
| >Date variable to ReportSmith at runtime?
| >
| >I've managed to transfer string values from variables using the
| >following:
| >
| >Report2.InitialValues.Add('@rptvar=<'+stringvar+'>');
| >
| >But no matter what I've tried I can't get a date to work.
| >
| >Can anyone please give me a short example which will transfer a date
| >variable to a report variable in ReportSmith at runtime?

Well I've figured out how to do it, but there must be an easier way.

It looks like Reportsmith insists on receiving the date in US style
mm/dd/yy rather than the European way ie dd/mm/yy

Am I correct in this assumption, or am I missing something?

Anyone else had this problem/solved it in any other way? It's a pain
having to rotate the date every time I run Reportsmith.

Other Threads