Controlling The Format of Headings in PDF

(10 posts) (4 voices)

Tags:

  1. When I export to pdf the headings of my columns are on a single line and therefore I loose columns because I have long titles. Is there a way to force a wrap of title?

    SELECT date,
    ,col1 AS "Very Long Title"
    ,col2 AS "Very Long Title2"
    ,COL3 AS "Very Long Title2"
    .....
    ,COL 10 AS "Very Long Title10"
    FROM my table

    The result are shown nicely within a browser as the browser formats the headings correctly and wraps accordingly to the space on the screen. However, If I export to PDF the titles are on one line and my last columns disappear.

    i have successfuly changed orientation and fontsize but still columns disappear. Is there a way to force a wrap. e.g.
    ,col1 AS "Very|Long Title"

    would display as

    Very
    Long Title
    xxx
    xxx
    xxx

    Thanks

  2. myDBR Team, Key Master

    Hi,
    the 'dbr.purehtml:' formatting works also in headers as well as in data.

    You can say:

    select col1 as 'dbr.purehtml:Very XXXX Long Title'

    In place of XXXX put the HTML page break which our forum software refuses to show ;)

    This will produce line break both in HTML and in PDF.

    --
    myDBR Team

  3. monsieura, Member

    Related question I think

    I'm trying to generate a report that throws a page break after each row (formatted as pageview) - its a collection of job applications with a variable length cv at the end. Would like to start each new one on a new page.

    If the answer is similarly a purehtml command, would appreciate what I need to put in spelt out as my HTML is somewhat non-existant!

    Many thanks in advance

    Steve

  4. myDBR Team, Key Master

    To make pagebreak appear after each row in resultset your best option is to use cursor in the query and print out rows as individual resultsets followed by pagebreak-export option.

    --
    myDBR Team

  5. monsieura, Member

    Great - thats done the trick, thanks

  6. FrankDrebin, Member

    Good evening,

    I'm new to the forum and am looking for some help regarding a similar problem like user "monsieura" faced.

    Im using the following code:

    BEGIN

    CREATE PROCEDURE sp_DBR_vessel_description_v02( vVesselName varchar(45) )
    select 'dbr.pageview';
    select 'dbr.colstyle', 'Image', '[width:150px]image';
    select 'dbr.export.options', 'pagebreak', 1;

    select v.IMO as 'IMO',
    v.Vessel as 'Vessel',
    v.Delivery as 'Delivery',
    v.Type as 'Type',
    v.Owner as 'Owner',
    v.Image as 'Image'
    from vessel_overview v
    where Vessel like concat('%', vVesselName, '%');
    END

    This gives a nice output for approx. 5 datasets in one go.

    However I need one page for one dataset as a pdf-output and I don't understand how to integrate such a code.

    Thanks in advance,
    Frank

  7. myDBR Team, Key Master

    The page break does not, by default, happen within one element which the pager element is. You can define the pagebreaks within the pager element if you do following:

    1) Run the updater so you have the latest build which includes additional classes for pager-element
    2) Add following code to the report:

    Define a css definition which will add page breaks for all pager rows but the first one:

    select 'dbr.css', '.page-break.page {page-break-before:always} .page-break.page1 {page-break-before:auto}}';

    Add a page-break class to the resultset:

    select 'dbr.resultclass', 'page-break';

    As an explanation, each pager row contains a css class 'page' and 'page[rownum]'. The .page-break.page CSS rule applies to all rows and .page-break.page1 rule applies to the first one.

    --
    myDBR Team

  8. FrankDrebin, Member

    Dear myDBR Team,

    thanks for the fast reply.

    I just started in myDBR and obviously I need more help. I tried to follow your instructions and entered the following code. But this does not work - what's wrong and could you please provide me with the correct code?

    Thanks in Advance,
    Frank

    ###################
    DROP PROCEDURE IF EXISTS sp_DBR_vessel_description_v02
    $$
    CREATE PROCEDURE sp_DBR_vessel_description_v02( vVesselName varchar(45) )
    BEGIN

    select 'dbr.pageview';
    select 'dbr.colstyle', 'Image', '[width:150px]image';
    select 'dbr.export.options', 'pagebreak', 0;
    select 'dbr.css', '.page-break.page {page-break-before:always} .page-break.page1 {page-break-before:auto}}';

    select
    v.IMO as 'IMO',
    v.Name as 'Name',
    v.Delivery_Date as 'Delivery',
    v.Type as 'Type',
    v.Owner as 'Owner',
    v.Image as 'Image',
    'dbr.resultclass', 'page-break'
    from notosdb01.vessel_description v
    where Name like concat('%', vVesselName, '%');
    END
    $$
    ###############################

  9. myDBR Team, Key Master

    Almost there. You're missing the other definition:

    select 'dbr.resultclass', 'page-break';

    This will give the pager a CSS class page-break, so that the CSS defintion we created matches only for this one, in case you add more elements to the report.

    Also, make sure you have the latest build.

    --
    myDBR Team

  10. FrankDrebin, Member

    Dear myDBR Team,

    thanks - the problem was the update. I installed myDBR only a week ago and did not think that there is a new update available

    Thanks,
    Frank


Reply

You must log in to post.