Forum Replies Created

  • Rudolf Bargholz Bargholz

    Member
    October 19, 2018 at 10:09 am in reply to: Print two report on the same page

    Hi Mimmo,
    This is probably not something I would want to do in Omnis, but ….
    You can store a page setup for a printer in a report. That page setup stores detailed printer specific information, for example how many pages shoud be printed on one page, which printer are you printing to, what tray etc.. If you now set the repeatfactor to 2 in your Omnis report, two pages will be printed, normally on two pages. If you tell the printer driver to print two pages on one A4 page, your two pages will be printed on one page, saving you paper. It is a similar principle to printing one paper page front and back. You cannot tell Omnis to do that for you, but the printer driver knows how to do this, so you load the page setup with the correpsonding printer settings before printing your report, and let the printer driver do all the magic. Not all printer drivers support this, so it makes little sense to have Omnis define this directly.
    Here some links that might help explaining how load page setup works:
    https://omnis.net/technotes/tnpr0005.jsp
    http://www.studiotips.net/docs/tips/reports/reports.html
    Regards
    Rudolf

  • Rudolf Bargholz Bargholz

    Member
    October 19, 2018 at 9:55 am in reply to: Omnis Studio with DB2 and unicode

    Hi Andrew,
    I have sent support details how to reproduce the problem. Hopefully I have not missed something obvious in reporting this.
    In case someone sees this topic, needs test code, and does not want to redo everything I have done ….
    Here code to create a DB2 database and write unicode data to a test table
    Create the database

    Open the db2cmd, and enter the following to create a new DB2 database called UNITEST:
    create database unitest automatic storage yes on ‘c:’ pagesize 4096 autoconfigure using isolation cs apply db only
    restart database unitest
    connect to UNITEST user db2admin using PasswordHere
    get db cfg for unitest

    Database territory = DE
    Database code page = 1208
    Database code set = UTF-8
    Database country/region code = 49
    Database collating sequence = SYSTEM_1252


    Create the table and insert valid data outside of Omnis

    DROP TABLE DB2ADMIN.UNICODETEST;
    CREATE TABLE DB2ADMIN.UNICODETEST (TESTCOL VARCHAR(20));
    DELETE FROM DB2ADMIN.UNICODETEST;
    INSERT INTO DB2ADMIN.UNICODETEST (TESTCOL) VALUES (‘ńą’);
    INSERT INTO DB2ADMIN.UNICODETEST (TESTCOL) VALUES (x’C584′ || x’C485′);
    SELECT TESTCOL, hex(TESTCOL) FROM DB2ADMIN.UNICODETEST;

    Omnis code to write and read unicode data

    If db2sess.$logon(hostname,username,password,’UNITEST’)
    Else
    OK message DB2 {Logon ERROR}
    Quit all methods
    End If
    Do db2sess.$newstatement() Returns db2stat
    Do db2stat.$execdirect(” drop table UNICODETEST “)
    Do db2stat.$execdirect(” create table UNICODETEST ( TESTCOL VARCHAR(20) ) “)
    Do db2stat.$execdirect(” delete from UNICODETEST “)
    Do db2stat.$execdirect(” insert into UNICODETEST (TESTCOL) values (‘ńą’) “)
    Do row.$definefromsqlclass($schemas.sUNICODETEST)
    Do row.$sessionobject.$assign(db2sess)
    Do row.$select()
    Do row.$fetch()
    Calculate hexval as ”
    Do db2stat.$execdirect(” select hex(TESTCOL) from UNICODETEST “)
    Do db2stat.$fetchinto(hexval)
    OK message direct insert WITHOUT bind variables {Insert: ńą//Result: [row.TESTCOL]//HEX: [hexval] (ought to be c584c485)}
    Do db2stat.$execdirect(” delete from UNICODETEST “)
    Do row.$definefromsqlclass($schemas.sUNICODETEST)
    Do row.$sessionobject.$assign(db2sess)
    Calculate row.c1 as ‘ńą’
    Do row.$insert()
    Do row.$definefromsqlclass($schemas.sUNICODETEST)
    Do row.$sessionobject.$assign(db2sess)
    Do row.$select()
    Do row.$fetch()
    Calculate hexval as ”
    Do db2stat.$execdirect(” select hex(TESTCOL) from UNICODETEST “)
    Do db2stat.$fetchinto(hexval)
    OK message direct insert WITH bind variables {Insert: ńą//Result: [row.TESTCOL]//HEX: [hexval] (ought to be c584c485)}
    Breakpoint

    Data written from Omnis is not stored as valid UTF-8 on the database. In some cases Omnis can write data and not read the data written, in others Omnis can read the incorrectly written dta correctly back again.
    Regards
    Rudolf

  • Rudolf Bargholz Bargholz

    Member
    October 19, 2018 at 8:08 am in reply to: Omnis Studio with DB2 and unicode

    Hi Andrew,
    Thank you for responding. I will put together a detailed description and contact support.
    Regards
    Rudolf