Change printed Text at runtime - Fastreport

Hello everyone,

when loading a fastreport, preparing the report and try to print, the value of the datasetfields are filled in the event afterdata. I would like to change the results of the databasefields at runtime without using fastscript. Because frxReport1 doesn't have the event afterdata, I tried all events attached to frxReport1 and the only one, that has already the result of the datasetfields is frxReport1AfterPrint(Sender: TfrxReportComponent). That's why, I tried this one. The Problem is, that it runs into the 
event, displays the right value, makes the changes, but the changes are not displayed in preview or on the printer.

procedure TForm1.frxReport1AfterPrint(Sender: TfrxReportComponent);
var
   text : widestring;
begin
   if ((Sender is TfrxMemoView) and (Sender.Name = 'Memo1')) then begin
      //Memo1 normally has [Query1."Fieldname1"]
      text := TfrxMemoView(sender).Lines.Text;
      //Now Memo1 is set with the value of the Datasetfield
      //This value of the databasefield I want to change now
      TfrxMemoView(sender).Lines.Text := text + 'asdf';
   end;
end;

Can anybody help me please? I've tried for several days now, but it won't work.

Thank you very much!

Klaus Demetz-Schittek
1
Klaus
2/5/2010 10:51:03 AM
embarcadero.delphi.reporting 487 articles. 0 followers. Follow

2 Replies
8408 Views

Similar Articles

[PageSpeed] 17

Dear Klaus Demetz-Schittek!

You should use Report.PreviewPages.ModifyPage(PageIndex, Page) function if 
you change object properties in afterprint event.

or example
 page:=   frxReport.PreviewPages.CurPage;
 Report.PreviewPages.ModifyPage(PageIndex, Page)


"Klaus Demetz-Schittek" wrote: news:210881@forums.codegear.com...
> Hello everyone,
>
> when loading a fastreport, preparing the report and try to print, the 
> value of the datasetfields are filled in the event afterdata. I would like 
> to change the results of the databasefields at runtime without using 
> fastscript. Because frxReport1 doesn't have the event afterdata, I tried 
> all events attached to frxReport1 and the only one, that has already the 
> result of the datasetfields is frxReport1AfterPrint(Sender: 
> TfrxReportComponent). That's why, I tried this one. The Problem is, that 
> it runs into the
> event, displays the right value, makes the changes, but the changes are 
> not displayed in preview or on the printer.
>
> procedure TForm1.frxReport1AfterPrint(Sender: TfrxReportComponent);
> var
>   text : widestring;
> begin
>   if ((Sender is TfrxMemoView) and (Sender.Name = 'Memo1')) then begin
>      //Memo1 normally has [Query1."Fieldname1"]
>      text := TfrxMemoView(sender).Lines.Text;
>      //Now Memo1 is set with the value of the Datasetfield
>      //This value of the databasefield I want to change now
>      TfrxMemoView(sender).Lines.Text := text + 'asdf';
>   end;
> end;
>
> Can anybody help me please? I've tried for several days now, but it won't 
> work.
>
> Thank you very much!
>
> Klaus Demetz-Schittek

-- 
Best regards,
 Michael Philippenko    mailto:michael@fast-report.com
 Fast Reports - reporting must be Fast!
 http://www.fast-report.com
0
Michael
2/5/2010 12:51:23 PM
> {quote:title=Michael Philippenko wrote:}{quote}
> Dear Klaus Demetz-Schittek!
> 
> You should use Report.PreviewPages.ModifyPage(PageIndex, Page) function if 
> you change object properties in afterprint event.
> 
> or example
>  page:=   frxReport.PreviewPages.CurPage;
>  Report.PreviewPages.ModifyPage(PageIndex, Page)
> 
> 
> "Klaus Demetz-Schittek" wrote: news:210881@forums.codegear.com...
> > Hello everyone,
> >
> > when loading a fastreport, preparing the report and try to print, the 
> > value of the datasetfields are filled in the event afterdata. I would like 
> > to change the results of the databasefields at runtime without using 
> > fastscript. Because frxReport1 doesn't have the event afterdata, I tried 
> > all events attached to frxReport1 and the only one, that has already the 
> > result of the datasetfields is frxReport1AfterPrint(Sender: 
> > TfrxReportComponent). That's why, I tried this one. The Problem is, that 
> > it runs into the
> > event, displays the right value, makes the changes, but the changes are 
> > not displayed in preview or on the printer.
> >
> > procedure TForm1.frxReport1AfterPrint(Sender: TfrxReportComponent);
> > var
> >   text : widestring;
> > begin
> >   if ((Sender is TfrxMemoView) and (Sender.Name = 'Memo1')) then begin
> >      //Memo1 normally has [Query1."Fieldname1"]
> >      text := TfrxMemoView(sender).Lines.Text;
> >      //Now Memo1 is set with the value of the Datasetfield
> >      //This value of the databasefield I want to change now
> >      TfrxMemoView(sender).Lines.Text := text + 'asdf';
> >   end;
> > end;
> >
> > Can anybody help me please? I've tried for several days now, but it won't 
> > work.
> >
> > Thank you very much!
> >
> > Klaus Demetz-Schittek
> 
> -- 
> Best regards,
>  Michael Philippenko    mailto:michael@fast-report.com
>  Fast Reports - reporting must be Fast!
>  http://www.fast-report.com

Thank you very much! It works!

Klaus
1
Klaus
2/10/2010 5:45:40 PM
Reply:

Similar Artilces:

Delphi 2010
Hi, I'm using Delphi 2010 and Rave Reports (comes built in, v. 7.7.0). I have been using this couple for 5 months without any problem. In my company i have use two languages, first i use our primary language (Turkish) and when people wants to use another language i changed the specific text and memo values according to their tag value. This approach worked fine till last week. Last week changing the values at runtime stopped work. I don't know why, everything seems ok with the code, i also tried to check changed values, the values seemed to changed but when i execetu reports a...

How to change text in a text object of composite report.
--------------B06487694CA25DFE68949459 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, In composite report I need dynamicaly change some text fields' values. I tried to get child and used dot notation., but it didn't work. bellw is the code. What is wromg? string ls_name SELECT frb_label_txt INTO :ls_name FROM srt_lvl_typ_cd_dfn WHERE typ_cd_ind = "2" AND dist_cd = :gs_dist; Datawindowchild dwc_report dw_1.GetChild("d_nonofficer",dwc_report) dwc_report.Object.level3_t.text = ls_name --------------B064876...

text change, why wont you text change!!!!
Hi i've got a huge form with loadsa recordsets that populate text boxes, AND I MEAN LOADS!!!!It involves some calculationsI have text1.text which goes away and changes text2.text which is fine, but in text2.text i have another on text change thingy which it wont call :(any one have any ideas : )also does any one know how i could call a txt change, so it does the call total a. dont know if thats possible as well. Private Sub txtShare_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtShare.TextChanged Call Total_A() End SubThank you if any one one could help...

Quick Report print overlapping lines when printing RTF text
Hi! I'm using: - Delphi 6 - QuickReport 3.5.1 Professional I noticed that the QuickReport impressions made with large amounts of RTF text were taking too long between the pages. The result appear ok, but after a test generating PDF and XPS, I noticed the QuickReport was overlapping lines when printing RTF (large amount of) text. Example: - When selecting 1 paragraph in XPS built file, copy, and paste in notepad, gives me 5 copies of the text. To print 25 pages of text, It took more than 3 minutes on a LaserJet Printer. I concluded the slow printing is result of sending larg...

Displaying Loading Image Over The Crystal Report + Changing Report PageOrientation At The Time Of Print
 Hi, I Want To Put an Animated GIF Image Over The Crystal Report Means At The Center Of The Report When The Report is Loading And That I have To Do In Asp.Net 2.0 I Saw Matt Berth Ajax Article The Dynamic Loading Image Over The GridView But That Not Working. Plz Help Me With That. And I Have 1 More Question I Have Set The  I Have The Set The Page Orientation Of Report Document To LandScape in Code Behind Of My Asp.net Page But When At The Time Of Print I Want That The Report Should Print in Portrait Mode So Give Me Something That I Can Get Help. Show Me Some Sample Code ...

How do I change in runtime the data source of a report created using microsoft reporting technology in Visual Studio 2005?
How do I change in runtime the data source of a report created using microsoft reporting technology in Visual Studio 2005? Hi, From your description, it seems that you want to switch the datasource programmatically during the run-time, right? If so, I think you should use the LinkedServer in sql statements which is a widely used method for parametric data source needs in reporting services applications. For more information, see: http://www.simple-talk.com/community/forums/post/2735.aspx  Thanks.This response contains a reference to a third party World Wide Web site. Microsoft is...

changing print specification at runtime
Hi all, I have a printer that can print on A3 or A4 but allways defined as A4 - Portrait in windows. I need pb to be able to print to this printer a wide report, on the A3 paper, automatically, without involvment of the user. If this not possiable, I can allso use a way to find out what are the current print specifications of the default printer. Thanks, Adva. Assuming you are printing a datawindow and not using the PrintDatawindow() function (which overrides the dw settings and uses the current printer settings) you only need to set the Paper.Size property of the...

Print Report to Text File
Product: Infomaker 5.0 on WIN NT 4.0 I created a report joining two large tables and computed fields. I use SQL Select/Tabular format to create the reports. This is a very large report. I would like to ditribute this report as ASCI text file. Only option available to save this file as *.PRN. When I use the option save Row as file text I lose all the computed fields. I want users to further analyse this report. How can I save this file as Text file with computed fields. Thank you for your assistance in this matter. Raj.G. rajg@shaw.wave.ca Saveas HTML and then in your ...

Font changes when printing reports
Has anyone experienced having a report font change, page-to-page? In other words, a report is printing at the expected font and pitch, then just after a form-feed, the font or pitch or both will change for the remainder of the report. This also happens to some of our customers, report-to-report. They will select to print a report; the first report prints as expected. Then the same report is selected, this time maybe for a different date range, and the report will print very condensed. Any ideas / suggestions? Thank you, Doug ...

Changing Rich Text during printing
I would like to Rich Text Control to print dunning letters. Problem is that different letter text will be used depending on conditions. Is it possible to change rich text with paste in the printpage event and still have datafields inserted? Has anyone done something like this? Try using a computed field in the detail area of the RT (I assume your using RTE presentation style of a datawindow; if not you should). The Computed field can look at the data of the row and determine what should be *printed* as text in the field. Also you can define a global function which takes argume...

Change HTML text on runtime
A good day to all, I am unable to find out , how i can change/set the following text on runtime , any idea will be greatly appreciated <h3 style="text-align: center">PVAD - Search & Add</h3> to <h3 style="text-align: center">PVAD - Complete Submission</h3>   Thanks ramzansadiq: how i can change/set the following text on runtime By adding runtt="server" attribute to it. chcek this code.. <h3 style="text-align: center" runat ="server" id ="headertxt" >PVAD - Search & Add...

Changing a reports datasource at runtime
I thought I'd post this after wasting many hours of time with Crystal .NET v10. I found a number of samples on CR's website that showed how to change datasource/user/pwd at runtime but none worked. The reports would always open the datasource they were originally designed against. Call CrLogon() , the line of code that fixed everything and that was left out in all samples is tbl.Location = tbl.Location in the AppllyLogon procedure. This line makes no sense and shows poor programming practices. Obviousily the set property does some work that should be done elswhere. This is based ...

Reportviewer- Change report in runtime
Hello How can i change a report in runtime? Thank you  Mario Lopes Hi, For changing the report at runtime you will have to change the ReportDefintion for reportviewer control. ReportViewer1.LocalReport.LoadReportDefinition(Stream); But there is a catch in it. If you want to display different ReportDefinition on postback you will have to load the instance of the reportviewer again and assign the new report definition to it. Hope this helps you.ShreePlease mark post as answer if its helpful. Hi,try the below one...ReportDocument rptDoc = new ReportDocument(); rptDoc.Load("ReportPath");Viewer_Report.ReportSource = rptDoc; rptDoc.Clone(); VasanthakumarSoftware Engineer. Hi vasanth I got some errors when i translate your code to vb.net Dim rptDoc As New reportdocument()->not defined rptDoc.Load("ReportPath") ReportViewer1.reportsource = rptDoc -> reportsource not a member of Microsoft... rptDoc.Clone()  Mario Lopes Hi,you need to use the below namespace.... imports CrystalDecisions.CrystalReports.EngineDim rptDoc As New reportdocument() rptDoc.Load("ReportPath") ReportViewer1.reportsource = rptDoc rptDoc.Clone()  VasanthakumarSoftware Engineer. Sorry my friend i didn't told you but i use reportviewer, not CrystalReports. I think with reportViewer i can't change the report at runtime. Is that right? Thank youMario Lopes No,  you can change the report definition...

changing report title at runtime
Is there a way to name a report programatically, instead of having to do it at design time using 'Report Title'. How about charts titles - can they be named programatically? check this Post. It will show one way on how to change the report's title programmaticaly. psiThanks, Peter Iuvara, MCP...

superreview granted: [Bug 340564] Print/Print Preview does not print text in <input text> or <textarea> : [Attachment 243735] Patch
Robert O'Callahan (Novell) <roc@ocallahan.org> has granted superreview: Bug 340564: Print/Print Preview does not print text in <input text> or <textarea> https://bugzilla.mozilla.org/show_bug.cgi?id=340564 Attachment 243735: Patch https://bugzilla.mozilla.org/attachment.cgi?id=243735&action=edit ------- Additional Comments from Robert O'Callahan (Novell) <roc@ocallahan.org> thanks! the new textframe kills all this horrible code. ...

First Time Report Viewer Question
I will post the code from my aspx page. I have two dropdownlists. When customer name changes it displays the list of Mixing Records for that customer. When I pick a new Mixing Record for that customer, the ReportViewer doesn't change. I thought I would go into ddlMixingRecord_SelectedIndexChanged and be able to say something like ReportViewer1.Bind().....but I don't see any reference to ReportViewer1. Can some give me a quick idea on how to change (refresh) the ReportViewer to match the dropdownlists. <body> <form id="form1" runat="server"> <div ...

changing text box properties at runtime
I have a webpage with several text boxes.I want to change the looks of the textboxes based on certain events.The events happen to be hitting markers of a media file.I would like to change the background color and/or font size of certain text boxes when corresponding markers are hit.I figured out how the size of the text boxes, but that isn't what I want to do.<SCRIPT language = "JScript" for = Player1 event = markerHit(mymark)>   if(mymark==1) Text.size = 5;   if(mymark==2) Text.size = 10;   if(mymark==3) Text.size = 20;</SCRIPT>I don&#...

CR9 Report Params change at runtime
Using webapp, asp.net w/VB codebehind, winXpPro, CR9Pro. I have been using CR9 in vs.net to display reports on a web application. when I select a report, and enter some parameters for a report with range parameters, it works fine. When I refresh the report, all of a sudden the parameters are turned into discreet. By this i mean that if I put a watch on the reports parameter type, the first time it is a range, which is correct. The refresh will then show that the parameters are discreet. I know this sounds odd, but if anyone has any suggestions, I would really appreciate it. Thanks alo...

Change size of text box at runtime
Hi All, i am working with textbox control. i am inserting text in text box at run time. i do not want scroll bar in my text box. i want to know how to increase size of textbox at runtime according to the text inserted. Thanks & RegardsNeeraj hi give the textbox width in in percentage (100%), but if the textbox contains more data, the page will have the scrollbar, it is advisable to use textarea when the large data is there.Please Mark as Answer if it helps you...

How to change txt2.text when the txt1's.text changes using JavaScript?
Hello! I want some JavaScript (or any other client-side) solution for my problem thatdescribed here:  http://forums.asp.net/p/1382766/2930267.aspx In a few words, my problem is that i don't know the way to change the txt2.text valuewhen the txt1.text value changes... Please read the http://forums.asp.net/p/1382766/2930267.aspx first...I want only JavaScript solution... Thank you very much! Like this? <input type="text" id="TextBox1" name="TextBox1" onchange="textBox1OnChange(this);" runat="server" /><input type...

Print a text only on the first page of the report
Hi,I want to print a label only on the first page of the report? How do I do this? I was trying to build a formula on the report but no luck.Thank you,Rushdi    Format the text field and conditionally suppress the text with the following:PageNumber > 1MrBill  rushdib: Hi,I want to print a label only on the first page of the report? How do I do this? I was trying to build a formula on the report but no luck.Thank you,Rushdi   ...

How to print text only on the last page of the report
I have some info of company which should be printed on the last page of the report but not at the end of every page.  When i used PageFooter it prints on every page bottom.  But i only need to print it on the last page.  That should also be  in  a new page after the end of the data.  This is in RDLC.  Any inputs would be greatly appreciated. Thanks,Suman Hi, I think what you can use IIF function with the PageNumber operators in your Page footer. If the current page number equals the total pages, show your contents, otherwise, hide it. Thanks.Mi...

Changing database at runtime for Crystal Report
How to change database, server name at runtime for crystal report designed for asp.net application. I am using multiple databases of same table structures. I want to change X database to Y database at runtime through vb.net coding. Sql Server 2000 is used as data server. Please suggest a way to change database, servername, userid and password at runtime You can use this code to log on to the different databases Private Sub LogOn(ByVal poReport As CrystalDecisions.CrystalReports.Engine.ReportDocument, ByVal strServer as string, ByVal strTable as string, ByVal strUsername as string, By...

report format changes when previewed or printed
We have recently migrated our PB 4 app to PB 6.5, and the following is occuring: If I look at my report data window as preview, it looks fine. But if I run the report in the app, and preview it or print it, then it garbles the formatting. Cuts off the right section of the report eventhough margins are acceptable, makes lines bold, and increases thickness. Other reports are working fine... What is causing these discrepencies, and how to fix? -- Thanks, Stephane Viau Ottawa, Canada "When I run the report in the app"... Do you mean compiled, and then run on...

Printing formatted text in composite report
In PB 6.5, I have a composite report on which one text field (originally entered using the PB RTE control) that needs to contain tab stops. All I can come up with are vertical bars (leaving the text as ASCII) or boxes (converting to ~t). How can I print the tabs as tabs? Thanks Robin ...

Web resources about - Change printed Text at runtime - Fastreport - embarcadero.delphi.reporting

Free software downloads - Windows downloads - Mac downloads - Linux downloads - Drivers - Games and iPhone ...
Free software download : Download Windows, Macintosh software, Linux software, Drivers, Games and iPhone apps from Soft-Files.com

Windows Vista Google Alerts for 06 April 2008
Keeping an eye on Windows, other things tech and home of the Observed Tech PODCAST.

Member-to-Member Offers
Firebird SQL: The true open-source relational database

Resources last updated: 3/7/2016 10:44:25 PM