• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

ReportSmith InitialValues

How do I send InitialValues to ReportSmith from Delphi when they are Date variables??  I am using D1.
0
jdthedj
Asked:
jdthedj
  • 2
1 Solution
 
ZifNabCommented:
Try this, I haven't tested it because I almost always use QuickReport. I found this in the Lloyd's Help file. Hopefully it solves your problem.

Q:  How do I pass variables to Report Smith?

A:  The important part of the code is line to concatenate the single quotes to the string.  (If it is just a string that is being passed, you don't need the embedded quotes.  That is for a date string.)

In Report Smith, the REP VAR is

Name: tday
Type: DATE
Entry: Type-in

(Note:  The values passed to RS are case sensitive.)

procedure PassVars;
var s: string;
begin
  s := DateToStr(date);
  s := '''' + s + ''''; {This is not needed for regular strings.}

  report1.InitialValues.add('@tday=<'+s+'>');
  report1.run;
end;

{ This code came from Lloyd's help file! }

Have fun,
c.u. ZifNab;
0
 
jdthedjAuthor Commented:
Thanks ZifNab for your help - it's just what I needed
0
 
ZifNabCommented:
Glad I could help you.

Have fun,
c.u. ZifNab;
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now