#1 2014-02-20 14:21:45

shragam
Member
Registered: 2013-07-01
Posts: 24

Vertical lines are missing randomaly in QReport + QRShape

Hi
I have a simple report with a band, two fields and QRShape with style= qrsVertLine to separate them.
In the preview the vertical line shown ok, but in the pdf the line show in some rows and
disappear in some others.
If I add one more QRShape with style= qrsVertLine, then the first line show in all rows but the second disappear in some other 
I'm using the last version: "mORMot_and_Open_Source_friends_2014-02-19_192831_0ba8e6c238"

Here is the one line image:
d53b6ca65663a6b0cc6434442ecaed6e.jpg
Here is the two lines image:
af6b8ad78f0e3d43aa73103eccbaea2c.jpg
Here is the QReport Preview for two lines:
645eb22436664879824e863b68ec5f4f.jpg

Any Help
Shraga

Last edited by shragam (2014-02-20 14:31:19)

Offline

#2 2014-02-20 15:10:23

shragam
Member
Registered: 2013-07-01
Posts: 24

Re: Vertical lines are missing randomaly in QReport + QRShape

Update
The same situation also with horizental lines .

Offline

#3 2014-02-20 15:50:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,603
Website

Re: Vertical lines are missing randomaly in QReport + QRShape

And what if you zoom in Acrobat Reader?

Offline

#4 2014-02-20 17:04:52

shragam
Member
Registered: 2013-07-01
Posts: 24

Re: Vertical lines are missing randomaly in QReport + QRShape

No change. There is no lines :-(

Offline

#5 2014-03-06 16:33:31

shragam
Member
Registered: 2013-07-01
Posts: 24

Re: Vertical lines are missing randomaly in QReport + QRShape

Hi
Any News/Updates for my problem ?

Offline

#6 2014-03-06 17:15:55

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

Re: Vertical lines are missing randomaly in QReport + QRShape

The full version of Acrobat has a preflight feature which might find the problem.

Offline

#7 2014-06-27 17:29:25

shragam
Member
Registered: 2013-07-01
Posts: 24

Re: Vertical lines are missing randomaly in QReport + QRShape

Hi
Any Updates/News for my problem ?
Can some one  fix this problem  ?

Offline

#8 2014-06-27 17:52:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,603
Website

Re: Vertical lines are missing randomaly in QReport + QRShape

I do not use QReport with SynPDF, since we rely here on our mORMotReport.pas unit for this.
And there are not problem with lines, either vertical or horizontal.

My guess is that QReport do create some meta file content which is not well understood by the SynPDF metafile renderer.
Perhaps you may search in this direction.
Try to use a tool like EmfExplorer to guess what is wrong here.
http://frazmitic.free.fr/emfexplorer/

Offline

#9 2014-07-02 18:00:51

shragam
Member
Registered: 2013-07-01
Posts: 24

Re: Vertical lines are missing randomaly in QReport + QRShape

ab wrote:

I do not use QReport with SynPDF, since we rely here on our mORMotReport.pas unit for this.
And there are not problem with lines, either vertical or horizontal.

My guess is that QReport do create some meta file content which is not well understood by the SynPDF metafile renderer.
Perhaps you may search in this direction.
Try to use a tool like EmfExplorer to guess what is wrong here.
http://frazmitic.free.fr/emfexplorer/

I will try to save this report to emf and open the file with this program

Offline

#10 2014-07-31 14:22:51

shragam
Member
Registered: 2013-07-01
Posts: 24

Re: Vertical lines are missing randomaly in QReport + QRShape

shragam wrote:
ab wrote:

I do not use QReport with SynPDF, since we rely here on our mORMotReport.pas unit for this.
And there are not problem with lines, either vertical or horizontal.

My guess is that QReport do create some meta file content which is not well understood by the SynPDF metafile renderer.
Perhaps you may search in this direction.
Try to use a tool like EmfExplorer to guess what is wrong here.
http://frazmitic.free.fr/emfexplorer/

I will try to save this report to emf and open the file with this program

Hi
I was checked the report in EMF format.

The lines are there, but not in SynPDF sad
If you want, i can send you the empf file and the pdf file.

Last edited by shragam (2014-07-31 14:23:09)

Offline

#11 2014-08-19 08:59:22

jonghyo kim
Member
Registered: 2014-03-10
Posts: 3

Re: Vertical lines are missing randomaly in QReport + QRShape

Hi,
draw line debugging E.Canvas.FNewPath = true X Y => 755.00 111.00 => line is missing in QrShape
draw line debugging E.Canvas.FNewPath = true X Y => 755.00 141.00 => line is missing in QrShape
draw line debugging E.Canvas.FNewPath = true X Y => 755.00 218.00 => line is missing in QrShape
draw line debugging E.Canvas.FNewPath = false not pen.null X Y => 755.00 64.00 => line is not missing

so,  I've just added for debugging a line as below and then lines were not missing.
   

  EMR_LINETO: begin
    E.NeedPen;
    if (not E.Canvas.FNewPath) and not Moved then
      E.Canvas.MoveToI(Position.X,Position.Y);
    E.Canvas.LineToI(PEMRLineTo(R)^.ptl.X,PEMRLineTo(R)^.ptl.Y);
    Position := PEMRLineTo(R)^.ptl;
    Moved := false;
    E.fInLined := true;
    if E.Canvas.FNewPath then E.Canvas.FNewPath := false; //<= I've just added this line for debugging.
    if not E.Canvas.FNewPath then
      if not pen.null then
        E.Canvas.Stroke

Last edited by jonghyo kim (2014-08-21 05:56:56)

Offline

#12 2014-08-19 14:51:10

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,603
Website

Re: Vertical lines are missing randomaly in QReport + QRShape

So E.Canvas.FNewPath will be always false?
Sounds weird.

How was the metafile created?

Offline

#13 2014-08-20 05:57:11

jonghyo kim
Member
Registered: 2014-03-10
Posts: 3

Re: Vertical lines are missing randomaly in QReport + QRShape

I don't know how to be created those kinds of files
I have a couple of quickreport files which horizental and vertical lines are missing .

when I viewed logs, all the lines which FNewPath is false were not missing
  and all lines which FNewPath is true were missing.

as below .bgp file contents Lines are missing

R0001: [001] EMR_HEADER	(s=108)	{{ Bounds(36,38,757,260), Frame(0,0,19850,28075), ver(0x10000), size(1540), recs(53), handles(5), pals(0), dev_pix(1280,1024), dev_mil(320,256), pixf_size(0), pixf_ofs(0), openGL(0) }}
R0002: [027] EMR_MOVETOEX	(s=16)	{ ptl(0,0)}
R0003: [039] EMR_CREATEBRUSHINDIRECT	(s=24)	{ihBrush(1), style(0=BS_SOLID, color:0x00FFFFFF)}
R0004: [037] EMR_SELECTOBJECT	(s=12)	{Table object: 1=OBJ_BRUSH.(BS_SOLID)}
R0005: [025] EMR_SETBKCOLOR	(s=12)	{0x00FFFFFF}
R0006: [018] EMR_SETBKMODE	(s=12)	{iMode(2=OPAQUE)}
R0007: [037] EMR_SELECTOBJECT	(s=12)	{Table object: 1=OBJ_BRUSH.(BS_SOLID)}
R0008: [076] EMR_BITBLT	(s=100)	{rclBounds(38,38,756,38), Dest[x:38, y:38, cx:719, cy:1)], dwRop(0x00F00021), Src[x:0, y:0, xform(eDx:0.000000, eDy:0.000000, eM11:1.000000, eM12:0.000000, eM21:0.000000, eM22:1.000000), BkColor:0x00000000, iUsage:0, offBmi:0, Bmi:0, offBits:0, Bits:0]}
R0009: [037] EMR_SELECTOBJECT	(s=12)	{Table object: 1=OBJ_BRUSH.(BS_SOLID)}
R0010: [037] EMR_SELECTOBJECT	(s=12)	{Stock object: 5=OBJ_BRUSH.(BS_NULL)}
R0011: [027] EMR_MOVETOEX	(s=16)	{ ptl(38,111)}
R0012: [038] EMR_CREATEPEN	(s=28)	{ihPen(2), style(0=PS_SOLID | COSMETIC), width(2), color(0x00000000)}
R0013: [037] EMR_SELECTOBJECT	(s=12)	{Table object: 2=OBJ_PEN.(PS_SOLID | COSMETIC)}
R0014: [020] EMR_SETROP2	(s=12)	{iMode(1=R2_BLACK)}
R0015: [037] EMR_SELECTOBJECT	(s=12)	{Table object: 1=OBJ_BRUSH.(BS_SOLID)}
R0016: [025] EMR_SETBKCOLOR	(s=12)	{0x00FFFFFF}
R0017: [018] EMR_SETBKMODE	(s=12)	{iMode(2=OPAQUE)}
R0018: [054] EMR_LINETO	(s=16)	{ ptl(755,111)}
R0019: [027] EMR_MOVETOEX	(s=16)	{ ptl(38,141)}
R0020: [054] EMR_LINETO	(s=16)	{ ptl(755,141)}
R0021: [027] EMR_MOVETOEX	(s=16)	{ ptl(38,218)}
R0022: [054] EMR_LINETO	(s=16)	{ ptl(755,218)}
R0023: [027] EMR_MOVETOEX	(s=16)	{ ptl(167,178)}
R0024: [054] EMR_LINETO	(s=16)	{ ptl(753,178)}
R0025: [027] EMR_MOVETOEX	(s=16)	{ ptl(167,258)}
R0026: [054] EMR_LINETO	(s=16)	{ ptl(753,258)}
R0027: [082] EMR_EXTCREATEFONTINDIRECTW	(s=368)	{ihFont(3) ELF[name() style() vendor(0x00469603)] LOG[face(굴림체), style(), charset(129),family(0),precision(0), height(-13), width(0)]}
R0028: [037] EMR_SELECTOBJECT	(s=12)	{Table object: 3=OBJ_FONT}
R0029: [024] EMR_SETTEXTCOLOR	(s=12)	{0x00000000}
R0030: [037] EMR_SELECTOBJECT	(s=12)	{Stock object: 7=OBJ_PEN.(PS_SOLID | COSMETIC)}
R0031: [037] EMR_SELECTOBJECT	(s=12)	{Table object: 1=OBJ_BRUSH.(BS_SOLID)}
R0032: [076] EMR_BITBLT	(s=100)	{rclBounds(220,230,331,243), Dest[x:220, y:230, cx:112, cy:14)], dwRop(0x00F00021), Src[x:0, y:0, xform(eDx:0.000000, eDy:0.000000, eM11:1.000000, eM12:0.000000, eM21:0.000000, eM22:1.000000), BkColor:0x00000000, iUsage:0, offBmi:0, Bmi:0, offBits:0, Bits:0]}
R0033: [037] EMR_SELECTOBJECT	(s=12)	{Table object: 1=OBJ_BRUSH.(BS_SOLID)}
R0034: [038] EMR_CREATEPEN	(s=28)	{ihPen(4), style(0=PS_SOLID | COSMETIC), width(0), color(0x00000000)}
R0035: [037] EMR_SELECTOBJECT	(s=12)	{Table object: 4=OBJ_PEN.(PS_SOLID | COSMETIC)}
R0036: [020] EMR_SETROP2	(s=12)	{iMode(1=R2_BLACK)}
R0037: [018] EMR_SETBKMODE	(s=12)	{iMode(1=TRANSPARENT)}
R0038: [022] EMR_SETTEXTALIGN	(s=12)	{iMode(0= TA_LEFT TA_TOP)}
R0039: [084] EMR_EXTTEXTOUTW	(s=172)	{ TXT=[99999-99-9999999] [exScale(25.000000) eyScale(25.000000) iGraphicsMode(1), Bounds(220,230,331,242)] TxOPT[fOptions(0), nChars(16), offDx(108), ptlRef(220,230), rcl(0,0,-1,-1)] Spacing[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 => Total(112) =>xPtRefRight(331)]}
R0040: [075] EMR_EXTSELECTCLIPRGN	(s=16)	{iMode(5=RGN_COPY), RGNDATA[ptr:0x024a0550, size:0, box()]}
R0041: [037] EMR_SELECTOBJECT	(s=12)	{Stock object: 5=OBJ_BRUSH.(BS_NULL)}
R0042: [037] EMR_SELECTOBJECT	(s=12)	{Stock object: 7=OBJ_PEN.(PS_SOLID | COSMETIC)}
R0043: [040] EMR_DELETEOBJECT	(s=12)	{ihObject(4)}
R0044: [038] EMR_CREATEPEN	(s=28)	{ihPen(4), style(0=PS_SOLID | COSMETIC), width(1), color(0x00000000)}
R0045: [037] EMR_SELECTOBJECT	(s=12)	{Table object: 4=OBJ_PEN.(PS_SOLID | COSMETIC)}
R0046: [020] EMR_SETROP2	(s=12)	{iMode(1=R2_BLACK)}
R0047: [037] EMR_SELECTOBJECT	(s=12)	{Stock object: 5=OBJ_BRUSH.(BS_NULL)}
R0048: [025] EMR_SETBKCOLOR	(s=12)	{0xFF000000}
R0049: [018] EMR_SETBKMODE	(s=12)	{iMode(1=TRANSPARENT)}
R0050: [037] EMR_SELECTOBJECT	(s=12)	{Stock object: 7=OBJ_PEN.(PS_SOLID | COSMETIC)}
R0051: [037] EMR_SELECTOBJECT	(s=12)	{Stock object: 5=OBJ_BRUSH.(BS_NULL)}
R0052: [037] EMR_SELECTOBJECT	(s=12)	{Stock object: 13=OBJ_FONT}
R0053: [014] EMR_EOF	(s=20)	{nPalEntries:0, offPalEntries:16, nSizeLast:20}

Last edited by jonghyo kim (2014-08-21 03:04:18)

Offline

#14 2014-08-20 09:51:14

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,603
Website

Re: Vertical lines are missing randomaly in QReport + QRShape

Sounds like an issue.

But I'm quite sure that

E.Canvas.FNewPath := false;

at the place you propose is not a safe fix: it seems to by-pass the whole FNewPath pattern.

Offline

#15 2014-08-21 08:01:16

jonghyo kim
Member
Registered: 2014-03-10
Posts: 3

Re: Vertical lines are missing randomaly in QReport + QRShape

I've just added the line for debugging.

if you know more safe way, let me know please.

Last edited by jonghyo kim (2014-08-21 08:04:32)

Offline

#16 2014-08-21 10:45:49

shragam
Member
Registered: 2013-07-01
Posts: 24

Re: Vertical lines are missing randomaly in QReport + QRShape

ab wrote:

Sounds like an issue.

But I'm quite sure that

E.Canvas.FNewPath := false;

at the place you propose is not a safe fix: it seems to by-pass the whole FNewPath pattern.

Now i can see the all missing lines smile
Thanks

Offline

#17 2014-08-21 13:00:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,603
Website

Re: Vertical lines are missing randomaly in QReport + QRShape

Yes, I know but it may break other content, which where rendered as expected previously.
We did not want to introduce any regression.

Offline

#18 2014-08-22 12:53:37

shragam
Member
Registered: 2013-07-01
Posts: 24

Re: Vertical lines are missing randomaly in QReport + QRShape

ab wrote:

Yes, I know but it may break other content, which where rendered as expected previously.
We did not want to introduce any regression.

Hi
Do you have a sample or how to simulate  this break   ?
After this fix' all my report are export to PDF as i was expected.

The missing lines is very aesthetic issue  for my pdf reports and my customer do not like this.

Shraga

Offline

#19 2014-09-29 11:50:00

MBSE
Member
Registered: 2014-09-29
Posts: 1

Re: Vertical lines are missing randomaly in QReport + QRShape

Hello,

the problem is that in Quickreport the code for printing shapes test for filter TQRPDFDocumentFilter. So if you use TQRSynPDFDocumentFilter all shapes are not printed.

procedure TQRPDFShape.Print(OfsX,OfsY : Integer);
begin
  if parentreport.Exporting and IsEnabled then
  begin
         if (ParentReport.ExportFilter is TQRPDFDocumentFilter) then
         TQRPDFDocumentFilter(ParentReport.ExportFilter).acceptgraphic(
                              qrprinter.XPos(OfsX + self.Size.Left),
                              qrprinter.YPos(OfsY+ self.size.top ), self );
  end;

Offline

#20 2014-09-30 11:39:00

hn
Member
Registered: 2014-09-29
Posts: 3

Re: Vertical lines are missing randomaly in QReport + QRShape

Hi

Seems that missing lines are hidden under filled rectangles.

We tried play with EMR_BITBLT and PATCOPY handling inside EnumEMFFunc, but no success yet:

with PEMRBitBlt(R)^ do begin
  if(cyDest<0) then //seems that negative cyDest needs different handling
    E.FillRectangle(Rect(xDest,yDest+cyDest,xDest+cxDest,yDest)) //sometimes better, sometimes worse (hidden "bottom" lines)
    //E.FillRectangle(Rect(xDest,yDest+cyDest-1,xDest+cxDest,yDest-1)) //another variant
  else
    E.FillRectangle(Rect(xDest,yDest,xDest+cxDest,yDest+cyDest)); //original
  //TODO: lines (horizontal and vertical) are sometimes missing in PDF. 
  //Create simplest EMF test case for reproducing, compare EMF and PDF
  // check negative cyDest
  // check coordinates transforming and rounding
  // maybe should handle PEMRBitBlt(R)^.rclBounds as cliprect there?
  // are pen color and / or mode properly handled there?
end

Had no time to investigate, used quick workaround (with side effects, but acceptable for us):

TPdfCanvas = class(TObject)
  ...
  public
    FillRectIgnoreColor: TColor; //default: clNone, QuickReport: clWhite 
  ...
procedure TPdfEnum.FillRectangle(const Rect: TRect);
begin
  if DC[nDC].brush.color = Canvas.FillRectIgnoreColor then exit; //do not draw rectangles filled with specified (white) color
  //if (Canvas.FillRectIgnoreColor<>clNone) and (DC[nDC].brush.color = Canvas.FillRectIgnoreColor) then exit; //maybe this variant is more correct...
  ....

Last edited by hn (2014-09-30 12:29:44)

Offline

#21 2015-01-07 09:10:57

HaraldSimon
Member
Registered: 2015-01-06
Posts: 3

Re: Vertical lines are missing randomaly in QReport + QRShape

I had the same problem with missing lines using FastReport and this PDF engine.

My fix for this:

function EnumEMFFunc(...)
...
  EMR_BITBLT: begin
   ...
    case PEMRBitBlt(R)^.dwRop of // we only handle PATCOPY = fillrect
      PATCOPY:
        with PEMRBitBlt(R)^ do
        begin
          E.FillRectangle(Rect(xDest,yDest,xDest+cxDest,yDest+cyDest));
          E.Canvas.fNewPath := false;  // Reset fNewPath witch is set in FillRectangle
        end;
    end;
  end;
  EMR_STRETCHBLT: begin
   ...
    case PEMRStretchBlt(R)^.dwRop of // we only handle PATCOPY = fillrect
      PATCOPY:
        with PEMRStretchBlt(R)^ do
        begin
          E.FillRectangle(Rect(xDest,yDest,xDest+cxDest,yDest+cyDest));
          E.Canvas.fNewPath := false;    // Reset fNewPath witch is set in FillRectangle
        end;
    end;
  end;

fNewPath cannot be reseted inside FillRectangle because it is used in other situations where path matter.

Offline

#22 2015-01-07 09:20:29

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,603
Website

Re: Vertical lines are missing randomaly in QReport + QRShape

@HaraldSimon
I've tried to implement your patch in http://synopse.info/fossil/info/dfe5ad03f3

Offline

#23 2015-01-07 13:04:51

HaraldSimon
Member
Registered: 2015-01-06
Posts: 3

Re: Vertical lines are missing randomaly in QReport + QRShape

@ab
I changed my fix to your patch.
It works fine.

Offline

Board footer

Powered by FluxBB