Divide by 0 when sending report to PDF
Posted: Wed Dec 09, 2020 8:30 am
Hi
I have raised this issue with digital-metaphors and they asked me to raise it here as they require a metafile that is produced by the TRichView RTF control (we use the DB version). We use v18.0.1 of TRichView.
Is it possible for you to generate the metafile and send it to DM?
This is the rtf
{\rtf1\sstecf27000\ansi\deflang2057\ftnbj\uc1\deff0
{\fonttbl{\f0 \fswiss Arial;}{\f1 \fswiss \fcharset0 Arial;}{\f2 \fswiss \fcharset0 Calibri;}}
{\colortbl ;\red255\green255\blue255 ;\red0\green0\blue0 ;}
{\stylesheet{\f0\fs24 Normal;}{\cs1 Default Paragraph Font;}}
\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\headery720\footery720\nogrowautofit\deftab720\formshade\nofeaturethrottle1\useltbaln1\dntblnsbdb\fet4\aendnotes\aftnnrlc\pgbrdrhead\pgbrdrfoot
\sectd\pgwsxn12240\pghsxn15840\guttersxn0\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\headery720\footery720\sbkpage\pgncont\pgndec
\plain\plain\f0\fs24
\trowd\trgaph108\lastrow\trftsWidth1\trautofit1\trpaddl108\trpaddfl3\trpaddr108\trpaddfr3\trpaddt0\trpaddft3\trpaddb0\trpaddfb3\trleft-108\tblindtype3\tblind0\trrh1408\trkeep\trbrdrt\brdrs\brdrw10\trbrdrb\brdrs\brdrw10\trbrdrl\brdrs\brdrw10\trbrdrr\brdrs\brdrw10\ltrrow
\clvertalt\clbrdrt\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clpadt108\clpadft3\clpadr108\clpadfr3\cellx2897
\clvertalt\clbrdrt\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clpadt108\clpadft3\clpadr108\clpadfr3\cltxbtlr\cellx5902
\pard\intbl\ssparaaux0\s0\ltrpar\qc\widctlpar
\prauth1\prdate1200374285{\*\oldpprops\pard\ql}\plain\f2\fs22\lang2057\hich\f2\dbch\f2\loch\f2\fs22\ltrch
Horizontal\cell
\pard\intbl\ssparaaux0\s0\li113\ri113\ltrpar\qc\widctlpar\plain\f0\fs24\plain\f2\fs22\lang2057\hich\f2\dbch\f2\loch\f2\fs22\ltrch
Vertical\cell
\intbl\row
\pard\ssparaaux0\s0\ql\plain\f0\fs24\par
}
This is the original post I made on the DM support forum
Getting a divide by zero error when sending a report to PDF. The report is fine when run to the report builder viewer but when a print to a PDF file is attempted I get a divide by zero is the following place
ppPDFCanvas
procedure TppPDFCanvas.SelectWorldTransform(aScaleX, aScaley, aOrgX, aOrgY: Double);
if FTransformModified then
begin
SelectScaling((FInitialTransform.ScaleX / FModifiedTransform.ScaleX), (FInitialTransform.ScaleY / FModifiedTransform.ScaleY));
RestorePageHeight;
SavePageHeight(FInitialTransform.PageHeight);
SelectCoordintateSpace((FInitialTransform.OrgX - FModifiedTransform.OrgX), (FInitialTransform.OrgY - FModifiedTransform.OrgY), PageHeight);
//FPageHeightPos := FInitialTransform.PageHeightPos;
end;
The values I have are
FModifiedTransform.ScaleX = 0
FModifiedTransform.ScaleY = 0
The report output is a simple table (from word) with 14 columns and 3 rows (including header row). The distinguishing part of this table is that the headings are all vertical text. It all seems to work with a table and horizontal text.
Delphi RIO 10.3
RB 19.03
Regards
Andrew
Civica H&SC
I have raised this issue with digital-metaphors and they asked me to raise it here as they require a metafile that is produced by the TRichView RTF control (we use the DB version). We use v18.0.1 of TRichView.
Is it possible for you to generate the metafile and send it to DM?
This is the rtf
{\rtf1\sstecf27000\ansi\deflang2057\ftnbj\uc1\deff0
{\fonttbl{\f0 \fswiss Arial;}{\f1 \fswiss \fcharset0 Arial;}{\f2 \fswiss \fcharset0 Calibri;}}
{\colortbl ;\red255\green255\blue255 ;\red0\green0\blue0 ;}
{\stylesheet{\f0\fs24 Normal;}{\cs1 Default Paragraph Font;}}
\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\headery720\footery720\nogrowautofit\deftab720\formshade\nofeaturethrottle1\useltbaln1\dntblnsbdb\fet4\aendnotes\aftnnrlc\pgbrdrhead\pgbrdrfoot
\sectd\pgwsxn12240\pghsxn15840\guttersxn0\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\headery720\footery720\sbkpage\pgncont\pgndec
\plain\plain\f0\fs24
\trowd\trgaph108\lastrow\trftsWidth1\trautofit1\trpaddl108\trpaddfl3\trpaddr108\trpaddfr3\trpaddt0\trpaddft3\trpaddb0\trpaddfb3\trleft-108\tblindtype3\tblind0\trrh1408\trkeep\trbrdrt\brdrs\brdrw10\trbrdrb\brdrs\brdrw10\trbrdrl\brdrs\brdrw10\trbrdrr\brdrs\brdrw10\ltrrow
\clvertalt\clbrdrt\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clpadt108\clpadft3\clpadr108\clpadfr3\cellx2897
\clvertalt\clbrdrt\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clpadt108\clpadft3\clpadr108\clpadfr3\cltxbtlr\cellx5902
\pard\intbl\ssparaaux0\s0\ltrpar\qc\widctlpar
\prauth1\prdate1200374285{\*\oldpprops\pard\ql}\plain\f2\fs22\lang2057\hich\f2\dbch\f2\loch\f2\fs22\ltrch
Horizontal\cell
\pard\intbl\ssparaaux0\s0\li113\ri113\ltrpar\qc\widctlpar\plain\f0\fs24\plain\f2\fs22\lang2057\hich\f2\dbch\f2\loch\f2\fs22\ltrch
Vertical\cell
\intbl\row
\pard\ssparaaux0\s0\ql\plain\f0\fs24\par
}
This is the original post I made on the DM support forum
Getting a divide by zero error when sending a report to PDF. The report is fine when run to the report builder viewer but when a print to a PDF file is attempted I get a divide by zero is the following place
ppPDFCanvas
procedure TppPDFCanvas.SelectWorldTransform(aScaleX, aScaley, aOrgX, aOrgY: Double);
if FTransformModified then
begin
SelectScaling((FInitialTransform.ScaleX / FModifiedTransform.ScaleX), (FInitialTransform.ScaleY / FModifiedTransform.ScaleY));
RestorePageHeight;
SavePageHeight(FInitialTransform.PageHeight);
SelectCoordintateSpace((FInitialTransform.OrgX - FModifiedTransform.OrgX), (FInitialTransform.OrgY - FModifiedTransform.OrgY), PageHeight);
//FPageHeightPos := FInitialTransform.PageHeightPos;
end;
The values I have are
FModifiedTransform.ScaleX = 0
FModifiedTransform.ScaleY = 0
The report output is a simple table (from word) with 14 columns and 3 rows (including header row). The distinguishing part of this table is that the headings are all vertical text. It all seems to work with a table and horizontal text.
Delphi RIO 10.3
RB 19.03
Regards
Andrew
Civica H&SC