Telerik Forums
Kendo UI for jQuery Forum
17 answers
1.6K+ views
I need to export large table to pdf file using kendo pdfExport. This code I have so far:

html:

<div style="position:relative;" id="temp-container">
        <div style="position:absolute;left:0px;top:50px;width:100%;background:url('http://127.0.0.1:8000/images/arrow1.png') no-repeat;height:50px;"></div>
        <div style="position:absolute;left:26%;top:50px;font-size:28px;">Number</div>
        <div style="position:absolute;left:50%;margin-left:-50px;width:100px;top:90px;font-size:28px;">Original</div>
         
        <div style="position:absolute;right:0px;width:33%;top:50px;">Date1</div>
        <div style="position:absolute;right:0px;width:33%;top:80px;">Date2</div>
        <div style="position:absolute;right:0px;width:33%;top:110px;">Date3</div>
         
        <div style="position:absolute;left:0px;right:0px;top:150px;background:url('http://127.0.0.1:8000/images/arrow3.png') no-repeat;height:50px;background-size:100% 100%;"></div>
         
        <table cellpadding="6px" cellspacing="3px" border="0px" style="width:100%;position:relative;top:200px;">
            <tr>
                <td style="width:80px;position:relative;text-align:center;height:30px;line-height:30px;">
                    <div style="position:absolute;right:0px;top:0px;bottom:0px;width:22px;background:url('http://127.0.0.1:8000/images/background.png') repeat;">LP</div>
                </td>
                <td style="width:300px;background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">Index</td>
                <td style="background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">TEXT</td>
            </tr>
            <tr>
                <td style="width:80px;position:relative;text-align:center;height:30px;line-height:30px;">
                    <div style="position:absolute;right:0px;top:0px;bottom:0px;width:22px;background:url('http://127.0.0.1:8000/images/background.png') repeat;">LP</div>
                </td>
                <td style="width:300px;background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">Index</td>
                <td style="background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">TEXT</td>
            </tr>
            <tr>
                <td style="width:80px;position:relative;text-align:center;height:30px;line-height:30px;">
                    <div style="position:absolute;right:0px;top:0px;bottom:0px;width:22px;background:url('http://127.0.0.1:8000/images/background.png') repeat;">LP</div>
                </td>
                <td style="width:300px;background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">Index</td>
                <td style="background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">TEXT</td>
            </tr>
            <tr>
                <td style="width:80px;position:relative;text-align:center;height:30px;line-height:30px;">
                    <div style="position:absolute;right:0px;top:0px;bottom:0px;width:22px;background:url('http://127.0.0.1:8000/images/background.png') repeat;">LP</div>
                </td>
                <td style="width:300px;background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">Index</td>
                <td style="background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">TEXT</td>
            </tr>
            <tr>
                <td style="width:80px;position:relative;text-align:center;height:30px;line-height:30px;">
                    <div style="position:absolute;right:0px;top:0px;bottom:0px;width:22px;background:url('http://127.0.0.1:8000/images/background.png') repeat;">LP</div>
                </td>
                <td style="width:300px;background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">Index</td>
                <td style="background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">TEXT</td>
            </tr>
            <tr>
                <td style="width:80px;position:relative;text-align:center;height:30px;line-height:30px;">
                    <div style="position:absolute;right:0px;top:0px;bottom:0px;width:22px;background:url('http://127.0.0.1:8000/images/background.png') repeat;">LP</div>
                </td>
                <td style="width:300px;background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">Index</td>
                <td style="background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">TEXT</td>
            </tr>
            <tr>
                <td style="width:80px;position:relative;text-align:center;height:30px;line-height:30px;">
                    <div style="position:absolute;right:0px;top:0px;bottom:0px;width:22px;background:url('http://127.0.0.1:8000/images/background.png') repeat;">LP</div>
                </td>
                <td style="width:300px;background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">Index</td>
                <td style="background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">TEXT</td>
            </tr>
            <tr>
                <td style="width:80px;position:relative;text-align:center;height:30px;line-height:30px;">
                    <div style="position:absolute;right:0px;top:0px;bottom:0px;width:22px;background:url('http://127.0.0.1:8000/images/background.png') repeat;">LP</div>
                </td>
                <td style="width:300px;background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">Index</td>
                <td style="background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">TEXT</td>
            </tr>
            <tr>
                <td style="width:80px;position:relative;text-align:center;height:30px;line-height:30px;">
                    <div style="position:absolute;right:0px;top:0px;bottom:0px;width:22px;background:url('http://127.0.0.1:8000/images/background.png') repeat;">LP</div>
                </td>
                <td style="width:300px;background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">Index</td>
                <td style="background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">TEXT</td>
            </tr>
            <tr>
                <td style="width:80px;position:relative;text-align:center;height:30px;line-height:30px;">
                    <div style="position:absolute;right:0px;top:0px;bottom:0px;width:22px;background:url('http://127.0.0.1:8000/images/background.png') repeat;">LP</div>
                </td>
                <td style="width:300px;background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">Index</td>
                <td style="background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">TEXT</td>
            </tr>
            <tr>
                <td style="width:80px;position:relative;text-align:center;height:30px;line-height:30px;">
                    <div style="position:absolute;right:0px;top:0px;bottom:0px;width:22px;background:url('http://127.0.0.1:8000/images/background.png') repeat;">LP</div>
                </td>
                <td style="width:300px;background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">Index</td>
                <td style="background:url('http://127.0.0.1:8000/images/background.png') repeat-x;text-align:center;">TEXT</td>
            </tr>
        </table>
    </div>


and this is pdf export function call:

setTimeout(function () {
            kendo.drawing.drawDOM($("#temp-container"))
                .then(function (group) {
                    // Render the result as a PDF file
                    return kendo.drawing.exportPDF(group, {
                        paperSize: "A4",
                        multiPage: true,
                        margin: { left: "0cm", top: "1cm", right: "0cm", bottom: "1cm" }
                    });
                })
                .done(function (data) {
                    // Save the PDF file
                    kendo.saveAs({
                        dataURI: data,
                        fileName: "HR-Dashboard.pdf",
                        proxyURL: "http://demos.telerik.com/kendo-ui/service/export"
                    });
                });
        }, 1000);


My problem is that generated file has one page only. According to documentation http://docs.telerik.com/kendo-ui/framework/drawing/drawing-dom#automatic-page-breaking-q1-2015 my table cannot be positioned as fixed or absolute and is not. I need to apply autopaging because I don't know how many elements will be in table. In example above is a lot of them but in some other cases one or two elements only. What am I doing wrong?

And another problem that drives me crazy is that I cannot adjust papersize. I tried to set A4, A5 in exportPDF attributes and set width and height of main container  in inches. But still the generated document is not properly adjusted. I think that paperSize A4 should automatically adjust main container to A4 size?
T. Tsonev
Telerik team
 answered on 06 Dec 2016
2 answers
11.2K+ views

Hi All,

 This is my click event code for search image of a template, but the click event doesn't fired.  Is there something missing here?  or is there a better way to do this?  TIA

 columns[{
                title: "Name",
                field: "Name",
                width: 225,
                template: "#=Name# <span class='k-icon k-i-close' id='temp' style='float: right;' click='test()'></span>",
                .....
            }],​

 

function test(){

   alert("Hello"); 

}

 

 

Nathan
Top achievements
Rank 1
 answered on 05 Dec 2016
1 answer
665 views

Hello!

I was wondering if there is a way to ensure, especially on mobile, that when a user taps into the editor for the first time and starts typing that the first letter is automatically capitalized?  I don't need each word capitalized, just the very first letter typed in the editor.

Thanks!

Rumen
Telerik team
 answered on 05 Dec 2016
1 answer
232 views
I'd like to overwrite the disabled cell class, so that for disabled cells, I can give a different font colour. Please can you give me the class name I should overwrite.
Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 05 Dec 2016
1 answer
78 views

Hi,

 

I'm trying to follow the example illustrated in http://dojo.telerik.com/OwUCE/44 about adding a custom button in the toolbar part of the Scheduler.

However i noticed that if you resize the browser window multiple times, the button (hence the "dataBound" event gets fired multiple times) therefore 

we get a lot of new buttons. Is there a way to force that this button is only created ONCE?

 

 

Veselin Tsvetanov
Telerik team
 answered on 05 Dec 2016
3 answers
242 views

I have a server side service that returns json that looks like [{appID:"11"},{appID:"22"}]

In this case the text and values are the same.

When I am doing a call to "value" function I see that a data is fetched from the server.

var combobox = $("#combobox").data("kendoComboBox");

combobox.value("11");

Why a call to server is required in case that the text and value are the same?

Is there a way to set the value without a need to fetch data from the server?

 

thanks,

Evyatar

Dimiter Topalov
Telerik team
 answered on 05 Dec 2016
1 answer
360 views

we are using kendo numeric text box in our angular js project.

it adds more decimal place ,when we increment the values from 0.06 to 0.07

http://dojo.telerik.com/aZAQU/2

 

Dimiter Topalov
Telerik team
 answered on 05 Dec 2016
1 answer
81 views

Hi

i have created scheduler with custom edit page, which have 3 radio button.

for these radio button i have same name, but different ids.

but in save event, it takes name only to fetch the data

e.g. e.event.title

how we can get data using ids or do we have any other way to know which radio button is clecked.

Thanks

Siddhartha

Plamen
Telerik team
 answered on 05 Dec 2016
5 answers
115 views
I took your grid adaptive rendering sample, plopped it into jsbin and it works without issue.  Once I changed the sample to MVVM, I started getting some strange functionality from it.  The column menu/filter would work just like the non-mvvm sample, but editing a record would throw a popup just like if it were a non-adaptive rendered grid.

Your Grid Sample http://jsbin.com/ofaZose/3/edit
MVVM sample http://jsbin.com/ofaZose/4/edit

Is there a configuration I am missing, I've even gone into the chrome tools and overridden the user agent with a mobile one and use the mobile device's screen size etc, but still having some issues editing a record on an mvvm bound grid.
There are some strange css issues going on as well, as in the column menu and filter screens are very unstyled (not sure if this is from the same issue or maybe I've messed up a jsbin css link).

Thanks.

Robin
Nikolay Rusev
Telerik team
 answered on 05 Dec 2016
1 answer
797 views

Inside a a window component, using some bootstrap classes doesn't seem to work. For instance, col-lg-12 is not 1 row, but goes onto the second row.

Also - resizing the window does not cause bootstrap to respond well and stack the elements properly.

Thanks!

 

Iliana Dyankova
Telerik team
 answered on 05 Dec 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?