You are not logged in.
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
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
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
* push *
Offline
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
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
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