#1 2013-09-13 12:41:52

Jumpy
Member
Registered: 2013-09-13
Posts: 7

Problem with .DrawTextAcrossCols on Webserver only

Hello,

I generate a PDF-Report with  SQLite3Pages that colors the background of the rows alternating gray and white using the following code:

//var GDI:TGDIPages;

  QH:=PWideChar(GetNextDataRow);
  if PrintBG then
    GDI.DrawTextAcrossColsFromCSV(QH,clSilver)
  else
    GDI.DrawTextAcrossColsFromCSV(QH);

That works in my Desktop Application without porblems.

The exactly same function to create the same PDF in my Webserver CGI-Application has problems. It stops alternating the background colors after ~2/3 of the page.

It is an Windows2000 Server with old IIS where no Printer is installed. IIS-Service runs under LocalSystem. I can only guess that it is related to the combination IIS/LocalSystem context, because (as a test) running the Desktop-Application on that Webserver created the PDF as desired.

I'm printing an A4 page and maybe the problem is, that somewhere the orientation gets messed up because there is no information about a printer or sth. The height of an A4 in landscape is about 2/3 of a page in portrait.

But it's only the colored background that is missing. The Text is there. If I use lines to separete the rows, using:
GDI.AddColumnHeadersFromCSV(QH, true, true); //true for GrayUnderlines
The gray lines will be drawn. Only the colored background boxes arround the last 1/3 rows are missing.

Looking in the .DrawTextAcrossCols function I see that the background is drawn on the canvas using FillRect(RowRect). But I don't understand enough of the sourcecode to see, if there's a problem with the coordinates of the Rect.

As it only happes in the Webserver, I don't know how to debug that properly.

Anyone an idea?

Jumpy

Offline

#2 2013-09-13 13:29:19

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

Re: Problem with .DrawTextAcrossCols on Webserver only

Are you using the latest "unstable" 1.18 version from http://synopse.info/files/mORMotNightlyBuild.zip ?

Could you try to export the pages as EMF files to see if the problem is at TMetaFile level or PDF?

Online

#3 2013-09-13 15:03:50

Jumpy
Member
Registered: 2013-09-13
Posts: 7

Re: Problem with .DrawTextAcrossCols on Webserver only

I'm using an older version where mormotreport.pas still runs by the name sqlite3pages.pas.

I'll try the latest version, later.


As to EMF. How can I export the pages to EMF?

Edit: I found out how to export each page to emf. I used the following code:

    for k := 0 to GDI.Pages.Count-1 do
      TMetaFile(GDI.Pages.Objects[k]).SaveToFile(EMFName(k));

The Result: The alternating lines are already missing in the EMF!


Next Edit:
Tried latest "unstable" and latest "Stable" version, using mormotreport.pas.
The Result: The backgound color of lines/rows are still missing after 2/3 of the page.

Last edited by Jumpy (2013-09-15 07:37:41)

Offline

#4 2013-09-16 19:28:03

Jumpy
Member
Registered: 2013-09-13
Posts: 7

Re: Problem with .DrawTextAcrossCols on Webserver only

* push *

Offline

#5 2013-09-17 05:05:11

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

Re: Problem with .DrawTextAcrossCols on Webserver only

Could you take a look at the emf content using a tool like http://frazmitic.free.fr/emfexplorer ?

You should be able to see the EMF commands serialized.

Online

#6 2013-09-17 12:37:18

Jumpy
Member
Registered: 2013-09-13
Posts: 7

Re: Problem with .DrawTextAcrossCols on Webserver only

Hello,
I can look at the file with the tool you named, but I don't know what to make of that, because it's way over my head.

Could I upload an emf or send one as an example to you by pn or email?

Offline

#7 2013-09-17 14:09:46

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

Re: Problem with .DrawTextAcrossCols on Webserver only

Yes, you can upload to dropbox for instance, then put your link in this forum.

Online

#8 2013-09-18 08:06:43

Jumpy
Member
Registered: 2013-09-13
Posts: 7

Re: Problem with .DrawTextAcrossCols on Webserver only

Here's a Dropdown-Link to a zip containing the pdf (3 pages) and one emf for each page:

https://www.dropbox.com/s/sl5ck44eaf1hp … ND_EMF.zip

I hope, you can identify the problem.

Offline

#9 2013-09-18 15:51:53

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

Re: Problem with .DrawTextAcrossCols on Webserver only

I took a look at it, without being able to find out yet what is wrong.

I'll check further.

Online

Board footer

Powered by FluxBB