Discussion:
Defining report text components before or at runtime
(too old to reply)
William O.
2008-07-24 01:29:29 UTC
Permalink
Hi,

Another newbie to Rave here...
Is there a programmatic way to set the text value of a component in a report before it is generated?
There are some variables I'd like to set in the title of a report before it is generated.

I am migrating a simple report from ReportBuilder to Rave 7.5.2 BE and some of the labels in ReportBuilder are modified
programmatically.

TIA

~ William
Thomas Pfister
2008-07-24 05:02:17 UTC
Permalink
William,

with this informations I think the SetParam / Parameter - way is the best
way.

there are other solution like RANT or CustomConnection but start with the
Parameters of Rave....
there should informations in the help /PDF file from Rave.



:-) Thomas Pfister

________________________________________
This mail was sent using 100% recycled electrons
Post by William O.
Hi,
Another newbie to Rave here...
Is there a programmatic way to set the text value of a component in a
report before it is generated?
There are some variables I'd like to set in the title of a report before it is generated.
I am migrating a simple report from ReportBuilder to Rave 7.5.2 BE and
some of the labels in ReportBuilder are modified programmatically.
TIA
~ William
William O.
2008-07-24 05:32:52 UTC
Permalink
Thanks Thomas,

RANT looks a little too complicated for what I need to do right now. My brain is melting from learning IntraWeb and TMS Intraweb
components at the same time. I'll certainly set some time aside to look into it though.

~ William.
Post by Thomas Pfister
William,
with this informations I think the SetParam / Parameter - way is the best way.
there are other solution like RANT or CustomConnection but start with the Parameters of Rave.... there should informations in the
help /PDF file from Rave.
:-) Thomas Pfister
________________________________________
This mail was sent using 100% recycled electrons
Post by William O.
Hi,
Another newbie to Rave here...
Is there a programmatic way to set the text value of a component in a
report before it is generated?
There are some variables I'd like to set in the title of a report before it is generated.
I am migrating a simple report from ReportBuilder to Rave 7.5.2 BE and
some of the labels in ReportBuilder are modified programmatically.
TIA
~ William
William O.
2008-07-24 05:09:27 UTC
Permalink
I've just worked it out reading sections 2.6.1 of the RaveDevGuide.pdf supplied using GetParam() and SetParam().

Of note, the Delphi code in section 2.6.8 (straight to PDF with no setup) did not work for me. As a workaround I did the following:
"...
RvDataSetConnection1.DataSet := myQry; //probably not relevant for this
RvProject1.ProjectFile := path + 'SubjectHistory.rav'; //dynamically locating the rav file at runtime
RvSystem1.DefaultDest := rdFile;
RvSystem1.DoNativeOutput := False;
RvSystem1.RenderObject := RvRenderPDF1;
RvSystem1.OutputFileName := fname; //a pre-defined filename with full file path
RvSystem1.SystemSetups := RvSystem1.SystemSetups - [ssAllowSetup];
//RvSystem1.Execute; //this didn't generate for some reason
RvProject1.Execute; //this did. I'm assuming RvSystem1.Execute was suppose to invoke this too
..."

Regards,
William.
Post by William O.
Hi,
Another newbie to Rave here...
Is there a programmatic way to set the text value of a component in a report before it is generated?
There are some variables I'd like to set in the title of a report before it is generated.
I am migrating a simple report from ReportBuilder to Rave 7.5.2 BE and some of the labels in ReportBuilder are modified
programmatically.
TIA
~ William
Thomas Pfister
2008-07-24 10:37:32 UTC
Permalink
Hello William,

//RvSystem1.Execute; //this didn't generate for some reason
RvProject1.Execute; //this did. I'm assuming RvSystem1.Execute was suppose
to invoke this too

RvProject1.Execute is the right one for this .. the RvSystem1.Execute is
especially for codebased-reports....



:-) thomas
Thomas Pfister
2008-07-24 10:30:12 UTC
Permalink
Hello William,

the set and getParam is later....

-> define in your rave-project a parameter like "test" (property parameters
of the RvProject on the top of the tree on the right side)
-> insert in your report1-page1 a datatext, open the DataField and select
your parameter "test" from project parameters AND click
"insert report var" -> now you'll the Param.Test in the DataText-area on
the bottom.
-> save the report.file

in your Delphi: RvProject1.SetParam('test', edit1.text);
RvProject1.Execute('Report1');

that's all!


:-) thomas
Post by William O.
I've just worked it out reading sections 2.6.1 of the RaveDevGuide.pdf
supplied using GetParam() and SetParam().
Of note, the Delphi code in section 2.6.8 (straight to PDF with no
"...
RvDataSetConnection1.DataSet := myQry; //probably not relevant for this
RvProject1.ProjectFile := path + 'SubjectHistory.rav'; //dynamically
locating the rav file at runtime
RvSystem1.DefaultDest := rdFile;
RvSystem1.DoNativeOutput := False;
RvSystem1.RenderObject := RvRenderPDF1;
RvSystem1.OutputFileName := fname; //a pre-defined filename with full file path
RvSystem1.SystemSetups := RvSystem1.SystemSetups - [ssAllowSetup];
//RvSystem1.Execute; //this didn't generate for some reason
RvProject1.Execute; //this did. I'm assuming RvSystem1.Execute was
suppose to invoke this too
..."
Regards,
William.
Post by William O.
Hi,
Another newbie to Rave here...
Is there a programmatic way to set the text value of a component in a
report before it is generated?
There are some variables I'd like to set in the title of a report before it is generated.
I am migrating a simple report from ReportBuilder to Rave 7.5.2 BE
and some of the labels in ReportBuilder are modified
programmatically.
TIA
~ William
William O.
2008-07-24 11:14:35 UTC
Permalink
Thanks Thomas!

I did it a little differently...
Post by Thomas Pfister
Hello William,
the set and getParam is later....
-> define in your rave-project a parameter like "test" (property
parameters of the RvProject on the top of the tree on the right side)
Did that.
Post by Thomas Pfister
-> insert in your report1-page1 a datatext, open the DataField and
select your parameter "test" from project parameters AND click
"insert report var" -> now you'll the Param.Test in the DataText-area on
the bottom.
I didn't do that. I inserted a plain text component and used the BeforeOpen event on the band containing the component to set the
text value....However, following your instructions, I think I just saw how to define page numbers and the like :D
Post by Thomas Pfister
-> save the report.file
in your Delphi: RvProject1.SetParam('test', edit1.text);
RvProject1.Execute('Report1');
I didn't specifically define the report as you've shown but I'll try it to ensure there's no 'accidental' confusion in the future
should I add more reports.

Thanks again :)

~ William

Loading...