Solved

dfm 2 pas????

Posted on 1999-01-28
7
379 Views
Last Modified: 2010-04-06
I have a lot of quickreports(48). This will create a system resource shortage. I want to create my reports in runtime.
But I really don't want to write the code myself.
Can anyone send me a utility that can convert a form file and turn it in to a .pas-file that creates the report, runs it. And then free the memory. The person that sends me such a utility or tells me where to find it will get the points.

regards,
Dr. Gonzo
0
Comment
Question by:dr_gonzo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 1363644
Hi Dr. Gonzo,

I'm sorry, I don't know such a utility. How about this: You could right click on your form, view the form as text (I don't know the exact english menu item). Then you could copy this sources into your pas unit. Now you can rebuild the form in runtime. Of course it's still a lot of work. But I know no better way...   :-(

Regards, Madshi.
0
 

Author Comment

by:dr_gonzo
ID: 1363645
Yeah but I wouldn't like that.
48 reports. yeach hell no.
Someone must have had this kinds of
problem before. Do I have to make this
util myself?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1363646
Hi dr_gonzo,

maybe, this helps a little
ftp://ftp.is.co.za/programming/delphi/d30free/formread.zip

meikl

0
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!

 

Accepted Solution

by:
earthworm earned 460 total points
ID: 1363647
You don't need any thing,I think.
You can create these Forms only at runtime,like this:
(1)Set these forms to available forms but bot auto-create forms:select the menu "project"->"Options",now you will see a page named "forms" and two listbox in it. The  left one contain the auto-create forms and the right one   contain the available forms. NOW,select the forms you don't want to create and click the button ">>" ,so the application will NOT create them
(2)Use them at runtime:
e.g:
begin
{....}
  //create the form
  with AForm.Create do
  try
    //show it or use it as you want
    ShowModal;
  finally
    //now you can free it and take back the resource
    Free;
  end;
{....}
end;

0
 

Expert Comment

by:Laci030999
ID: 1363648
Dr. Gonzo,

Well this is not the utility you have asked for, but I use many reports too and this is an esy way to create them at runtime:


-> this could be a procedure to create and show/print reports

procedure ShowReport(Report: TQuickRep; FormClassType: TComponentClass);
begin
   Screen.Cursor:= crHourGlass;
   Application.CreateForm(FormClassType, Report);

   try
     Screen.Cursor:= crHourGlass;
     Report.PreviewModal; //or Print;
   finally
     Report.Free;
     Screen.Cursor:= crDefault;
   end;
end;

(QuickRpt needs to be added to the uses list of the unit of this procedure)


-> this is how to use it at the places where you would call "Report.Preview /.Print"

procedure TMainForm.ShowReport48_ButtonClick(Sender: TObject);
begin
  ShowReport(QuickReport48,TQuickReport48);
end;

(I like clean, simple code, but this far I couldn't find a way to get rid of the second parameter.)


So my suggestion is to change the code a bit, but using the clipboard and hot keys it shouldn't take long.

Regards,
Laci.


PS: Hope you have no trouble understanding my English. :-)
0
 

Expert Comment

by:Laci030999
ID: 1363649
I have just noticed that it's been quite a while when the last comment was added, maybe you have the solution by now.  ;-)

Laci
0
 

Expert Comment

by:Laci030999
ID: 1363650
Ooops, looks like I copied the wrong version of the example to the my comment!

-> this is the correct procedure

procedure ShowReport(Report: TQuickRep; FormClassType: TComponentClass);
begin
         try
           Screen.Cursor:= crHourGlass;
           Application.CreateForm(FormClassType, Report);
           Report.PreviewModal; //or Print;
         finally
           Report.Free;
           Screen.Cursor:= crDefault;
         end;
end;

Regards,
Laci.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi 2 77
Error E2158 compiling with Delphi XE10 Seattle 2 125
tvirtualstringtree freeze when load too manny images 10 80
PHP preg_replace code convert to Delphi 14 80
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question