Blank labels not selected in standalone

Whether you're using the Standard or Professional Edition of Quartam Reports, this is the place to ask general questions about using this industry-level reporting tool for LiveCode.
Locked
NingImport
Posts: 87
Joined: Sun Jul 18, 2010 5:23 pm

Blank labels not selected in standalone

Post by NingImport » Sun Jul 18, 2010 7:53 pm

Blank labels not selected in standalone

Posted by Pete Whittet on April 14, 2010 at 4:30pm

For label printing on a 3 x 7 sheet, I have provided the option to insert up to 11 blank records into a table. This means the user can start printing labels part-way across the page, or a line or two down, and so on (as they might have already used a few labels).

When running the app in the Rev development environment, these blank records appear, and the label text is positioned nicely on the Print Preview page. However, when I build it as a Windows standalone, the blank records do not appear - the label data is always at the top left.

I have checked that the blank records are not being sorted to the end, by trying it with a full page of label records - there is no extra page appearing at the end. I have also checked the number of records being selected within Rev - this is fine.

Any ideas ? Here's the code:

###
global gSkipNumber
global gConID

-- Print single label

on mouseUp
put -1 into gSkipNumber
go to stack "Skip" as modal -- how many labels to skip ?

if gSkipNumber = -1 then -- Cancel pressed
exit mouseUp
end if

if gSkipNumber > 0 then
-- add between 1 and 11 blank records, with all categories set to true
set the lockCursor to true
repeat for gSkipNumber times
set the cursor to busy
put "INSERT INTO Names VALUES (Null,'','','','','','','','','','','','','','',''," into theSQL
put "1,Null,Null,1,1,1,1,1,1,1,1,1,1,0,'','','','','','','','',Null,'')" after theSQL

revExecuteSQL gConID, theSQL
put the result into sqlResult

if sqlResult is not a number then
answer "Problem: " & sqlResult
end if
end repeat
set the lockCursor to false
set the cursor to arrow
end if

-- PRINT 3x7 LABELS
put "SELECT *, Address AS AddrTemp from Names WHERE (Name_ID = " & the value of field "edNameID" & ") " into theSQL
put "OR (Title = '' AND Inits = '' AND Surname = '') ORDER BY Surname, Inits, Title" after theSQL

revSetSQLOfQuery "dummy", theSQL -- dummy is a query set up via the Database Query Builder for this stack

put "Labels 3x7.qll" into tLayoutFile
put "dummy" into tQueryName
put true into tShowPreview

qrtReports_SetPreviewWindowStyle "modal"

-- print the report
--qrtReports_PrintLabelSetForQuery tLayoutFile, tQueryName, tShowPreview
-- the previous line should work after the next release
-- the following 2 lines are a workaround until the next release
put revCursorOfQuery("dummy") into tCursor
qrtReports_PrintLabelSetForCursor tLayoutFile, tCursor, tShowPreview

-- delete any blank records
put "DELETE FROM Names WHERE Title = '' AND Inits = '' and Surname = ''" into theSQL
revExecuteSQL gConID, theSQL
put the result into sqlResult

if sqlResult is not a number then
answer "Problem: " & sqlResult
end if

end mouseUp
###

=====

Reply by Pete Whittet on April 15, 2010 at 1:12am

Update: I just changed it to add a "blank" record with "A" for the Title, Inits and Surname fields - the same thing is happening. In the dev environment, the "A A A" records are picked up, but in the the standalone executable, they are not.

=====

Reply by Pete Whittet on April 15, 2010 at 12:46pm

OK, all sorted. Red face time, but just in case anyone else manages to trip themselves up with such a basic mistake ... in the Database Query Builder, where the "dummy" query is defined, instead of just entering the name of the database (e.g. dbname.db3), which allows Rev to sort out which folder to look in, I had entered the full path. So: the standalone was using one database, while Quartam Reports was using (via the dummy query) a different one. Now where's my dunce's cap ...

=====

Reply by Jan Schenkel on April 18, 2010 at 2:41pm

Glad to hear you worked it out, Pete. The database query builder is a convenient way of displaying database content, but it has its peculiarities...

Cheers,

Jan Schenkel
--
Quartam Reports & PDF Library for Revolution
www.quartam.com
===== The above post was imported from the old forum hosted at quartam.ning.com =====

Locked