globals

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

globals

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

globals

Posted by Till Bandi on December 30, 2008 at 10:31pm

I tried to use a global in a label report. First everything worked perfect - after a crash I get only the name of the global. I was not able to revert to a successful implementation. Has anyone a clue?

=====

Reply by Jan Schenkel on December 31, 2008 at 6:45am
Delete
Hi Till,

Could you post the relevant script snippet? Also, is the global initialized - as in, visible in the message box?

We'll figure it out, I'm sure.

Jan Schenkel
--
Quartam Reports & PDF Library for Revolution
www.quartam.com

=====

Reply by Till Bandi on December 31, 2008 at 10:15am

here it comes:

----------------------------------------------
on mouseUp
-- define the variables
global gAdresseFKP
local vLayoutFile, vStackName, vShowPreview
if "qrtReportsLib" is not among the lines of the stacksinuse then
start using stack "/Users/tibi/Arbeiten/z_RunRev/Quartam Reports/Quartam Reports 1.1.1/Quartam Reports 1.1.1/qrtReportsLib.rev"
end if
answer "Vorschau oder drucken?" with "Vorschau" or "drucken"
if it is "Vorschau" then
put true into vShowPreview
else
put false into vShowPreview
end if
put "/Users/tibi/Arbeiten/z_RunRev/Quartam Reports/Druckversuche/FKP2" into vFilePath
put "AdressenFKP" into vStackName
qrtReports_PrintLabelSetForStack vFilePath, vStackName, vShowPreview,vCardRange,gAdresseFKP
end mouseUp
----------------------------------------------

the global is filled in the stack script:

on openCard
....
global gSucheAdrHstrMarkiert,gAdresseFKP
....
put fld "Adresse" into gAdresseFKP
if fld "Anrede" is not empty then
put fld "Anrede" & return before gAdresseFKP
-- answer gAdresseFKP
end if
-----------end Anrede
pass openCard
end openCard
----------------------------------------------

If I put the adress field into the report everything works well (but without the salutation).

Sorry, it must be a simple silly mistake, but I don't see it.

Thanks, Till

=====

Reply by Jan Schenkel on January 1, 2009 at 8:36am

Hi Till,

The last parameter is a comma-delimited list of global variable names. So:

qrtReports_PrintLabelSetForStack vFilePath, vStackName, vShowPreview,vCardRange,gAdresseFKP

should be:

qrtReports_PrintLabelSetForStack vFilePath, vStackName, vShowPreview,vCardRange,"gAdresseFKP"

and then it should work properly.

HTH,

Jan Schenkel
--
Quartam Reports & PDF Library for Revolution
www.quartam.com

=====

Reply by Till Bandi on January 1, 2009 at 3:58pm

thanks Jan

that was it! ... but now the line breaks don't work the way they should. (I don't know when this started but I know that the last time I used the report - it's a year since - the addresses were correct).

I tried to work with the field (not the global), the way I did it last year, no success. Then I tried to put a return after every line of the global - no success either. Again it is probably a small mistake but I can't find it. To illustrate the problem I annex a picture of the preview where I have marked the first 6 occurrences.

Maybe you can see what I did wrong?

Thanks again, Till
Attachments:
Bild 1.pdf, 121 KB Delete

=====

Reply by Jan Schenkel on January 1, 2009 at 10:34pm

In the layout file, how have you defined the format of the data field with expression "gAdresseFKP"? Is it Text, UnicodeText, HtmlText, RtfText,...?

Jan Schenkel
--
Quartam Reports & PDF Library for Revolution
www.quartam.com

=====

Reply by Till Bandi on January 2, 2009 at 2:50am

that was the mistake – thanks!

Trying to figure out what was wrong with the global, one of the things I tried was changing from "Text" to "HTMLText". Now I changed back to "Text" and everything is ok – even though I don't really understand why the returns disappear with "HTMLText".

Thanks

Till Bandi

=====

Reply by Jan Schenkel on January 2, 2009 at 6:54am

Well, the Text, UnicodeText, HtmlText and RTFText formatting options allow you to bring different types of information into your report. If all you want to bring is plain ASCII text, then stick with Text. If you want to bring in unicode data without styles, then you can use UnicodeText.
But if you want to bring in styled text that may contain characters from a non-English alphabet, then you'll want HtmlText or RtfText. This can be as simple as setting the expression of the data field in your report to [the htmlText of field "Styled Comments"] and then changing the format to [Html Text]

Anyway, glad to be of service,

Jan Schenkel
--
Quartam Reports & PDF Library for Revolution
www.quartam.com

=====

Reply by Till Bandi on January 2, 2009 at 12:44pm

now everything works as expected, even the conversion to htmlText.

Maybe for the next version / The only problem I still saw: if I change one word in a field of my RunRev-Stack to bold and directly afterwords print the Labels (preview) I get a wrong Layout (-> Pict1) and can't close it (-> Pict2), I have to force quit and then restart Revolution again. On the opposite, if I first save and close the stack and then reopen it again and produce the report, then everything is fine.

Thanks, Till
Attachments:
Pict1.png, 21 KB Delete
Pict2.png, 17 KB Delete

=====

Reply by Jan Schenkel on January 2, 2009 at 8:01pm

It looks like something got confused internally, and the preview window opened without an actual (hidden) report stack back-end to display.
If you could email a slimmed down example stack to support@quartam.com which helps to reproduce this problem, I'll work on fixing it for QR 1.1.2

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