SMART datagrid v.1 > Reporting > Concepts

Back  Forward

Concepts.Print Dimension

1. Print Unit

The location and size value, which is specified in SMART datagrid Reporting, is set by PrintDimension data type. It can be specified by several units listed in the table below, and will be specified as pixel if not specify the unit. 

If it is not pixel, it will be converted to pixel internally according to html dpi value which is global constant, and the default value of html dpi is 96. Dpi global value can be changed through PrintOptions

Table-1  Printing Size Unit
UnitExplanationExample
ininches. Converted to 'Value x dpi'.'120in'
cmcentimeters. Converted to 'Value x 0.393701 dpi*'.'21.1cm'
mmmilliimeters. Converted to 'Value x 0.0393701 dpi*'.'211mm'
pxpixels. The default value. You do not have to specify the unit.'800px', 1200
Code -1
    var report = {
        pageHeader: {
            items: [{
                right: '1cm',
                text: 'SMART datagrid Inc'
            }]
        },
        ...
    };
    DLReport.preview(grdMain, report, data, {
        // PrintOptions
        papaerWidth: "180mm",
        paperHeight: "23.0cm",
        paperMaringTop: "0.3in",
        paperMarginBottom: "50px",
        paperMarginLeft: 43
        ...
    }, true);
2. Paper Size

In pure web printing, there is little print information which can be known or controlled by JavaScript. In particular, since it cannot know even the paper size of the printer, the developer (or the user) should directly set the print paper size, margin and print orientation to match the size of printed elements with the actual size. 

SMART datagrid Reporting Module can set this information through PrintOptions, and the setting information is transferred to DLReport.preview function. 

In PrintOptions, Paper Width and Paper Height have been set as A4(210 X 297mm) by default, and the default values of TopBottom, Left, Right margins are 15mm, 15mm, 12mm, 12mm respectively. And, Print Orientation has been set as PaperOrientation.PORTRAIT. Only if these values are the same as physical printer settings, the actual size of each element printed in the document can be the same as the size specified in the report model. 

Especially, since the browsers handle page alignment through scaling, even if each page is displayed well in browser preview, it does not mean it matches actual conditions. If it is an output of which dimensions are very important, you must actually measure with the printed document. And, since the error of 1mm level can exist empirically, especially in order to print multiple pages, it may require some trial and error for a particular printer. 

See Also
PrintOptions
PrintItem
preview
Examples
Hello Report