?
Solved

rave , page margins -code based report

Posted on 2011-03-22
11
Medium Priority
?
1,300 Views
Last Modified: 2012-05-11
can I set with rave the page margins ?  


(eg. the foot is cutrrently set to close to the paper boarder)
0
Comment
Question by:BdLm
[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
11 Comments
 
LVL 24

Expert Comment

by:jimyX
ID: 35188498
You control the margins by using SectionTop, SectionLeft, SectionRight & SectionBottom.
So you can try and put PrintFooter() under this line:

SectionBottom := 10;
0
 
LVL 8

Author Comment

by:BdLm
ID: 35188551
unit is pixel ?
0
 
LVL 8

Author Comment

by:BdLm
ID: 35188694

i play around ...  but the command does not seem to be effective ....
///
///   support :  http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_26902682.html?cid=239#a35188192
///

procedure TMainForm.LibRvSystemPrintFooter(Sender: TObject);
begin



   With Sender as TBaseReport do
    begin
      //...
      PrintFooter('Page : '+ IntToStr(CurrentPage), pjCenter); // or pjLeft/pjRight

      //...
    end
end;



function TMainForm.LibRvSystemPrintPage(Sender: TObject;
  var PageNum: Integer): Boolean;
begin
   With Sender as TBaseReport do
    begin
      //...

      SectionTop := 30 ;
      SectionLeft:= 30;
      SectionRight   := 30;
      SectionBottom  := 30;


      //...
    end
end;

Open in new window

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!

 
LVL 19

Assisted Solution

by:Thommy
Thommy earned 124 total points
ID: 35188805
You can set the margins as follows:

with BaseReport do begin
  Margin Left := 0.5;
  Margin Right := 0.5;
  Margin Top := 0.5;
  Margin Bottom := 0.5;
  Orientation := poPortrait;
end;

0
 
LVL 24

Assisted Solution

by:jimyX
jimyX earned 376 total points
ID: 35188833
The measures are inches. Set the ruler to inches then when you set SectionBottom to 10 then the bottom of the page will be at 10 on that ruler. So it did not work out for you because 30 is out of the page's border. The maximum you can set is 11.

Try this way:
function TMainForm.LibRvSystemPrintPage(Sender: TObject;
  var PageNum: Integer): Boolean;
begin
   With Sender as TBaseReport do
    begin
      SectionTop := 1.5;
      SectionBottom := 10;
      PrintFooter('Page : '+ IntToStr(CurrentPage), pjLeft);
    end
end;

Open in new window

0
 
LVL 8

Author Comment

by:BdLm
ID: 35192698

is there a drawing showing the difference between margin and sectionTop, sectionBottom ....

0
 
LVL 8

Author Comment

by:BdLm
ID: 35192893
problem solving progress :

---------------------------------
///
///   support :  http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_26902682.html?cid=239#a35188192
///   procedure :  Pass

procedure TMainForm.LibRvSystemPrintFooter(Sender: TObject);
begin

   With Sender as TBaseReport do
    begin

      PrintFooter('Page : '+ IntToStr(CurrentPage), pjCenter); // or pjLeft/pjRight

    end
end;

///
///  support  http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_26902799.html
///
///  margin setting, orientation and Section do not seem to be functional !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
///  procedure : fail

function TMainForm.LibRvSystemPrintPage(Sender: TObject;
  var PageNum: Integer): Boolean;
begin
   With Sender as TBaseReport do
    begin
      //...

      SectionTop := 2 ;
      SectionLeft:= 2;
      SectionRight   := 2;
      SectionBottom  := 2;

      MarginLeft := 0.5;
      MarginRight := 0.5;
      MarginTop := 0.5;
      MarginBottom := 0.5;

      Orientation := poLandscape;

      //...
    end
end;
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 35195346

You can find your margins from RpDev.Waste property
Left := RpDev.Waste.Left / RpDev.XDPI;
    Top := RpDev.Waste.Top / RpDev.YDPI;
    Right := RpDev.Waste.Right / RpDev.XDPI;
    Bottom := RpDev.Waste.Bottom / RpDev.YDPI;

Open in new window

0
 
LVL 24

Assisted Solution

by:jimyX
jimyX earned 376 total points
ID: 35196234
Please could you use the event OnPrint:
function TMainForm.LibRvSystemPrint(Sender: TObject;
  var PageNum: Integer): Boolean;
begin
   With Sender as TBaseReport do
    begin
      SectionTop := 2 ;
      SectionBottom  := 10.5;
      PrintFooter('Page : '+ IntToStr(CurrentPage), pjCenter);
    end
end;

Open in new window


Orientation will not work in the Print events. If you want to change the orientation, set it either at the object inspector or using the TRvSystem property (RvSystem.SystemPrinter.Orientation) but the most important thing is to set it before executing the report:
procedure TForm1.Button1Click(Sender: TObject);
begin
  RvSystem1.SystemPrinter.Orientation := poLandScape;
  RvSystem1.Execute;
end;

Open in new window

0
 
LVL 8

Author Comment

by:BdLm
ID: 35238779
is there a way to change all units from inches to mm ?
0
 
LVL 24

Accepted Solution

by:
jimyX earned 376 total points
ID: 35238809
Click on the RvSystem and from the object inspector go to SystemPrinter and set the property Units to unMM.

By code:
RvSystem1.SystemPrinter.Units := unMM;
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

800 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