Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

dfm 2 pas????

Posted on 1999-01-28
7
Medium Priority
?
383 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Accepted Solution

by:
earthworm earned 920 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

715 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