RB15 - Problems when paperbin "default" is selected
Hello,
We recently had some problems with reports that had no paper bin
selected (or it was det to "Default").
The situation in RB14 was: The report defined a specific paper format
(e.g. "A5") and the bin was not selected. When printing the report the
printer automatically selected the "A5" paper bin and everything was OK.
In RB15 with the same settings the printer startet to behave quite
strange. When printing the printer suddenly asked for "A5" pager and it
had to be confirmed by pressing a button on the printer. In other cases
the printer printed on the wrong paper (seemed a litte bit random)
A quick research in the sources showd the following difference between
RB14 and RB15 when it come it initialization of the paper bin:
RB14:
if (liIndex >= 0) and (liIndex < lCapabilities.Bins.Count) then
begin
if BinName = cDefault then
liBin := FDefaultBin
else
liBin := StrToInt(lCapabilities.Bins[liIndex]);
FPDevMode^.dmDefaultSource := liBin;
FPDevMode^.dmFields := FPDevMode^.dmFields or DM_DEFAULTSOURCE;
end;
RB15:
if (FBinName <> cDefault) then // <= that if causes problems!
begin
liIndex := lCapabilities.BinNames.IndexOf(BinName);
if (liIndex >= 0) and (liIndex < lCapabilities.Bins.Count) then
begin
FPDevMode^.dmDefaultSource := StrToInt(lCapabilities.Bins[liIndex]);
FPDevMode^.dmFields := FPDevMode^.dmFields or
DM_DEFAULTSOURCE;
end;
end;
In RB14 the default bin is always initialized the a Value of "7".
Because of the "(FBinName <> cDefault)" in RB15 the default paper bin
never gets initialized to any value in the DevMode structure when the
entry "Default" is selected by the user! It looks like this that causes
some serious problems with some printers (in our tests we also had
printers that worked fine in taht situation, maybe it is a printer
driver issue).
As a workaround we currently re-initialize the DevMode-structure when we
detect that "Default" was selected as paper bin (reading it from the
printer, modifiying it in the same way as in RB14 and write it back to
the printer).
Would you cosider to remove that if-clause in upcoming updates or new
versions?
Thanks in advance,
Ralf
We recently had some problems with reports that had no paper bin
selected (or it was det to "Default").
The situation in RB14 was: The report defined a specific paper format
(e.g. "A5") and the bin was not selected. When printing the report the
printer automatically selected the "A5" paper bin and everything was OK.
In RB15 with the same settings the printer startet to behave quite
strange. When printing the printer suddenly asked for "A5" pager and it
had to be confirmed by pressing a button on the printer. In other cases
the printer printed on the wrong paper (seemed a litte bit random)
A quick research in the sources showd the following difference between
RB14 and RB15 when it come it initialization of the paper bin:
RB14:
if (liIndex >= 0) and (liIndex < lCapabilities.Bins.Count) then
begin
if BinName = cDefault then
liBin := FDefaultBin
else
liBin := StrToInt(lCapabilities.Bins[liIndex]);
FPDevMode^.dmDefaultSource := liBin;
FPDevMode^.dmFields := FPDevMode^.dmFields or DM_DEFAULTSOURCE;
end;
RB15:
if (FBinName <> cDefault) then // <= that if causes problems!
begin
liIndex := lCapabilities.BinNames.IndexOf(BinName);
if (liIndex >= 0) and (liIndex < lCapabilities.Bins.Count) then
begin
FPDevMode^.dmDefaultSource := StrToInt(lCapabilities.Bins[liIndex]);
FPDevMode^.dmFields := FPDevMode^.dmFields or
DM_DEFAULTSOURCE;
end;
end;
In RB14 the default bin is always initialized the a Value of "7".
Because of the "(FBinName <> cDefault)" in RB15 the default paper bin
never gets initialized to any value in the DevMode structure when the
entry "Default" is selected by the user! It looks like this that causes
some serious problems with some printers (in our tests we also had
printers that worked fine in taht situation, maybe it is a printer
driver issue).
As a workaround we currently re-initialize the DevMode-structure when we
detect that "Default" was selected as paper bin (reading it from the
printer, modifiying it in the same way as in RB14 and write it back to
the printer).
Would you cosider to remove that if-clause in upcoming updates or new
versions?
Thanks in advance,
Ralf
This discussion has been closed.
Comments
Give RB 15.02 a try and post a follow up here. (RB 15.02 contains some mods,
though not the specific mod you requested. )
According to the Windows docs, dmFields indicates whether the specified
member is initialized. But perhaps some printer drivers are not adhering to
the Windows spec.
http://msdn.microsoft.com/en-us/library/windows/desktop/dd183565(v=vs.85).aspx
Best regards,
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com