Lost of the ResetGroup and ResetComponent properties when changing paper format
Hi,
we need to change 100 reports from "Letter" paper format to "A4" paper
format. Our code is as the following:
For X := 1 To 100 Do
Begin
FMain.ppReport.Template.DatabaseSettings.Name :=
'Report'+IntToStr(X);
FMain.ppReport.Template.LoadFromDatabase;
FMain.ppReport.PrinterSetup.MarginLeft := 0;
FMain.ppReport.PrinterSetup.MarginRight := 0;
// Patch here because the Paper format is not set the first time ???
For Y := 1 To 5 Do
Begin
FMain.ppReport.PrinterSetup.PaperName := pFormat; // pFormat was
initialized to A4 paper format
If FMain.ppReport.PrinterSetup.PaperName = pFormat Then Break;
End;
FMain.ppReport.PrinterSetup.MarginLeft := pMargin; // .025
FMain.ppReport.PrinterSetup.MarginRight := pMargin; // .025
FMain.ppReport.PrinterSetup.MarginBottom := 0.5;
FMain.ppReport.PrinterSetup.MarginTop := 0.5;
FMain.ppReport.Template.SaveToDatabase;
End;
1- The first problem:
We don't know why, we need to assign many times the "PaperName" property
since the changes are not kept if we do that only once ??? Any ideas ?
2- The second problem:
After doing it, all "ResetGroup" for TppDBCalc fields and all
"ResetComponent" for TppVariable are lost resulting in wrong calculation
into these reports. Something very strange is if we run this procedure
again, some reports becore correct. Also, if we do this procedure back, by
reseting the paper format from A4 to Letter, all "ResetGroup" and
"ResetComponent" properties become correct. Very strange problems.
Somebody can help me about this proglems ? Is it the correct way to do it ?
Thanks for any comments.
--
G. Plante
gplante@orologic.com
we need to change 100 reports from "Letter" paper format to "A4" paper
format. Our code is as the following:
For X := 1 To 100 Do
Begin
FMain.ppReport.Template.DatabaseSettings.Name :=
'Report'+IntToStr(X);
FMain.ppReport.Template.LoadFromDatabase;
FMain.ppReport.PrinterSetup.MarginLeft := 0;
FMain.ppReport.PrinterSetup.MarginRight := 0;
// Patch here because the Paper format is not set the first time ???
For Y := 1 To 5 Do
Begin
FMain.ppReport.PrinterSetup.PaperName := pFormat; // pFormat was
initialized to A4 paper format
If FMain.ppReport.PrinterSetup.PaperName = pFormat Then Break;
End;
FMain.ppReport.PrinterSetup.MarginLeft := pMargin; // .025
FMain.ppReport.PrinterSetup.MarginRight := pMargin; // .025
FMain.ppReport.PrinterSetup.MarginBottom := 0.5;
FMain.ppReport.PrinterSetup.MarginTop := 0.5;
FMain.ppReport.Template.SaveToDatabase;
End;
1- The first problem:
We don't know why, we need to assign many times the "PaperName" property
since the changes are not kept if we do that only once ??? Any ideas ?
2- The second problem:
After doing it, all "ResetGroup" for TppDBCalc fields and all
"ResetComponent" for TppVariable are lost resulting in wrong calculation
into these reports. Something very strange is if we run this procedure
again, some reports becore correct. Also, if we do this procedure back, by
reseting the paper format from A4 to Letter, all "ResetGroup" and
"ResetComponent" properties become correct. Very strange problems.
Somebody can help me about this proglems ? Is it the correct way to do it ?
Thanks for any comments.
--
G. Plante
gplante@orologic.com
This discussion has been closed.
Comments
the problem you described. The papername property successfully changed the
first time. Which printer driver are you using and in what environment
(Win98/Win2000)? Are you using RB6.03? If not, please upgrade to 6.03 as it
incorporates numerous bug fixes. Hopefully that should address you second
problem as well. If not please send a sample project that shows the problem
to support@digital-metaphors.com.
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
I sent a sample project to support@digital-metaphors.com as requested.
Thanks!
--
G. Plante
gplante@orologic.com
"Alexander Kramnik (Digital Metaphors)" wrote
in message news:3cc5a58b$1@dm500....
reproduce
it
problem